2 * $Source: /afs/andrew/system/cvs/src/sasl/mac/kerberos_includes/kparse.h,v $
4 * $Header: /afs/andrew/system/cvs/src/sasl/mac/kerberos_includes/kparse.h,v 1.2 2001/12/04 02:06:05 rjs3 Exp $
6 * Copyright 1988 by the Massachusetts Institute of Technology.
8 * For copying and distribution information, please see the file
11 * Include file for kparse routines.
14 #ifndef _KERBEROS_KPARSE_H
15 #define _KERBEROS_KPARSE_H
17 #pragma ident "@(#)kparse.h 1.4 93/11/01 SMI"
19 #include <kerberos/mit-copyright.h>
26 * values returned by fGetParameterSet()
29 #define PS_BAD_KEYWORD -2 /* unknown or duplicate keyword */
30 #define PS_SYNTAX -1 /* syntax error */
31 #define PS_OKAY 0 /* got a complete parameter set */
32 #define PS_EOF 1 /* nothing more in the file */
35 * values returned by fGetKeywordValue()
38 #define KV_SYNTAX -2 /* syntax error */
39 #define KV_EOF -1 /* nothing more in the file */
40 #define KV_OKAY 0 /* got a keyword/value pair */
41 #define KV_EOL 1 /* nothing more on this line */
44 * values returned by fGetToken()
47 #define GTOK_BAD_QSTRING -1 /* newline found in quoted string */
48 #define GTOK_EOF 0 /* end of file encountered */
49 #define GTOK_QSTRING 1 /* quoted string */
50 #define GTOK_STRING 2 /* unquoted string */
51 #define GTOK_NUMBER 3 /* one or more digits */
52 #define GTOK_PUNK 4 /* punks are punctuation, newline, etc. */
53 #define GTOK_WHITE 5 /* one or more whitespace chars */
56 * extended character classification macros
59 #define ISOCTAL(CH) ((CH >= '0') && (CH <= '7'))
60 #define ISQUOTE(CH) ((CH == '\"') || (CH == '\'') || (CH == '`'))
61 #define ISWHITESPACE(C) ((C == ' ') || (C == '\t'))
62 #define ISLINEFEED(C) ((C == '\n') || (C == '\r') || (C == '\f'))
65 * tokens consist of any printable charcacter except comma, equal, or
69 #define ISTOKENCHAR(C) ((C > 040) && (C < 0177) && (C != ',') && (C != '='))
72 * the parameter table defines the keywords that will be recognized by
73 * fGetParameterSet, and their default values if not specified.
82 #define PARMCOUNT(P) (sizeof (P)/sizeof (P[0]))
84 extern int LineNbr; /* current line # in parameter file */
86 extern char ErrorMsg[]; /* meaningful only when KV_SYNTAX, */
87 /* PS_SYNTAX, or PS_BAD_KEYWORD is */
88 /* returned by fGetKeywordValue or */
89 /* fGetParameterSet */
91 extern char *strsave(); /* defined in this module */
92 extern char *strutol(); /* defined in this module */
98 #endif /* _KERBEROS_KPARSE_H */