ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/ermyth/include/match.h
Revision: 1.3
Committed: Tue Aug 28 17:08:06 2007 UTC (16 years, 9 months ago) by pippijn
Content type: text/plain
Branch: MAIN
Changes since 1.2: +6 -9 lines
Log Message:
- changed name
- updated the example config to the new system
- added more documentation
- enhanced documentation generators
- added a link to the pdf to the website
- added an RSS feed generator
- transitioned hooks to c++ callbacks
- did various merges with upstream along the way
- added const where appropriate
- removed the old block allocator
- fixed most memory leaks
- transitioned some dictionaries to std::map
- transitioned some lists to std::vector
- made some free functions members where appropriate
- renamed string to dynstr and added a static string ststr
- use NOW instead of time (NULL) if possible
- completely reworked database backends, crypto handlers and protocol handlers
  to use an object factory
- removed the old module system. ermyth does not do any dynamic loading anymore
- fixed most of the build system
- reworked how protocol commands work

File Contents

# Content
1 /*
2 * Copyright © 2003-2004 E. Will et al.
3 * Copyright © 2005-2006 Atheme Development Group
4 * Rights to this code are as defined in doc/pod/license.pod.
5 *
6 * String matching
7 *
8 * $Id: match.h,v 1.2 2007-07-21 01:29:07 pippijn Exp $
9 */
10
11 #ifndef _MATCH_H
12 #define _MATCH_H
13
14 /* cidr.c */
15 E int match_ips (char const * const mask, char const * const address);
16 E int match_cidr (char const * const mask, char const * const address);
17
18 /* match.c */
19 #define MATCH_RFC1459 0
20 #define MATCH_ASCII 1
21
22 E int match_mapping;
23
24 #define IsLower(c) ((unsigned char)(c) > 0x5f)
25 #define IsUpper(c) ((unsigned char)(c) < 0x60)
26
27 #define C_ALPHA 0x00000001
28 #define C_DIGIT 0x00000002
29
30 E const unsigned int charattrs[];
31
32 #define IsAlpha(c) (charattrs[(unsigned char) (c)] & C_ALPHA)
33 #define IsDigit(c) (charattrs[(unsigned char) (c)] & C_DIGIT)
34 #define IsAlphaNum(c) (IsAlpha((c)) || IsDigit((c)))
35 #define IsNon(c) (!IsAlphaNum((c)))
36
37 E const unsigned char ToLowerTab[];
38 E const unsigned char ToUpperTab[];
39
40 void set_match_mapping (int);
41
42 E int ToLower (int);
43 E int ToUpper (int);
44
45 E int match (char const * const mask, char const * const name);
46 E char *collapse (char *);
47
48 /* regex_create() flags */
49 #define AREGEX_ICASE 1 /* case insensitive */
50
51 E regex_t *regex_create (char *pattern, int flags);
52 E char *regex_extract (char *pattern, char **pend, int *pflags);
53 E bool regex_match (regex_t * preg, char *string);
54 E bool regex_destroy (regex_t * preg);
55
56 #endif