src/modules/systemd/systemd.c
/*
 * systemd_cmptype returns non-zero if the given unit name has the given type
 * extension. E.g. system_cmptype("dbus.service", "service") != 0
 */
systemd_cmptype returns non-zero if the given unit name has the given type
extension.
systemd_cmptype returns non - zero if the given unit name has the given type extension .
int systemd_cmptype(const char *unit, const char *type)
{
  const char *c;
  for (c = unit; ; c++) {
    if ('\0' == *c)
      return 0;
    if ('.' == *c)
      break;
  }
  return (0 == strcmp(++c, type));
}
int systemd_cmptype ( const char * unit , const char * type ) { const char * c ; for ( c = unit ; ; c ++ ) { if ( ' \0 ' == * c ) return 0 ; if ( ' ' == * c ) break ; } return ( 0 == strcmp ( ++ c , type ) ) ; }
systemd_cmptype returns non-zero if the given unit name has the given type
 extension.
systemd_cmptype returns non - zero if the given unit name has the given type extension .