]> andersk Git - moira.git/blobdiff - server/qsubs.c
If creating a list which has the same name as a username, prompt and ask
[moira.git] / server / qsubs.c
index 3ac37f1c705c76961efe87137b6c49ecb56fef47..8325ee65a2e5bc2ab4b737e044f29a9e27a11d51 100644 (file)
@@ -14,11 +14,16 @@ static char *rcsid_qsubs_c = "$Header$";
 #endif lint
 
 #include <mit-copyright.h>
-#include <sms.h>
+#include <moira.h>
 #include "query.h"
 
+#ifdef MULTIPROTOCOLS
 extern struct query Queries1[], Queries2[];
 extern int QueryCount1, QueryCount2;
+#else
+extern struct query Queries2[];
+extern int QueryCount2;
+#endif MULTIPROTOCOLS
 
 struct query *
 get_query_by_name(name, version)
@@ -28,13 +33,17 @@ get_query_by_name(name, version)
     register struct query *q;
     register int i;
 
-    if (version == SMS_VERSION_1) {
+#ifdef MULTIPROTOCOLS
+    if (version == MR_VERSION_1) {
        q = Queries1;
        i = QueryCount1;
     } else {
+#endif
        q = Queries2;
        i = QueryCount2;
+#ifdef MULTIPROTOCOLS
     }  
+#endif
 
     if (strlen(name) == 4) {
        while (--i >= 0) {
@@ -58,7 +67,9 @@ list_queries(version, action, actarg)
 {
   register struct query *q;
   register int i;
+#ifdef MULTIPROTOCOLS
   static struct query **squeries1 = (struct query **)0;
+#endif
   static struct query **squeries2 = (struct query **)0;
   register struct query **sq;
   char qnames[80];
@@ -66,7 +77,8 @@ list_queries(version, action, actarg)
   int count;
   int qcmp();
 
-  if (version == SMS_VERSION_1) {
+#ifdef MULTIPROTOCOLS
+  if (version == MR_VERSION_1) {
       count = QueryCount1;
       if (squeries1 == (struct query **)0) {
          sq = (struct query **)malloc(count * sizeof (struct query *));
@@ -78,6 +90,7 @@ list_queries(version, action, actarg)
       }
       sq = squeries1;
   } else {
+#endif
       count = QueryCount2;
       if (squeries2 == (struct query **)0) {
          sq = (struct query **)malloc(count * sizeof (struct query *));
@@ -88,7 +101,9 @@ list_queries(version, action, actarg)
          qsort(squeries2, count, sizeof (struct query *), qcmp);
       }
       sq = squeries2;
+#ifdef MULTIPROTOCOLS
   }
+#endif
 
   qnp = qnames;
   for (i = count; --i >= 0; sq++) {
This page took 0.044054 seconds and 4 git commands to generate.