From: danw Date: Wed, 29 Jan 1997 22:57:31 +0000 (+0000) Subject: Move .dc files to .pc X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/b11ddcdf5956375b0400928bf6ea2e2a8b7b704d Move .dc files to .pc update Imakefile and awk scripts for dc->pc switch --- diff --git a/backup/Imakefile b/backup/Imakefile index 51fcdd52..b86a0e2f 100644 --- a/backup/Imakefile +++ b/backup/Imakefile @@ -10,8 +10,8 @@ SRCS= dump_db.h dump_db.c bkup1.c bkup.c dumprest.c rest_db.c rest1.c rest.c SRCDIR=${SRCTOP}/backup -CODE= db2bkup.awk db2rest.awk dump_db.h dump_db.dc dumprest.dc \ - nightly.sh report.sh rest_db.dc +CODE= db2bkup.awk db2rest.awk dump_db.h dump_db.pc dumprest.pc \ + nightly.sh report.sh rest_db.pc BOBJS= dump_db.o bkup1.o bkup.o dumprest.o ROBJS= rest_db.o rest1.o rest.o dumprest.o sqlrule() @@ -19,14 +19,14 @@ sqlrule() program(mrbackup, ${BOBJS},${MR_LIBDEP}, ${CLIBS} ${SQL_LIB}, ${PROGDIR}) program(mrrestore, ${ROBJS},${MR_LIBDEP}, ${CLIBS} ${SQL_LIB}, ${PROGDIR}) -bkup.dc: ../db/schema.sql db2bkup.awk - awk -f db2bkup.awk < ../db/schema.sql > bkup.dc -bkup1.dc: bkup.dc -rest.dc: ../db/schema.sql db2rest.awk - awk -f db2rest.awk < ../db/schema.sql > rest.dc -rest1.dc: rest.dc +bkup.pc: ../db/schema.sql db2bkup.awk + awk -f db2bkup.awk < ../db/schema.sql > bkup.pc +bkup1.pc: bkup.pc +rest.pc: ../db/schema.sql db2rest.awk + awk -f db2rest.awk < ../db/schema.sql > rest.pc +rest1.pc: rest.pc clean:: - $(RM) bkup.dc bkup1.dc rest.dc rest1.dc + $(RM) bkup.pc bkup1.pc rest.pc rest1.pc sqlfile(dump_db) sqlfile(rest_db) sqlfile(dumprest) diff --git a/backup/db2bkup.awk b/backup/db2bkup.awk index db057023..514bf083 100644 --- a/backup/db2bkup.awk +++ b/backup/db2bkup.awk @@ -14,18 +14,18 @@ BEGIN { print "#include \"dump_db.h\""; print "#define dump_date dump_str\n"; - print "/* This file automatically generated */" > "bkup1.dc"; - print "/* Do not edit */\n" >> "bkup1.dc"; - print "#include " >> "bkup1.dc"; - print "FILE *open_file();" >> "bkup1.dc"; - print "do_backups(prefix)\n\tchar *prefix;\n{" >> "bkup1.dc"; + print "/* This file automatically generated */" > "bkup1.pc"; + print "/* Do not edit */\n" >> "bkup1.pc"; + print "#include " >> "bkup1.pc"; + print "FILE *open_file();" >> "bkup1.pc"; + print "do_backups(prefix)\n\tchar *prefix;\n{" >> "bkup1.pc"; } $1=="#" { next; } /^create/ { printf "dump_%s(f)\nFILE *f;\n{\n\tEXEC SQL BEGIN DECLARE SECTION;\n", $3; - printf "\tdump_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "bkup1.dc"; + printf "\tdump_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "bkup1.pc"; tablename = $3; rangename = substr(tablename, 1, 1); @@ -97,5 +97,5 @@ NF>=2 { END { print "/* All done */"; - print "}" >> "bkup1.dc"; + print "}" >> "bkup1.pc"; } diff --git a/backup/db2rest.awk b/backup/db2rest.awk index 37531a4e..521d417f 100644 --- a/backup/db2rest.awk +++ b/backup/db2rest.awk @@ -13,11 +13,11 @@ BEGIN { print "EXEC SQL INCLUDE sqlca;"; print "void parse_nl(), parse_str(FILE *, char *, int), parse_sep();\n"; - print "/* This file automatically generated */" > "rest1.dc"; - print "/* Do not edit */\n" >> "rest1.dc"; - print "#include " >> "rest1.dc"; - print "FILE *open_file();" >> "rest1.dc"; - print "do_restores(prefix)\n\tchar *prefix;\n{" >> "rest1.dc"; + print "/* This file automatically generated */" > "rest1.pc"; + print "/* Do not edit */\n" >> "rest1.pc"; + print "#include " >> "rest1.pc"; + print "FILE *open_file();" >> "rest1.pc"; + print "do_restores(prefix)\n\tchar *prefix;\n{" >> "rest1.pc"; } $1=="#" { next; } @@ -25,7 +25,7 @@ $1=="#" { next; } /^create/ { printf "restore_%s(f)\nFILE *f;\n", $3; print "{\n\tEXEC SQL BEGIN DECLARE SECTION;"; - printf "\trestore_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "rest1.dc"; + printf "\trestore_%s(open_file(prefix, \"%s\"));\n", $3, $3 >> "rest1.pc"; tablename = $3; rangename = substr(tablename, 1, 1); @@ -105,5 +105,5 @@ NF >= 2 { END { print "/* All done */"; - print "}" >> "rest1.dc"; + print "}" >> "rest1.pc"; } diff --git a/backup/dump_db.dc b/backup/dump_db.pc similarity index 100% rename from backup/dump_db.dc rename to backup/dump_db.pc diff --git a/backup/dumprest.dc b/backup/dumprest.pc similarity index 100% rename from backup/dumprest.dc rename to backup/dumprest.pc diff --git a/backup/rest_db.dc b/backup/rest_db.pc similarity index 100% rename from backup/rest_db.dc rename to backup/rest_db.pc