SCM Repository
View of /sml/trunk/src/runtime/kernel/ml-options.c
Parent Directory
|
Revision Log
Revision 250 -
(download)
(as text)
(annotate)
Sat Apr 17 18:57:03 1999 UTC (21 years, 10 months ago) by monnier
File size: 1404 byte(s)
Sat Apr 17 18:57:03 1999 UTC (21 years, 10 months ago) by monnier
File size: 1404 byte(s)
This commit was generated by cvs2svn to compensate for changes in r249, which included commits to RCS files with non-trunk default branches.
/* ml-options.c * * COPYRIGHT (c) 1996 AT&T Research. * * Command-line argument processing utilities. */ #include <ctype.h> #include "ml-base.h" #include "ml-options.h" /* isRuntimeOption: * * Check a command line argument to see if it is a possible runtime * system argument (i.e., has the form "@SMLxxx" or "@SMLxxx=yyy"). * If the command-line argument is a runtime-system argument, then * return TRUE, and copy the "xxx" part into option, and set arg to * point to the start of the "yyy" part. */ bool_t isRuntimeOption (char *cmdLineArg, char *option, char **arg) { char *cp = cmdLineArg, c; if ((*cp++ == '@') && (*cp++ == 'S') && (*cp++ == 'M') && (*cp++ == 'L')) { while (((c = *cp++) != '\0') && (c != '=')) *option++ = c; *option = '\0'; *arg = cp; return TRUE; } else return FALSE; } /* end of isRuntimeOption */ /* GetSzOption: * Get a size specification (accepting K and M suffixes). */ int GetSzOption (int scale, char *sz) { char *p; /* find first non-digit in the string */ for (p = sz; isdigit(*p); *p++) continue; if (p == sz) return -1; else { switch (*p) { case '\0': break; case 'k': case 'K': scale = ONE_K; break; case 'm': case 'M': scale = ONE_MEG; break; default: return -1; } /* end of switch */ return (scale * atoi(sz)); } } /* end of GetSzOption */
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |