* New version 2.21.999
[alpine.git] / pith / filttype.h
blobdc00787fd47d21ea6a5b2bf0767a24f9f11d92fd
1 /*
2 * $Id: filttype.h 767 2007-10-24 00:03:59Z hubert@u.washington.edu $
4 * ========================================================================
5 * Copyright 2013-2018 Eduardo Chappa
6 * Copyright 2006 University of Washington
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * ========================================================================
17 #ifndef PITH_FILTTYPE_INCLUDED
18 #define PITH_FILTTYPE_INCLUDED
22 * Size of generic filter's input/output queue
24 #define GF_MAXBUF 256
28 * typedefs of generalized filters used by gf_pipe
30 typedef struct filter_s { /* type to hold data for filter function */
31 void (*f)(struct filter_s *, int);
32 struct filter_s *next; /* next filter to call */
33 long n; /* number of chars seen */
34 short f1; /* flags */
35 int f2; /* second place for flags */
36 unsigned char t; /* temporary char */
37 char *line; /* place for temporary storage */
38 char *linep; /* pointer into storage space */
39 void *opt; /* optional per instance data */
40 void *data; /* misc internal data pointer */
41 unsigned char queue[1 + GF_MAXBUF];
42 short queuein, queueout;
43 } FILTER_S;
46 typedef struct filter_insert_s {
47 char *where;
48 char *text;
49 int len;
50 struct filter_insert_s *next;
51 } LT_INS_S;
54 typedef int (*gf_io_t)(); /* type of get and put char function */
55 typedef void (*filter_t)(FILTER_S *, int);
56 typedef int (*linetest_t)(long, char *, LT_INS_S **, void *);
57 typedef void (*htmlrisk_t)(void);
58 typedef int (*prepedtest_t)(void);
60 typedef struct filtlist_s {
61 filter_t filter;
62 void *data;
63 } FILTLIST_S;
66 typedef struct cbuf_s {
67 unsigned char cbuf[6]; /* used for converting to or from */
68 unsigned char *cbufp; /* locale-specific charset */
69 unsigned char *cbufend;
70 } CBUF_S;
73 /* exported protoypes */
76 #endif /* PITH_FILTTYPE_INCLUDED */