]> andersk Git - moira.git/commitdiff
remove printcap and palladium tables, add printers table and
authordanw <danw>
Wed, 27 Jan 1999 19:35:18 +0000 (19:35 +0000)
committerdanw <danw>
Wed, 27 Jan 1999 19:35:18 +0000 (19:35 +0000)
machine.hwaddr

server/mr_server.h
server/qfollow.pc
server/qsetup.pc
server/queries2.c

index 903ff091a3b30714f91058790d9e9effb55327a8..5cc942b1c690b295c0b2032fb2fd863f60b1900b 100644 (file)
@@ -175,9 +175,6 @@ int followup_gsha(struct query *q, struct save_queue *sq, struct validate *v,
 int followup_gqot(struct query *q, struct save_queue *sq, struct validate *v,
                  int (*action)(int, char **, void *), void *actarg,
                  client *cl);
-int followup_gpce(struct query *q, struct save_queue *sq, struct validate *v,
-                 int (*action)(int, char **, void *), void *actarg,
-                 client *cl);
 int followup_guax(struct query *q, struct save_queue *sq, struct validate *v,
                  int (*action)(int, char **, void *), void *actarg,
                  client *cl);
@@ -189,6 +186,7 @@ int followup_ghst(struct query *q, struct save_queue *sq, struct validate *v,
                  client *cl);
 
 int followup_ausr(struct query *q, char *argv[], client *cl);
+int followup_aprn(struct query *q, char *argv[], client *cl);
 int followup_aqot(struct query *q, char *argv[], client *cl);
 int followup_dqot(struct query *q, char *argv[], client *cl);
 int followup_uuac(struct query *q, char *argv[], client *cl);
@@ -229,6 +227,8 @@ int setup_dqot(struct query *q, char *argv[], client *cl);
 int setup_dsnt(struct query *q, char *argv[], client *cl);
 int setup_ahst(struct query *q, char *argv[], client *cl);
 int setup_ahal(struct query *q, char *argv[], client *cl);
+int setup_uhha(struct query *q, char *argv[], client *cl);
+int setup_aprn(struct query *q, char *argv[], client *cl);
 
 /* prototypes from qsupport.pc */
 int set_pobox(struct query *q, char *argv[], client *cl);
index 0da7aff2ab5aea77dbbc89fcf1987a29fc500169..9ff474b35921009907a1e947675a2ce7629089f6 100644 (file)
@@ -560,6 +560,33 @@ int followup_uuac(struct query *q, char *argv[], client *cl)
   return MR_SUCCESS;
 }
 
+
+/* followp_aprn: update counts in serverhosts. Also set modtime for aprn. */
+int followup_aprn(struct query *q, char *argv[], client *cl)
+{
+  EXEC SQL BEGIN DECLARE SECTION;
+  int mid, delta;
+  EXEC SQL END DECLARE SECTION;
+
+  /* See if we're doing aprn or dprn */
+  if (q->name[0] == 'a')
+    {
+      delta = 1;
+      set_modtime(q, argv, cl);
+    }
+  else
+    delta = -1;
+
+  mid = *(int *)argv[PRN_RM];
+
+  EXEC SQL UPDATE serverhosts SET value1 = value1 + :delta
+    WHERE service = 'PRINT' AND mach_id = :mid;
+  if (dbms_errno)
+    return mr_errcode;
+
+  return MR_SUCCESS;
+}
+
 /* followup_gpob: fixes argv[2] based on the IDs currently there and the
  * type in argv[1].  Then completes the upcall to the user.
  *
@@ -1068,39 +1095,6 @@ int followup_dqot(struct query *q, char **argv, client *cl)
   return MR_SUCCESS;
 }
 
-
-int followup_gpce(struct query *q, struct save_queue *sq, struct validate *v,
-                 int (*action)(int, char *[], void *), void *actarg,
-                 client *cl)
-{
-  int i, j;
-  char **argv;
-  int id, status;
-
-  i = q->vcnt - 2;
-  while (sq_get_data(sq, &argv))
-    {
-      id = atoi(argv[PCAP_QSERVER]);
-      status = id_to_name(id, MACHINE_TABLE, &argv[PCAP_QSERVER]);
-      if (status)
-       return status;
-      id = atoi(argv[i]);
-      if (id > 0)
-       status = id_to_name(id, USERS_TABLE, &argv[i]);
-      else
-       status = id_to_name(-id, STRINGS_TABLE, &argv[i]);
-      if (status && status != MR_NO_MATCH)
-       return status;
-      (*action)(q->vcnt, argv, actarg);
-      for (j = 0; j < q->vcnt; j++)
-       free(argv[j]);
-      free(argv);
-    }
-  sq_destroy(sq);
-  return MR_SUCCESS;
-}
-
-
 /* followup_gzcl:
  */
 
