void WriteDefinesHeader(FILE *file, statement_t *stats) { register statement_t *stat; const char *protect = strconcat(SubsystemName, "_defines"); WriteProlog(file, protect, FALSE, FALSE); fprintf(file, "\n/*\tDefines related to the Subsystem %s\t*/\n\n", SubsystemName); for (stat = stats; stat != stNULL; stat = stat->stNext) { switch (stat->stKind) { case skRoutine: WriteDefinesRoutine(file, stat->stRoutine); break; case skImport: case skSImport: case skUImport: break; default: fatal("WriteDefinesHeader(): bad statement_kind_t (%d)", (int) stat->stKind); } } WriteEpilog(file, protect, FALSE); }
void WriteServerHeader(FILE *file, const statement_t *stats) { register const statement_t *stat; const char *protect = strconcat(SubsystemName, "_server_"); WriteProlog(file, protect); for (stat = stats; stat != stNULL; stat = stat->stNext) switch (stat->stKind) { case skRoutine: WriteServerRoutine(file, stat->stRoutine); break; case skImport: case skSImport: WriteImport(file, stat->stFileName); break; case skUImport: break; default: fatal("WriteServerHeader(): bad statement_kind_t (%d)", (int) stat->stKind); } WriteEpilog(file, protect); }
void WriteUserHeader(FILE *file, statement_t *stats) { register statement_t *stat; const char *protect = strconcat(SubsystemName, "_user_"); WriteProlog(file, protect, TRUE, TRUE); for (stat = stats; stat != stNULL; stat = stat->stNext) switch (stat->stKind) { case skImport: case skUImport: case skDImport: WriteImport(file, stat->stFileName); break; case skRoutine: case skSImport: case skIImport: break; default: fatal("WriteHeader(): bad statement_kind_t (%d)", (int) stat->stKind); } fprintf(file, "\n#ifdef __BeforeMigUserHeader\n"); fprintf(file, "__BeforeMigUserHeader\n"); fprintf(file, "#endif /* __BeforeMigUserHeader */\n"); fprintf(file, "\n"); fprintf(file, "#include <sys/cdefs.h>\n"); fprintf(file, "__BEGIN_DECLS\n"); fprintf(file, "\n"); for (stat = stats; stat != stNULL; stat = stat->stNext) { if (stat->stKind == skRoutine) WriteUserRoutine(file, stat->stRoutine); } fprintf(file, "\n"); fprintf(file, "__END_DECLS\n"); fprintf(file, "\n"); fprintf(file, "/********************** Caution **************************/\n"); fprintf(file, "/* The following data types should be used to calculate */\n"); fprintf(file, "/* maximum message sizes only. The actual message may be */\n"); fprintf(file, "/* smaller, and the position of the arguments within the */\n"); fprintf(file, "/* message layout may vary from what is presented here. */\n"); fprintf(file, "/* For example, if any of the arguments are variable- */\n"); fprintf(file, "/* sized, and less than the maximum is sent, the data */\n"); fprintf(file, "/* will be packed tight in the actual message to reduce */\n"); fprintf(file, "/* the presence of holes. */\n"); fprintf(file, "/********************** Caution **************************/\n"); fprintf(file, "\n"); WriteRequestTypes(file, stats); WriteUserRequestUnion(file, stats); WriteReplyTypes(file, stats); WriteUserReplyUnion(file, stats); WriteEpilog(file, protect, TRUE); }
void WriteServerHeader(FILE *file, statement_t *stats) { register statement_t *stat; const char *protect = strconcat(SubsystemName, "_server_"); WriteProlog(file, protect, TRUE, FALSE); for (stat = stats; stat != stNULL; stat = stat->stNext) switch (stat->stKind) { case skImport: case skSImport: case skDImport: WriteImport(file, stat->stFileName); break; case skRoutine: case skUImport: case skIImport: break; default: fatal("WriteServerHeader(): bad statement_kind_t (%d)", (int) stat->stKind); } fprintf(file, "\n#ifdef __BeforeMigServerHeader\n"); fprintf(file, "__BeforeMigServerHeader\n"); fprintf(file, "#endif /* __BeforeMigServerHeader */\n\n"); for (stat = stats; stat != stNULL; stat = stat->stNext) { if (stat->stKind == skRoutine) WriteServerRoutine(file, stat->stRoutine); } for (stat = stats; stat != stNULL; stat = stat->stNext) { if (stat->stKind == skRoutine) WriteServerRoutine(file, stat->stRoutine); } WriteDispatcher(file); WriteRequestTypes(file, stats); WriteServerRequestUnion(file, stats); WriteReplyTypes(file, stats); WriteServerReplyUnion(file, stats); WriteEpilog(file, protect, FALSE); }