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
63
64
65
66
67
68
69
70
71
72
73
74
75
|
/*
charset.h
last touched in Par 1.53.0
last meaningful change in Par 1.31
Copyright 1993 Adam M. Costello
This is ANSI C code (C89).
Note: Those functions declared here which do not use errmsg
always succeed, provided that they are passed valid arguments.
*/
#ifndef CHARSET_H
#define CHARSET_H
#include "errmsg.h"
typedef struct charset charset;
charset *parsecharset(const char *str, errmsg_t errmsg);
/* parsecharset(str,errmsg) returns the set of characters defined by */
/* str using charset syntax (see par.doc). Returns NULL on failure. */
void freecharset(charset *cset);
/* freecharset(cset) frees any memory associated with */
/* *cset. cset may not be used after this call. */
int csmember(char c, const charset *cset);
/* csmember(c,cset) returns 1 if c is a member of *cset, 0 otherwise. */
charset *csunion(const charset *cset1, const charset *cset2, errmsg_t errmsg);
/* csunion(cset1,cset2) returns a pointer to the */
/* union of *cset1 and *cset2, or NULL on failure. */
charset *csdiff(const charset *cset1, const charset *cset2, errmsg_t errmsg);
/* csdiff(cset1,cset2) returns a pointer to the set */
/* difference *cset1 - *cset2 , or NULL on failure. */
void csadd(charset *cset1, const charset *cset2, errmsg_t errmsg);
/* csadd(cset1,cset2) adds the members of *cset2 */
/* to *cset1. On failure, *cset1 is not changed. */
void csremove(charset *cset1, const charset *cset2, errmsg_t errmsg);
/* csremove(cset1,cset2) removes the members of *cset2 */
/* from *cset1. On failure, *cset1 is not changed. */
charset *cscopy(const charset *cset, errmsg_t errmsg);
/* cscopy(cset) returns a copy of cset, or NULL on failure. */
void csswap(charset *cset1, charset *cset2);
/* csswap(cset1,cset2) swaps the contents of *cset1 and *cset2. */
#endif
|