home *** CD-ROM | disk | FTP | other *** search
- /* ==( bench/sacred.c )== */
-
- /* ----------------------------------------------- */
- /* Pro-C Copyright (C) 1988 - 1990 Vestronix Inc. */
- /* Modification to this source is not supported */
- /* by Vestronix Inc. */
- /* All Rights Reserved */
- /* ----------------------------------------------- */
- /* Written Nig 1-Jan-88 */
- /* Modified Geo 4-Jan-90 See comments below */
- /* ----------------------------------------------- */
- /* %W% (%H% %T%) */
-
- /*
- * Modifications
- *
- * 4-Jan-90 Geo - V2 version hacked from filmod
- *
- */
-
- # include <stdio.h>
- # include <bench.h>
-
- /* test validity of potential file names */
- int sacred(name)
- char *name;
- {
- static char *reswords[] =
- {
- /* Pro-C reserved words */
- "help", "error", "get", "put", "new", "zero", "fill",
- "comp", "extra", "menu",
-
- /* MSDOS reserved words */
- "prn", "lpt1", "lpt2", "lpt3", "com1", "com2", "com3", "com4",
- "nul", "aux", "con",
-
- NULL
- };
- char **ptr;
-
- /* omitted in elemod version */
- if (*name == '\0')
- return(TRUE);
-
- if (isdigit(*name))
- return(errmsg("Invalid identifier ^%s^\ncannot begin with a number", name));
-
- strlwr(name);
-
- for (ptr = reswords; *ptr != NULL; ptr++)
- if (strcmp(name, *ptr) == 0)
- return(errmsg("Identifier ^%s^ is reserved\nby Pro-C or the compiler", name));
-
- return(FALSE);
- }
-
-