]> andersk Git - moira.git/blobdiff - backup/db2rest.awk
second code style cleanup: void/void * usage, proper #includes. try to
[moira.git] / backup / db2rest.awk
index 269cad436b54a80786ff03df1e583e032c079f86..ab9a41bd868255776c667933a0eae92b82071d11 100644 (file)
@@ -1,5 +1,4 @@
-#      $Source$
-#      $Header$
+#      $Id $
 #
 #      This converts the file used to originally create the database
 #      into a program to restore it from a backup.
@@ -9,24 +8,29 @@
 BEGIN {
        print "/* This file automatically generated */";
        print "/* Do not edit */\n";
-       print "#include <stdio.h>";
        print "EXEC SQL INCLUDE sqlca;";
        print "EXEC SQL WHENEVER SQLERROR DO dbmserr();";
-       print "void parse_nl(FILE *), parse_str(FILE *, char *, int), parse_sep(FILE *);\n";
+       print "#include <com_err.h>";
+       print "#include \"dump_db.h\"";
+       print "#include \"rest.h\"";
 
        print "/* This file automatically generated */" > "rest1.pc";
        print "/* Do not edit */\n" >> "rest1.pc";
-       print "#include <stdio.h>" >> "rest1.pc";
-       print "FILE *open_file(char *prefix, char *suffix);\n" >> "rest1.pc";
-       print "int do_restores(char *prefix)\n{" >> "rest1.pc";
+       print "#include \"dump_db.h\"" >> "rest1.pc";
+       print "#include \"rest.h\"" >> "rest1.pc";
+       print "void do_restores(char *prefix)\n{" >> "rest1.pc";
+
+       print "/* This file automatically generated */" > "bkup.h";
+       print "/* Do not edit */\n" >> "bkup.h";
 }
 
 $1=="#" { next; }
 
 /^create/ {
-       printf "int restore_%s(FILE *f)\n", $3;
+       printf "void restore_%s(FILE *f)\n", $3;
        print "{\n  EXEC SQL BEGIN DECLARE SECTION;";
        printf "  restore_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "rest1.pc";
+       printf "void restore_%s(FILE *f);\n", $3 >> "rest.h";
 
        tablename = $3;
        rangename = substr(tablename, 1, 1);
This page took 0.034533 seconds and 4 git commands to generate.