]> andersk Git - moira.git/blobdiff - backup/rest_db.pc
Command line printer manipulation client, and build goo.
[moira.git] / backup / rest_db.pc
index 1d26fb501c9ba336175f3239a811a4ad4f8e6449..85474a5ab86ff3b9edb8b8f03d429b3dbe23267d 100644 (file)
@@ -1,26 +1,27 @@
-/*
- *     $Source$
- *     $Author$
- *     $Header$
+/* $Id$
  *
- *  (c) Copyright 1988 by the Massachusetts Institute of Technology.
- *  For copying and distribution information, please see the file
- *  <mit-copyright.h>.
+ *     This program restores the Moira database from an mrbackup.
  *
+ * Copyright (C) 1988-1998 by the Massachusetts Institute of Technology.
+ * For copying and distribution information, please see the file
+ * <mit-copyright.h>.
  */
 
-#ifndef lint
-static char *rcsid_rest_db_qc = "$Header$";
-#endif lint
+#include <mit-copyright.h>
+#include <moira.h>
+#include "dump_db.h"
 
-#include <sys/file.h>
-#include <stdio.h>
-#include <fcntl.h>
 #include <ctype.h>
-#include <mit-copyright.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
 EXEC SQL INCLUDE sqlca;
-#include "dump_db.h"
 
+RCSID("$Header$");
+
+int yes_or_no(char *prompt);
 
 int main(int argc, char **argv)
 {
@@ -54,7 +55,7 @@ int main(int argc, char **argv)
   EXEC SQL CONNECT :db IDENTIFIED BY :db;
   if (sqlca.sqlcode != 0)
     {
-      com_err(argv[0], 0, "Ingres database open failed");
+      com_err(argv[0], 0, "Database open failed");
       exit(1);
     }
   printf(" done\n");
@@ -85,7 +86,7 @@ int yes_or_no(char *prompt)
   int tt = open("/dev/tty", O_RDWR, 0);
   FILE *o, *i;
 
-  register char *cp;
+  char *cp;
 
   if (tt < 0)
     return 0;
@@ -128,11 +129,11 @@ out:
   return ret;
 }
 
-int parse_int(register FILE *f)
+int parse_int(FILE *f)
 {
-  register int c;
-  register int val = 0;
-  register int sign = 1;
+  int c;
+  int val = 0;
+  int sign = 1;
   while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n')
     {
       if (c == '-')
@@ -148,9 +149,9 @@ int parse_int(register FILE *f)
   return val * sign;
 }
 
-void parse_str(register FILE *f, register char *buf, register int maxlen)
+void parse_str(FILE *f, char *buf, int maxlen)
 {
-  register int c, len = 0;
+  int c, len = 0;
 
   while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n' && len < maxlen)
     {
@@ -160,7 +161,7 @@ void parse_str(register FILE *f, register char *buf, register int maxlen)
          if (isdigit(c))
            {
              /* Expect three-digit octal number.. */
-             register int c1, c2;
+             int c1, c2;
              c1 = getc(f);
              c2 = getc(f);
              if (!isdigit(c1) || !isdigit(c2))
@@ -203,13 +204,13 @@ void parse_sep(FILE *f)
   if (getc(f) != SEP_CHAR)
     punt("Expected Separator");
 }
+
 void parse_nl(FILE *f)
 {
   if (getc(f) != '\n')
     punt("Expected newline");
 }
 
-
 FILE *open_file(char *prefix, char *suffix)
 {
   char name[BUFSIZ];
This page took 0.044707 seconds and 4 git commands to generate.