diff options
Diffstat (limited to 'lib/libmytinfo/tmatch.c')
-rw-r--r-- | lib/libmytinfo/tmatch.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/lib/libmytinfo/tmatch.c b/lib/libmytinfo/tmatch.c new file mode 100644 index 0000000..afccda7 --- /dev/null +++ b/lib/libmytinfo/tmatch.c @@ -0,0 +1,37 @@ +/* + * tmatch.c + * + * By Ross Ridge + * Public Domain + * 92/02/01 07:30:35 + * + * See if a terminal name matches a list of terminal names from a + * terminal description + * + */ + +#include "defs.h" + +#ifdef USE_SCCS_IDS +static const char SCCSid[] = "@(#) mytinfo tmatch.c 3.2 92/02/01 public domain, By Ross Ridge"; +#endif + +int +_tmatch(line, name) +char *line, *name; { + char term[MAX_LINE]; + char *sp, *dp; + + sp = line; + while (*sp != '\0') { + dp = term; + while (*sp != '\0' && *sp != '|') + *dp++ = *sp++; + *dp = '\0'; + if (strcmp(term, name) == 0) + return 1; + if (*sp == '|') + sp++; + } + return 0; +} |