From 22208c6c202fc62b90b6171c0de8d74d89217a70 Mon Sep 17 00:00:00 2001 From: mar Date: Tue, 22 Aug 1989 17:05:05 +0000 Subject: [PATCH] added palladium --- gen/hesiod.qc | 63 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 2 deletions(-) diff --git a/gen/hesiod.qc b/gen/hesiod.qc index 57cae3c8..9e202241 100644 --- a/gen/hesiod.qc +++ b/gen/hesiod.qc @@ -61,7 +61,8 @@ char **argv; changed = do_passwd(); changed += do_filsys(); changed += do_cluster(); - changed += do_printers(); + changed += do_printcap(); + changed += do_palladium(); changed += do_sloc(); changed += do_service(); changed += do_groups(); @@ -648,7 +649,7 @@ do_cluster() ##} -do_printers() +do_printcap() ##{ FILE *out; char outf[64], outft[64]; @@ -699,6 +700,64 @@ do_printers() ##} +do_palladium() +##{ + FILE *out; + char outf[64], outft[64]; + struct stat sb; + time_t ftime; +## char name[33], rm[33], trans[129], *filetime; +## int flag, flag1, ident; + + sprintf(outf, "%s/palladium.db", HESIOD_DIR); + + if (stat(outf, &sb) == 0) { + ftime = sb.st_mtime; + filetime = ingres_date_and_time(ftime); +## retrieve (flag = int4(interval("min", tblstats.modtime - filetime))) +## where tblstats.table = "palladium" +## retrieve (flag1 = int4(interval("min", tblstats.modtime - filetime))) +## where tblstats.table = "alias" + if (flag < 0 && flag1 < 0) { + fprintf(stderr, "File palladium.db does not need to be rebuilt.\n"); + return(0); + } + } + + sprintf(outft, "%s~", outf); + out = fopen(outft, "w"); + if (!out) { + perror("cannot open palladium.db for write"); + exit(SMS_OCONFIG); + } + + fprintf(stderr, "Building palladium.db\n"); + +## range of p is palladium +## retrieve (name = p.#name, ident = p.#ident, rm = machine.#name) +## where machine.mach_id = p.mach_id { + strtrim(name); + strtrim(rm); + fprintf(out, + "%s.palladium\tHS UNSPECA \"%s %d %s interface directory\"\n", + name, rm, ident, name); +## } +## range of a is alias +## retrieve (name = a.#name, trans = a.#trans) where a.#type = "PALLADIUM" { + strtrim(name); + strtrim(trans); + fprintf(out, "%s.palladium\tHS UNSPECA \"%s\"\n", name, trans); +## } + + if (fclose(out)) { + fprintf(stderr, "Unsuccessful close of palladium.db\n"); + exit(SMS_CCONFIG); + } + fix_file(outf); + return(1); +##} + + do_sloc() ##{ FILE *out, *old, *new; -- 2.45.2