Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/lib/compat.h @ 5:1b34ec11fff8 HEAD
Message data is parsed in blocks (no longer entirely mmap()ed). Several
IOBuffer changes. All mixed signed/unsigned comparisions were fixed so code
can now be compiled with gcc's -W flag. mbox support is broken currently,
and there's most likely several other problems too.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Thu, 22 Aug 2002 01:10:20 +0300 |
parents | 3b1985cbc908 |
children | 62fc6c729962 |
rev | line source |
---|---|
0 | 1 #ifndef __COMPAT_H |
2 #define __COMPAT_H | |
3 | |
4 /* memmove() */ | |
5 #ifndef HAVE_MEMMOVE | |
6 # define memmove my_memmove | |
7 void *my_memmove(void *dest, const void *src, size_t n); | |
8 #endif | |
9 | |
10 /* strcasecmp(), strncasecmp() */ | |
11 #ifndef HAVE_STRCASECMP | |
12 # ifdef HAVE_STRICMP | |
13 # define strcasecmp stricmp | |
14 # define strncasecmp strnicmp | |
15 # else | |
16 # define strcasecmp my_strcasecmp | |
17 # define strncasecmp my_strncasecmp | |
18 int my_strcasecmp(const char *s1, const char *s2); | |
19 int my_strncasecmp(const char *s1, const char *s2, size_t max_chars); | |
20 # endif | |
21 #endif | |
22 | |
23 #ifndef HAVE_INET_ATON | |
24 # include <sys/socket.h> | |
25 # include <netinet/in.h> | |
26 # include <arpa/inet.h> | |
27 # define inet_aton my_inet_aton | |
28 int my_inet_aton(const char *cp, struct in_addr *inp); | |
29 #endif | |
30 | |
31 #ifndef HAVE_VSYSLOG | |
32 # define vsyslog my_vsyslog | |
33 void my_vsyslog(int priority, const char *format, va_list args); | |
34 #endif | |
35 | |
5
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
36 #ifndef HAVE_GETPAGESIZE |
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
37 # define getpagesize my_getpagesize |
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
38 int my_getpagesize(void); |
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
39 #endif |
1b34ec11fff8
Message data is parsed in blocks (no longer entirely mmap()ed). Several
Timo Sirainen <tss@iki.fi>
parents:
0
diff
changeset
|
40 |
0 | 41 /* ctype.h isn't safe with signed chars, |
42 use our own instead if really needed */ | |
43 #define i_toupper(x) toupper((int) (unsigned char) (x)) | |
44 #define i_tolower(x) tolower((int) (unsigned char) (x)) | |
45 #define i_isalnum(x) isalnum((int) (unsigned char) (x)) | |
46 #define i_isalpha(x) isalpha((int) (unsigned char) (x)) | |
47 #define i_isascii(x) isascii((int) (unsigned char) (x)) | |
48 #define i_isblank(x) isblank((int) (unsigned char) (x)) | |
49 #define i_iscntrl(x) iscntrl((int) (unsigned char) (x)) | |
50 #define i_isdigit(x) isdigit((int) (unsigned char) (x)) | |
51 #define i_isgraph(x) isgraph((int) (unsigned char) (x)) | |
52 #define i_islower(x) islower((int) (unsigned char) (x)) | |
53 #define i_isprint(x) isprint((int) (unsigned char) (x)) | |
54 #define i_ispunct(x) ispunct((int) (unsigned char) (x)) | |
55 #define i_isspace(x) isspace((int) (unsigned char) (x)) | |
56 #define i_isupper(x) isupper((int) (unsigned char) (x)) | |
57 #define i_isxdigit(x) isxdigit((int) (unsigned char) (x)) | |
58 | |
59 #endif |