]> andersk Git - moira.git/blobdiff - server/queries2.c
added save_queue and hash_table definitions
[moira.git] / server / queries2.c
index 233c0334703a891461e57ab3655d16e7594fdd02..b752ce866091cb11098eb2f65019cb4f6e36782b 100644 (file)
@@ -3,8 +3,11 @@
  * $Header$
  *
  * Copyright 1987, 1988 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
  */
 
+#include <mit-copyright.h>
 #include "query.h"
 #include "sms_et.h"
 
@@ -53,7 +56,7 @@ int set_modtime();
 int set_modtime_by_id();
 int set_finger_modtime();
 int set_pobox_modtime();
-int set_mach_modtime();
+int set_uppercase_modtime();
 int set_mach_modtime_by_id();
 int set_cluster_modtime_by_id();
 int set_serverhost_modtime();
@@ -518,7 +521,7 @@ static struct validate amac_validate = {
   MACH_ID,
   0,
   0,
-  set_mach_modtime,
+  set_uppercase_modtime,
 };
 
 static char *umac_fields[] = {
@@ -656,7 +659,6 @@ static char *acld_fields[] = {
 static struct valobj acld_valobj[] =
 {
   {V_ID, 0, CLUSTER, NAME, CLU_ID, SMS_CLUSTER},
-  {V_TYPE, 1, "slabel", 0, 0, SMS_TYPE},
   {V_CHAR, 2},
 };
 
@@ -738,7 +740,7 @@ static struct validate asin_validate =      /* for asin, usin */
   0,
   0,
   0,
-  set_modtime,
+  set_uppercase_modtime,
 };
 
 static struct validate rsve_validate = {
@@ -750,7 +752,7 @@ static struct validate rsve_validate = {
   0,
   access_service,
   0,
-  set_modtime,
+  set_uppercase_modtime,
 };
 
 static char *ssif_fields[] = {
@@ -1526,16 +1528,23 @@ static char *gasv_fields[] = {
 
 static char *gpcp_fields[] = {
     "printer",
-    "printer", "printcap", MOD1, MOD2, MOD3,
+    "printer", "spooling_host", "spool_directory", "rprinter", "comments",
+    MOD1, MOD2, MOD3,
 };
 
 static char *apcp_fields[] = {
-    "printer", "printcap", MOD1, MOD2, MOD3,
+    "printer", "spooling_host", "spool_directory", "rprinter", "comments",
+    MOD1, MOD2, MOD3,
+};
+
+static struct valobj apcp_valobj[] = {
+    {V_CHAR, 0},
+    {V_ID, 1, MACHINE, NAME, MACH_ID, SMS_MACHINE},
 };
 
 static struct validate apcp_validate = {
-  VOchar0,
-  1,
+  apcp_valobj,
+  2,
   NAME,
   "p.name = \"%s\"",
   1,
@@ -1545,6 +1554,18 @@ static struct validate apcp_validate = {
   set_modtime,
 };
 
+static struct validate dpcp_validate = {
+  0,
+  0,
+  NAME,
+  "p.name = \"%s\"",
+  1,
+  0,
+  0,
+  0,
+  0,
+};
+
 static char *gali_fields[] = {
   NAME, TYPE, "trans",
   NAME, TYPE, "trans",
@@ -2695,7 +2716,7 @@ struct query Queries2[] = {
     "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name, %c = nq.modtime, %c = text(nq.modby), %c = nq.modwith",
     gnfq_fields,
     8,
-    "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and nfsphys.nfsphys_id = filesys.phys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
+    "filesys.label = \"%s\" and nq.users_id = %d and filesys.filsys_id = nq.filsys_id and nfsphys.nfsphys_id = nq.phys_id and machine.mach_id = filesys.mach_id and users.users_id = nq.users_id",
     2,
     &gnfq_validate,
   },
@@ -2710,7 +2731,7 @@ struct query Queries2[] = {
     "%c = filesys.label, %c = users.login, %c = text(nq.quota), %c = nfsphys.dir, %c = machine.name",
     gnqp_fields,
     5,
-    "filesys.mach_id = %d and nfsphys.dir = \"%s\" and nq.filsys_id = filesys.filsys_id and nfsphys.nfsphys_id = filesys.phys_id and users.users_id = nq.users_id and machine.mach_id = filesys.mach_id",
+    "nfsphys.mach_id = %d and nfsphys.dir = \"%s\" and nq.phys_id = nfsphys.nfsphys_id and filesys.filsys_id = nq.filsys_id and users.users_id = nq.users_id and machine.mach_id = nfsphys.mach_id",
     2,
     &VDmach,
   },
@@ -2722,11 +2743,11 @@ struct query Queries2[] = {
     APPEND,
     "nq",
     "nfsquota",
-    "filsys_id = %i4, users_id = %i4, quota = int4(%c)",
+    "filsys_id = filesys.filsys_id, users_id = %i4, quota = int4(%c), phys_id = filesys.phys_id",
     anfq_fields,
-    3,
-    (char *)0,
-    0,
+    2,
+    "filesys.filsys_id = %d",
+    1,
     &anfq_validate,
   },
 
@@ -3067,10 +3088,10 @@ struct query Queries2[] = {
     RETRIEVE,
     "p",
     "printcap",
-    "%c = p.name, %c = p.pcap, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
+    "%c = p.name, %c = machine.name, %c = p.dir, %c = p.rp, %c = p.comments, %c = p.modtime, %c = text(p.modby), %c = p.modwith",
     gpcp_fields,
-    5,
-    "p.name = \"%s\"",
+    8,
+    "p.name = \"%s\" and machine.mach_id = p.mach_id",
     1,
     &VDsortf,
   },
@@ -3082,9 +3103,9 @@ struct query Queries2[] = {
     APPEND,
     "p",
     "printcap",
-    "name = %c, pcap = %c",
+    "name = %c, mach_id = %i4, dir = %c, rp = %c, comments = %c",
     apcp_fields,
-    2,
+    5,
     0,
     0,
     &apcp_validate,
@@ -3102,7 +3123,7 @@ struct query Queries2[] = {
     0,
     "p.name = \"%s\"",
     1,
-    &apcp_validate,
+    &dpcp_validate,
   },
 
   {
This page took 0.050045 seconds and 4 git commands to generate.