aboutsummaryrefslogtreecommitdiff
path: root/findservice.h
blob: 29f3f1a706fb981dac6a31a1b9f5d7c6bb026690 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifdef INIT_PROGRAM
static void circsweep() {
  int i;
  for (i=0; i<=maxprocess; i++)
    root[i].pr_circular=0;
}
#endif


/* return index of service in process data structure or -1 if not found */
static int findservice(char *service) {
  int i;

  for (i=0; i<=maxprocess; ++i) {
#if defined (INIT_PROGRAM) && ! defined (INIT_BLACK)
    char *x=root_name(i), *y=service;
    while (*x == *y && *x) { x++; y++; }
    if (*x==*y) return i;
#else
    if (!str_diff(root_name(i), service)) return i;
#endif
  }
  return -1;
}