]> andersk Git - moira.git/blobdiff - backup/rest_db.qc
Used /bin/sh format instead of /bin/csh format, by accident.
[moira.git] / backup / rest_db.qc
index 3a3d8608dc538de517c213be58ff968223f104fa..21bd70705b3266a2604bd861eeb88787e59ad7bf 100644 (file)
@@ -3,14 +3,9 @@
  *     $Author$
  *     $Header$
  *
- *     Copyright (C) 1987 by the Massachusetts Institute of Technology
- *
- *     $Log$
- *     Revision 1.2  1988-05-10 11:34:37  mar
- *     Throw away rest of field if too long
- *
- * Revision 1.1  87/07/13  03:50:02  wesommer
- * Initial revision
+ *  (c) Copyright 1988 by the Massachusetts Institute of Technology.
+ *  For copying and distribution information, please see the file
+ *  <mit-copyright.h>.
  * 
  */
 
@@ -21,6 +16,9 @@ static char *rcsid_rest_db_qc = "$Header$";
 #include <sys/file.h>
 #include <stdio.h>
 #include <ctype.h>
+#include <mit-copyright.h>
+#include "dump_db.h"
+
 
 /*ARGSUSED*/
 main(argc, argv)
@@ -112,7 +110,7 @@ int parse_int(f)
     register int c;
     register int val = 0;
     register int sign = 1;
-    while ((c = getc(f)) != EOF && c != ':' && c != '\n') {
+    while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n') {
        if (c == '-') sign = -1;
        else if (isdigit(c)) {
            val *= 10;
@@ -130,7 +128,7 @@ void parse_str(f, buf, len)
 {
     register int c;
 
-    while ((c = getc(f)) != EOF && c != ':' && c != '\n' && len > 0) {
+    while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n' && len > 0) {
        if (c == '\\') {
            c = getc(f);
            if (isdigit(c)) {
@@ -142,7 +140,7 @@ void parse_str(f, buf, len)
                    punt("Broken \\###");
                /* Convert to ASCII code: */
                *buf++ =  (((c-'0')<<6) + ((c1-'0')<<3) + c2-'0');
-           } else if (c == '\\' || c == ':') {
+           } else if (c == '\\' || c == SEP_CHAR) {
                *buf++ = c;
                --len;
            } else punt ("Broken '\\'");
@@ -154,9 +152,9 @@ void parse_str(f, buf, len)
     if (c == EOF)
        return;
     
-    if (c != EOF && c != ':' && c != '\n') {
+    if (c != EOF && c != SEP_CHAR && c != '\n') {
        fprintf(stderr, "Field too wide, truncated\n");
-       while ((c = getc(f)) != EOF && c != ':' && c != '\n');
+       while ((c = getc(f)) != EOF && c != SEP_CHAR && c != '\n');
        (void) ungetc(c, f);
     } else {
        *buf++ = 0;
@@ -167,7 +165,7 @@ void parse_str(f, buf, len)
 void parse_sep(f)
     FILE *f;
 {
-    if (getc(f) != ':') punt("Expected colon");
+    if (getc(f) != SEP_CHAR) punt("Expected Separator");
 }
 void parse_nl(f)
     FILE *f;
@@ -198,14 +196,3 @@ FILE *open_file(prefix, suffix)
     fprintf(stderr, "Working on %s\n", name);
     return(f);
 }
-
-/*
- * Local Variables:
- * mode: c
- * c-indent-level: 4
- * c-continued-statement-offset: 4
- * c-brace-offset: -4
- * c-argdecl-indent: 4
- * c-label-offset: -4
- * End:
- */
This page took 0.425714 seconds and 4 git commands to generate.