]> arthur.barton.de Git - netatalk.git/blob - etc/papd/comment.h
CVS id tags, define fixes, code beautification
[netatalk.git] / etc / papd / comment.h
1 /*
2  * $Id: comment.h,v 1.5 2001-06-25 20:13:45 rufustfirefly Exp $
3  *
4  * Copyright (c) 1990,1991 Regents of The University of Michigan.
5  * All Rights Reserved.  See COPYRIGHT.
6  */
7
8 #ifndef PAPD_COMMENT_H
9 #define PAPD_COMMENT_H 1
10
11 #include <sys/cdefs.h>
12
13 struct papd_comment {
14     char                *c_begin;
15     char                *c_end;
16     int                 (*c_handler)();
17     int                 c_flags;
18 };
19
20 #define CH_DONE         0
21 #define CH_MORE         1
22 #define CH_ERROR        -1
23
24 struct comstate {
25     struct papd_comment *cs_comment;
26     struct comstate     *cs_prev;
27     int                 cs_flags;
28 };
29
30 extern struct papd_comment      *commatch();
31 extern struct comstate          *comstate;
32 extern struct papd_comment      magics[];
33 extern struct papd_comment      queries[];
34 extern struct papd_comment      headers[];
35 extern char                     *comcont;
36
37 #define compeek()       (comstate==NULL?NULL:(comstate->cs_comment))
38 #define comgetflags()   (comstate->cs_flags)
39 #define comsetflags(f)  (comstate->cs_flags=(f))
40
41 /*
42  * Comment flags.  0-15 reserved for "global" flags, 16-31 for specific
43  * subtypes.
44  */
45 #define C_FULL          (1<<0)                          /* or prefix */
46 #define C_CONTINUE      (1<<1)
47
48 /*
49  * Query subtypes.
50  */
51
52 /*
53  * Magic "number" subtypes.
54  */
55 #define CM_NOPRINT      (1<<16)                         /* or print */
56
57 void compop __P(( void ));
58 void compush __P(( struct papd_comment * ));
59 int comswitch __P(( struct papd_comment *, int (*)() ));
60 int comcmp __P(( char *, char *, char *, int ));
61 struct papd_comment *commatch __P(( char *, char *, struct papd_comment * ));
62 char *comtoken __P(( char *, char *, char *, char * ));
63
64 #endif /* PAPD_COMMENT_H */