SCM Repository
[smlnj] / sml / branches / idlbasis-devel / src / runtime / config / gen-common.c |
View of /sml/branches/idlbasis-devel/src/runtime/config/gen-common.c
Parent Directory
|
Revision Log
Revision 848 -
(download)
(as text)
(annotate)
Mon Jun 25 19:29:29 2001 UTC (19 years, 9 months ago)
File size: 1112 byte(s)
Mon Jun 25 19:29:29 2001 UTC (19 years, 9 months ago)
File size: 1112 byte(s)
This commit was manufactured by cvs2svn to create branch 'idlbasis-devel'.
/* gen-common.c * * COPYRIGHT (c) 1994 by AT&T Bell Laboratories. * * Common code for generating header files. */ #include <stdio.h> #include "gen.h" /* OpenFile: * * Open a generated file, and generate its header comment. */ FILE *OpenFile (char *fname, char *flag) { FILE *f; if ((f = fopen(fname, "w")) == NULL) { fprintf (stderr, "unable to open file \"%s\"\n", fname); exit (1); } fprintf (f, "/* %s\n", fname); fprintf (f, " *\n"); fprintf (f, " * COPYRIGHT (c) 1995 by AT&T Bell Laboratories.\n"); fprintf (f, " *\n"); fprintf (f, " * NOTE: this file is generated --- do not edit!!!\n"); fprintf (f, " */\n"); fprintf (f, "\n"); if (flag != (char *)0) { fprintf (f, "#ifndef %s\n", flag); fprintf (f, "#define %s\n", flag); fprintf (f, "\n"); } return f; } /* end of OpenFile */ /* CloseFile: * * Generate the file trailer, and close the generated file. */ void CloseFile (FILE *f, char *flag) { if (flag != (char *)0) { fprintf (f, "\n"); fprintf (f, "#endif /* !%s */\n", flag); } fclose (f); } /* CloseFile */
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |