home *** CD-ROM | disk | FTP | other *** search
- /* dfcss.c */
- /*
-
- * Copyright 1994 A.Oliver De Guzman
- * All rights reserved
-
- * Permission is granted to any individual to copy, use, and/or
- * distribute this software provided that the distribution retains this
- * entire copyright notice. No part of this software may be used and/or
- * sold for profit or used with any commercial product.
-
- * DISCLAIMER:
- * This software comes with NO WARRANTIES of any kind. In no event
- * will the author be liable for any financial, physical, moral, and/or
- * mental damages incurred directly or indirectly by the use or intent
- * to use of this software.
-
- */
-
- #include <stdlib.h>
- #include <stdio.h>
- #include <ctype.h>
- #include <time.h>
- #include "dfcss.h"
-
- int CheckParm(check, argc, argv)
- char *check;
- int argc;
- char *argv[];
- {
- int i;
- for (i=1; i<argc; i++)
- if (!strcmp(check,argv[i]))
- return i;
- return 0;
- }
-
- int StripWhite(s)
- char *s;
- {
- int i=0, j;
-
- /* skip trailing whites */
- for (; strlen(s) && isspace(s[strlen(s)-1]);)
- s[strlen(s)-1] = '\0';
-
- /* skip leading whites */
- for (i=0; isspace(s[i]) && s[i]; i++);
- for (j=i; j && s[j-1]; j++) s[j-i] = s[j];
-
- /* search for non-white */
- for (i=0; !isspace(s[i]) && s[i]; i++);
-
- if (s[i]) StripWhite(s+i+1);
- }
-
-