index dd3a9960b4f1c97e1216c2a6bd3c29e6fd5b83db..f399ea0cc6fc8434b401de30e9b437f7907fe576 100644 (file)
@@ -209,12 +209,16 @@ int setup_dmac(struct query *q, char *argv[], client *cl)
     WHERE mach_id = :id;
   if (cnt > 0)
     return MR_IN_USE;
-  EXEC SQL SELECT COUNT(mach_id) INTO :cnt FROM printcap
+  EXEC SQL SELECT COUNT(mach_id) INTO :cnt FROM printers
     WHERE mach_id = :id;
   if (cnt > 0)
     return MR_IN_USE;
-  EXEC SQL SELECT COUNT(quotaserver) INTO :cnt FROM printcap
-    WHERE quotaserver = :id;
+  EXEC SQL SELECT COUNT(rm) INTO :cnt FROM printers
+    WHERE rm = :id;
+  if (cnt > 0)
+    return MR_IN_USE;
+  EXEC SQL SELECT COUNT(rq) INTO :cnt FROM printers
+    WHERE rq = :id;
   if (cnt > 0)
     return MR_IN_USE;
   EXEC SQL SELECT COUNT(mach_id) INTO :cnt FROM palladium
@@ -1055,6 +1059,116 @@ int setup_ahal(struct query *q, char **argv, client *cl)
   return MR_SUCCESS;
 }
 
+/* setup_uhha(): Check characters in hwaddr, and make sure it's not
+ * a duplicate.
+ */
+int setup_uhha(struct query *q, char **argv, client *cl)
+{
+  EXEC SQL BEGIN DECLARE SECTION;
+  char *hwaddr = argv[1];
+  int count;
+  EXEC SQL END DECLARE SECTION;
+  char *p;
+
+  if (*hwaddr && strcasecmp(hwaddr, "unknown"))
+    {
+      for (p = hwaddr; *p; p++)
+       {
+         if (isupper(*p))
+           *p = tolower(*p);
+         if (!isxdigit(*p))
+           return MR_BAD_CHAR;
+       }
+      if (p != hwaddr + 12)
+       return MR_ADDRESS;
+
+      EXEC SQL SELECT COUNT(hwaddr) INTO :count
+       FROM machine WHERE hwaddr = :hwaddr;
+      if (count)
+       return MR_NOT_UNIQUE;
+    }
+
+  return MR_SUCCESS;
+}
+
+/* setup_aprn(): Make sure name/duplexname don't conflict with
+ * anything. If [ANY] was specified for the spooling host, pick the
+ * least loaded print server that serves this kind of printer.
+ */
+int setup_aprn(struct query *q, char **argv, client *cl)
+{
+  int best = -1;
+  char *p;
+  EXEC SQL BEGIN DECLARE SECTION;
+  int mid, usage, count;
+  char types[SERVERHOSTS_VALUE3_SIZE], *hwaddr, *name;
+  EXEC SQL END DECLARE SECTION;
+
+  name = argv[PRN_NAME];
+  if (!*name)
+    return MR_BAD_CHAR;
+  else
+    {
+      EXEC SQL SELECT COUNT(name) INTO :count FROM printers
+       WHERE name = :name OR duplexname = :name;
+      if (dbms_errno)
+       return mr_errcode;
+      if (count)
+       return MR_NOT_UNIQUE;
+    }
+
+  name = argv[PRN_DUPLEXNAME];
+  if (*name)
+    {
+      EXEC SQL SELECT COUNT(name) INTO :count FROM printers
+       WHERE name = :name OR duplexname = :name;
+      if (dbms_errno)
+       return mr_errcode;
+      if (count)
+       return MR_NOT_UNIQUE;
+    }
+
+  if (*(int *)argv[PRN_RM] == -1)
+    {
+      EXEC SQL DECLARE csr_rm CURSOR FOR
+       SELECT mach_id, value1, value3 FROM serverhosts
+       WHERE service = 'PRINT';
+      if (dbms_errno)
+       return mr_errcode;
+      EXEC SQL OPEN csr_rm;
+      if (dbms_errno)
+       return mr_errcode;
+
+      while (1)
+       {
+         EXEC SQL FETCH csr_rm INTO :mid, :usage, :types;
+         if (sqlca.sqlcode)
+           break;
+
+         if (best > 0 && usage > best)
+           continue;
+
+         for (p = strtok(types, ", "); p; p = strtok(NULL, ", "))
+           {
+             if (!strcasecmp(argv[PRN_TYPE], p))
+               {
+                 best = usage;
+                 *(int *)argv[PRN_RM] = mid;
+                 break;
+               }
+           }
+       }
+      EXEC SQL CLOSE csr_rm;
+      if (dbms_errno)
+       return mr_errcode;
+
+      if (best == -1)
+       return MR_SERVICE;
+    }
+
+  return MR_SUCCESS;
+}
+
 /* hostname_check()
  * validate the rfc1035/rfc1123-ness of a hostname
  */
