home *** CD-ROM | disk | FTP | other *** search
- head 1.5;
- access;
- symbols
- sercli_v1_10:1.5
- sercli_v1_9:1.4
- sercli_v1_8:1.4
- sercli_v1_7:1.3
- sercli_v1_6:1.2
- sercli_v1_5:1.1;
- locks
- rkr:1.5;
- comment @** @;
-
-
- 1.5
- date 93.06.16.23.28.53; author rkr; state Exp;
- branches;
- next 1.4;
-
- 1.4
- date 91.12.20.09.43.39; author rkr; state Exp;
- branches;
- next 1.3;
-
- 1.3
- date 91.12.10.02.48.05; author rkr; state Exp;
- branches;
- next 1.2;
-
- 1.2
- date 91.12.02.10.51.23; author rkr; state Exp;
- branches;
- next 1.1;
-
- 1.1
- date 91.11.28.08.25.13; author rkr; state Exp;
- branches;
- next ;
-
-
- desc
- @sercli is a program to permit shell-like interface to the serial port,
- while also permitting easy config- and run-time-control over the way the
- serial port (or even _which_ serial port) is used.
-
- @
-
-
- 1.5
- log
- @Added per-file copyright notice, as suggested by GPL.
- @
- text
- @/*
- ** $Source: WB_2.1:homes/rkr/prog/sercli/src/rcs/config.c,v $
- ** $Author: rkr $
- ** $Revision: 1.4 $
- ** $Locker: $
- ** $State: Exp $
- ** $Date: 1991/12/20 09:43:39 $
- **
- ** sercli (an Amiga .device <-> FIFO interface tool)
- ** Copyright (C) 1993 Richard Rauch
- **
- ** See /doc/sercli.doc and /COPYING for use and distribution license.
- **
- */
-
- #include "defs.h"
- #include "misc.h"
- #include "config.h"
-
-
-
- /*
- ** If the text is blank, or begins with one of certain characters, the
- ** text is considered a comment.
- **
- ** It might be better to provide these in a global string variable, or a
- ** parameter to this function, and use one of the ANSI searching functions
- ** to scan {comment_chars} for the first char in {text}.
- **
- **
- ** If the text is not deemed a comment, we locate the first colon in the
- ** line; this becomes a terminator for a compare.
- **
- ** Then, each option in {opts} is compared to text, up to, but not
- ** including, the colon. Case INsensitive
- **
- */
- int match (char *text, option *opts)
- {
- int
- end,
- result;
-
- switch (*text)
- {
- case 0:
- case ' ':
- case '\t':
- case '\n':
- case '\v':
- case '\r':
- case '*':
- case '#':
- case ';':
- case ':':
- result = OPTION_COMMENT;
- break;
-
- default:
- for (end = 0; (text [end]) && (text [end] != ':') ; ++end)
- ;
-
- for (; OPTION_NULL != opts->o_id; ++opts)
- if (strnicmp (text, opts->o_text, end) == 0)
- break;
-
- result = opts->o_id;
- if (!result)
- result = OPTION_NOT_FOUND;
-
- break;
- }
- return (result);
- }
-
- @
-
-
- 1.4
- log
- @*** empty log message ***
- @
- text
- @d2 1
- a2 1
- ** $Source: Workbench:personal/rkr/prog/sercli/src/rcs/config.c,v $
- d4 2
- a5 2
- ** $Revision: 1.3 $
- ** $Locker: rkr $
- d7 6
- a12 1
- ** $Date: 91/12/10 02:48:05 $
- @
-
-
- 1.3
- log
- @*** empty log message ***
- @
- text
- @d4 1
- a4 1
- ** $Revision: 1.2 $
- d7 1
- a7 1
- ** $Date: 91/12/02 10:51:23 $
- @
-
-
- 1.2
- log
- @*** empty log message ***
- @
- text
- @d7 1
- a7 1
- ** $Date: 91/12/02 10:42:00 $
- @
-
-
- 1.1
- log
- @Initial revision
- @
- text
- @d2 6
- a7 6
- ** $Source$
- ** $Author$
- ** $Revision$
- ** $Locker$
- ** $State$
- ** $Date$
- @
-