]> andersk Git - moira.git/blobdiff - server/qfollow.pc
remove printcap and palladium tables, add printers table and
[moira.git] / server / qfollow.pc
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:
  */
 
This page took 0.047598 seconds and 4 git commands to generate.