index a71f7a7a5fbb9647baf6ed25eaa090ee33d7560f..51ddc11bcf00f13a878c450c7ad4c79159e34a62 100644 (file)
@@ -557,6 +557,11 @@ static struct validate ghst_validate = {
   followup_ghst,
 };
 
+static char *ghha_fields[] = {
+  "name",
+  "hwaddr",
+};
+
 static char *ahst_fields[] = {
   "name", "vendor", "model", "os", "location", "contact", "use",
   "status", "subnet", "address", "ace_type", "ace_name",
@@ -628,6 +633,28 @@ static struct validate uhst_validate = {
   set_modtime_by_id,
 };
 
+static char *uhha_fields[] = {
+  "name",
+  "hwaddr"
+};
+
+static struct valobj uhha_valobj[] = {
+  {V_ID, 0, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_CHAR, 1, MACHINE_TABLE, "hwaddr"},
+};
+
+static struct validate uhha_validate = {
+  uhha_valobj,
+  2,
+  0,
+  0,
+  0,
+  "mach_id",
+  0,
+  setup_uhha,
+  set_modtime_by_id,
+};
+
 static char *dhst_fields[] = {
   "name",
 };
@@ -2033,100 +2060,92 @@ static struct validate asvc_validate = {
   set_modtime,
 };
 
-static char *gpce_fields[] = {
-  "printer",
-  "printer", "spooling_host", "spool_directory", "rprinter",
-  "quotaserver", "authenticate", "price", "comments",
-  "modtime", "modby", "modwith",
+static char *gprn_fields[] = {
+  "name",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static struct validate gpce_validate = {
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  0,
-  followup_gpce,
+static char *gpbd_fields[] = {
+  "duplexname",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static char *apce_fields[] = {
-  "printer", "spooling_host", "spool_directory", "rprinter",
-  "quotaserver", "authenticate", "price", "comments",
-  "modtime", "modby", "modwith",
+static char *gpbe_fields[] = {
+  "hwaddr",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static struct valobj apce_valobj[] = {
-  {V_CHAR, 0, PRINTCAP_TABLE, "name"},
-  {V_ID, 1, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
-  {V_LEN, 2, PRINTCAP_TABLE, "dir"},
-  {V_LEN, 3, PRINTCAP_TABLE, "rp"},
-  {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
-  {V_NUM, 5},
-  {V_NUM, 6},
-  {V_CHAR, 7, PRINTCAP_TABLE, "comments"},
+static char *gpbh_fields[] = {
+  "hostname",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static struct validate apce_validate = {
-  apce_valobj,
-  8,
-  "name",
-  "name = '%s'",
-  1,
-  0,
-  0,
-  0,
-  set_modtime,
+static char *gpbr_fields[] = {
+  "rm",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static struct validate dpce_validate = {
-  0,
-  0,
-  "name",
-  "name = '%s'",
-  1,
-  0,
-  0,
-  0,
-  0,
-};
-
-static char *gpcp_fields[] = {
-  "printer",
-  "printer", "spooling_host", "spool_directory", "rprinter", "comments",
-  "modtime", "modby", "modwith",
+static char *gpbl_fields[] = {
+  "location",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static char *gpdm_fields[] = {
-  "name",
-  "name", "rpcnum", "host", "modtime", "modby", "modwith",
+static char *gpbc_fields[] = {
+  "contact",
+  "name", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact", "modtime", "modby", "modwith"
 };
 
-static char *apdm_fields[] = {
-  "name", "rpcnum", "host"
+static char *aprn_fields[] = {
+  "printer", "type", "hwtype", "duplexname", "hostname",
+  "loghost", "rm", "rp", "rq", "ka", "pc", "ac", "lpc_acl",
+  "location", "contact",
 };
 
-static struct valobj apdm_valobj[] = {
-  {V_CHAR, 0, PALLADIUM_TABLE, "name"},
-  {V_NUM, 1},
-  {V_ID, 2, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+static struct valobj aprn_valobj[] = {
+  {V_CHAR, 0, PRINTERS_TABLE, "name"},
+  {V_TYPE, 1, 0, "printertype", 0, MR_TYPE},
+  {V_TYPE, 2, 0, "printerhwtype", 0, MR_TYPE},
+  {V_CHAR, 3, PRINTERS_TABLE, "duplexname"},
+  {V_ID, 4, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_ID, 5, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_ID, 6, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_CHAR, 7, PRINTERS_TABLE, "rp"},
+  {V_ID, 8, MACHINE_TABLE, "name", "mach_id", MR_MACHINE},
+  {V_NUM, 9},
+  {V_NUM, 10},
+  {V_ID, 11, LIST_TABLE, "name", "list_id", MR_LIST},
+  {V_ID, 12, LIST_TABLE, "name", "list_id", MR_LIST},
+  {V_CHAR, 13, PRINTERS_TABLE, "location"},
+  {V_CHAR, 14, PRINTERS_TABLE, "contact"},
 };
 
-static struct validate apdm_validate = {
-  apdm_valobj,
-  3,
+static struct validate aprn_validate = {
+  aprn_valobj,
+  15,
   "name",
   "name = '%s'",
   1,
   0,
   0,
-  0,
-  set_modtime,
+  setup_aprn,
+  followup_aprn,
 };
 
-static struct validate dpdm_validate = {
+static struct validate dprn_validate = {
   0,
   0,
   "name",
@@ -2135,7 +2154,7 @@ static struct validate dpdm_validate = {
   0,
   0,
   0,
-  0,
+  followup_aprn,
 };
 
 static char *gali_fields[] = {
@@ -2799,6 +2818,22 @@ struct query Queries2[] = {
     &ghst_validate,
   },
 
+  {
+    /* Q_GHHA - GET_HOST_HWADDR */
+    "get_host_hwaddr",
+    "ghha",
+    RETRIEVE,
+    "m",
+    MACHINE_TABLE,
+    "m.hwaddr FROM machine m",
+    ghha_fields,
+    1,
+    "m.name LIKE UPPER('%s')",
+    1,
+    NULL,
+    NULL,
+  },
+
   {
     /* Q_AHST - ADD_HOST */ /* uses prefetch_value() for mach_id */
     "add_host",
@@ -2831,6 +2866,22 @@ struct query Queries2[] = {
     &uhst_validate,
   },
 
+  {
+    /* Q_UHHA - UPDATE_HOST_HWADDR */
+    "update_host_hwaddr",
+    "uhha",
+    UPDATE,
+    "m",
+    MACHINE_TABLE,
+    "machine SET hwaddr = '%s'",
+    uhha_fields,
+    1,
+    "mach_id = %d",
+    1,
+    NULL,
+    &uhha_validate,
+  },
+
   {
     /* Q_DHST - DELETE_HOST */
     "delete_host",
@@ -4208,131 +4259,147 @@ struct query Queries2[] = {
   },
 
   {
-    /* Q_GPCE - GET_PRINTCAP_ENTRY */
-    "get_printcap_entry",
-    "gpce",
+    /* Q_GPRN - GET_PRINTER */
+    "get_printer",
+    "gprn",
     RETRIEVE,
-    "pc",
-    PRINTCAP_TABLE,
-    "pc.name, m.name, pc.dir, pc.rp, pc.quotaserver, pc.auth, pc.price, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
-    gpce_fields,
-    11,
-    "pc.name LIKE '%s' AND m.mach_id = pc.mach_id",
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gprn_fields,
+    18,
+    "pr.name LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
     1,
-    "pc.name",
-    &gpce_validate,
+    "pr.name",
+    &VDfix_modby,
   },
 
   {
-    /* Q_APCE - ADD_PRINTCAP_ENTRY */
-    "add_printcap_entry",
-    "apce",
-    APPEND,
-    "pc",
-    PRINTCAP_TABLE,
-    "INTO printcap (name, mach_id, dir, rp, quotaserver, auth, price, comments) VALUES ('%s', %d, '%s', '%s', %d, %s, %s, NVL('%s', CHR(0)))",
-    apce_fields,
-    8,
-    0,
-    0,
-    NULL,
-    &apce_validate,
+    /* Q_GPBD - GET_PRINTER_BY_DUPLEXNAME */
+    "get_printer_by_duplexname",
+    "gpbd",
+    RETRIEVE,
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbd_fields,
+    18,
+    "pr.duplexname LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
+    1,
+    "pr.name",
+    &VDfix_modby,
   },
 
   {
-    /* Q_DPCE - DELETE_PRINTCAP_ENTRY */
-    "delete_printcap_entry",
-    "dpce",
-    DELETE,
-    "pc",
-    PRINTCAP_TABLE,
-    0,
-    apce_fields,
-    0,
-    "name = '%s'",
+    /* Q_GPBE - GET_PRINTER_BY_ETHERNET */
+    "get_printer_by_ethernet",
+    "gpbe",
+    RETRIEVE,
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbd_fields,
+    18,
+    "m1.hwaddr LIKE '%s' AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
     1,
-    NULL,
-    &dpce_validate,
+    "pr.name",
+    &VDfix_modby,
   },
 
   {
-    /* Q_GPCP - GET_PRINTCAP */
-    "get_printcap",
-    "gpcp",
+    /* Q_GPBH - GET_PRINTER_BY_HOSTNAME */
+    "get_printer_by_hostname",
+    "gpbh",
     RETRIEVE,
-    "pc",
-    PRINTCAP_TABLE,
-    "pc.name, m.name, pc.dir, pc.rp, pc.comments, TO_CHAR(pc.modtime, 'DD-mon-YYYY HH24:MI:SS'), pc.modby, pc.modwith FROM printcap pc, machine m",
-    gpcp_fields,
-    8,
-    "pc.name LIKE '%s' AND m.mach_id = pc.mach_id",
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbh_fields,
+    18,
+    "m1.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
     1,
-    "pc.name",
+    "pr.name",
     &VDfix_modby,
   },
 
   {
-    /* Q_DPCP - DELETE_PRINTCAP */
-    "delete_printcap",
-    "dpcp",
-    DELETE,
-    "pc",
-    PRINTCAP_TABLE,
-    0,
-    apce_fields,
-    0,
-    "name = '%s'",
+    /* Q_GPBR - GET_PRINTER_BY_RM */
+    "get_printer_by_rm",
+    "gpbr",
+    RETRIEVE,
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbr_fields,
+    18,
+    "m3.name LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
     1,
-    NULL,
-    &dpce_validate,
+    "pr.name",
+    &VDfix_modby,
   },
 
   {
-    /* Q_GPDM - GET_PALLADIUM */
-    "get_palladium",
-    "gpdm",
+    /* Q_GPBL - GET_PRINTER_BY_LOCATION */
+    "get_printer_by_location",
+    "gpbl",
     RETRIEVE,
-    "pal",
-    PALLADIUM_TABLE,
-    "pal.name, pal.identifier, m.name, TO_CHAR(pal.modtime, 'DD-mon-YYYY HH24:MI:SS'), pal.modby, pal.modwith FROM palladium pal, machine m",
-    gpdm_fields,
-    6,
-    "pal.name LIKE '%s' AND m.mach_id = pal.mach_id",
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbl_fields,
+    18,
+    "UPPER(pr.location) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
+    1,
+    "pr.name",
+    &VDfix_modby,
+  },
+
+  {
+    /* Q_GPBC - GET_PRINTER_BY_CONTACT */
+    "get_printer_by_contact",
+    "gpbc",
+    RETRIEVE,
+    "pr",
+    PRINTERS_TABLE,
+    "pr.name, pr.type, pr.hwtype, pr.duplexname, m1.name, m2.name, m3.name, pr.rp, m4.name, pr.ka, pr.pc, l1.name, l2.name, pr.location, pr.contact, TO_CHAR(pr.modtime, 'DD-mon-YYYY HH24:MI:SS'), pr.modby, pr.modwith FROM printers pr, machine m1, machine m2, machine m3, machine m4, list l1, list l2",
+    gpbc_fields,
+    18,
+    "UPPER(pr.contact) LIKE UPPER('%s') AND m1.mach_id = pr.mach_id AND m2.mach_id = pr.loghost AND m3.mach_id = pr.rm AND m4.mach_id = pr.rq AND l1.list_id = pr.ac AND l2.list_id = pr.lpc_acl",
     1,
-    "pal.name",
+    "pr.name",
     &VDfix_modby,
   },
 
   {
-    /* Q_APDM - ADD_PALLADIUM */
-    "add_palladium",
-    "apdm",
+    /* Q_APRN - ADD_PRINTER */
+    "add_printer",
+    "aprn",
     APPEND,
-    "pal",
-    PALLADIUM_TABLE,
-    "INTO palladium (name, identifier, mach_id) VALUES ('%s', %s, %d)",
-    apdm_fields,
-    3,
+    "pr",
+    PRINTERS_TABLE,
+    "INTO printers (name, type, hwtype, duplexname, mach_id, loghost, rm, rp, rq, ka, pc, ac, lpc_acl, location, contact) VALUES ('%s', '%s', '%s', NVL('%s', CHR(0)), %d, %d, %d, NVL('%s', CHR(0)), %d, %s, %s, %d, %d, NVL('%s', CHR(0)), NVL('%s', CHR(0)))",
+    aprn_fields,
+    15,
     0,
     0,
     NULL,
-    &apdm_validate,
+    &aprn_validate,
   },
 
   {
-    /* Q_DPDM - DELETE_PALLADIUM */
-    "delete_palladium",
-    "dpdm",
+    /* Q_DPRN - DELETE_PRINTER */
+    "delete_printer",
+    "dprn",
     DELETE,
-    "pal",
-    PALLADIUM_TABLE,
+    "pr",
+    PRINTERS_TABLE,
     0,
-    apdm_fields,
+    aprn_fields,
     0,
     "name = '%s'",
     1,
     NULL,
-    &dpdm_validate,
+    &dprn_validate,
   },
 
   {
This page took 0.0797369999999999 seconds and 5 git commands to generate.