-/* $Header$
+/* $Id$
+ *
+ * Copyright (C) 1993-1998 by the Massachusetts Institute of Technology
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
*/
-#include <stdio.h>
-#include <string.h>
-#include <ctype.h>
-#include <sys/time.h>
+#include <mit-copyright.h>
#include <moira.h>
#include <moira_site.h>
+
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+
EXEC SQL INCLUDE sqlca;
+RCSID("$Header$");
struct entry {
char *line;
char *whoami;
int debug;
+struct entry *get_next_entry(FILE *in);
+int process_entry(struct entry *e);
int main(int argc, char **argv)
{
FILE *in;
- struct entry *e, *get_next_entry();
+ struct entry *e;
int i, wait = 0;
char buf[BUFSIZ], *file = NULL, *p, *p1, *db = "moira";
{
if (!strcmp(argv[i], "-w"))
wait++;
- else if (!strcmp(argv[i], "-D"))
- setenv("ING_SET", "set printqry");
else if (!strcmp(argv[i], "-d"))
debug = 1;
else if (file)
exit(0);
}
-
-
struct entry *get_next_entry(FILE *in)
{
static struct entry e;
return &e;
}
-
int process_entry(struct entry *e)
{
EXEC SQL BEGIN DECLARE SECTION;
EXEC SQL SELECT login INTO :login FROM users WHERE clearid = :id;
if (sqlca.sqlcode)
{
- fprintf(stderr, "Error %d on %s\n", sqlca.sqlcode, e->line);
+ fprintf(stderr, "Error %ld on %s\n", sqlca.sqlcode, e->line);
return -1;
}
strncpy(e->login, login, 8);