aboutsummaryrefslogtreecommitdiff
path: root/findservice.h
diff options
context:
space:
mode:
Diffstat (limited to 'findservice.h')
-rw-r--r--findservice.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/findservice.h b/findservice.h
new file mode 100644
index 0000000..29f3f1a
--- /dev/null
+++ b/findservice.h
@@ -0,0 +1,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;
+}