File: fields.h

package info (click to toggle)
ispell 3.1.20-21.1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,800 kB
  • ctags: 974
  • sloc: ansic: 8,370; makefile: 2,097; yacc: 1,712; lisp: 1,613; sh: 1,151; objc: 385; csh: 215; python: 112
file content (62 lines) | stat: -rw-r--r-- 1,926 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
 * $Id: fields.h,v 1.4 1994/01/05 20:13:43 geoff Exp $
 *
 * $Log: fields.h,v $
 * Revision 1.4  1994/01/05  20:13:43  geoff
 * Add the maxf parameter
 *
 * Revision 1.3  1994/01/04  02:40:22  geoff
 * Add field_line_inc, field_field_inc, and the FLD_NOSHRINK flag.
 *
 * Revision 1.2  1993/09/09  01:11:12  geoff
 * Add a return value to fieldwrite and support for backquotes.
 *
 * Revision 1.1  1993/08/25  21:32:05  geoff
 * Initial revision
 *
 */

/*
 * Structures used by the field-access package.
 */

typedef struct
    {
    int		nfields;	/* Number of fields in the line */
    int		hadnl;		/* NZ if line ended with a newline */
    char *	linebuf;	/* Malloc'ed buffer containing the line */
    char **	fields;		/* Malloc'ed array of pointers to fields */
    }
		field_t;

/*
 * Flags to fieldread and fieldmake
 */
#define FLD_RUNS	0x0001	/* Consider runs of delimiters same as one */
#define FLD_SNGLQUOTES	0x0002	/* Accept single-quoted fields */
#define FLD_BACKQUOTES	0x0004	/* Accept back-quoted fields */
#define FLD_DBLQUOTES	0x0008	/* Accept double-quoted fields */
#define FLD_SHQUOTES	0x0010	/* Use shell-style (embedded) quoting rules */
#define FLD_STRIPQUOTES	0x0020	/* Strip quotes from fields */
#define FLD_BACKSLASH	0x0040	/* Process C-style backslashes */
#define FLD_NOSHRINK	0x0080	/* Don't shrink memory before return */

#undef P
#ifdef __STDC__
#define P(x)	x
#else /* __STDC__ */
#define P(x)	()
#endif /* __STDC__ */

extern field_t *	fieldread P ((FILE * file, char * delims,
			  int flags, int maxf));
extern field_t *	fieldmake P ((char * line, int allocated,
			  char * delims, int flags, int maxf));
extern int		fieldwrite P ((FILE * file, field_t * fieldp,
			  int delim));
extern void		fieldfree P ((field_t * fieldp));

extern unsigned int	field_field_inc;
				/* Increment for expanding fields */
extern unsigned int	field_line_inc;
				/* Increment for expanding lines */