home *** CD-ROM | disk | FTP | other *** search
- /*
- msyspars.c
-
- % msys_ParseChoice
-
- C-scape 3.2
- Copyright (c) 1990, by Oakland Group, Inc.
- ALL RIGHTS RESERVED.
-
- Revision History:
- -----------------
- 1/05/90 jmd moved into library
- 3/28/90 jmd ansi-fied
- */
-
- #include <stdio.h>
- #include <ctype.h>
- #include <string.h>
-
- #include "cscape.h"
- #include "msys.h"
-
- int msys_ParseChoice(char *in, char *out, int slen)
- /*
- Searchs through a msys choice string (in).
- replaces occurence of @x with x (where 'x' is some character)
- and returns the number of the character with the @ in front
- of it. frame_Open and slug_Open use this information
- to turn on character highlighting for the field.
- Copies the string from 'in' to 'out' without '@' character
- slen is the length of the 'out' buffer.
- */
- {
- char *p;
- int hichar = -1;
-
- for(p = in; *p != '\0' && (p - in) < slen; p++) {
- if (*p == '@') {
- hichar = p - in;
- }
- else {
- *out++ = *p;
- }
- }
-
- *out = '\0';
- return(hichar);
- }
-