3 // Copyright (C) 2003,2004 Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; version 2 of the License.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef H_UTIL_VSERVER_SRC_WRAPPERS_H
20 #define H_UTIL_VSERVER_SRC_WRAPPERS_H
22 #define WRAPPER_DECL UNUSED ALWAYSINLINE
23 #define H_ENSC_IN_WRAPPERS_H 1
25 #include "wrappers_handler.hc"
27 #define ENSC_DOQUOTE_COND(PTR, VAL, LEN, DO_QUOTE) \
28 if (DO_QUOTE) *PTR++ = '"'; \
29 memcpy(PTR, VAL, LEN); PTR += LEN; \
30 if (DO_QUOTE) *PTR++ = '"' \
32 #define ENSC_DETAIL1(RES,FUNC,VAL,DO_QUOTE) \
33 size_t l_ = strlen(VAL); \
34 char RES[l_ + sizeof(FUNC "(\"\")")]; \
36 memcpy(ptr_, FUNC "(", sizeof(FUNC)); ptr_ += sizeof(FUNC); \
37 ENSC_DOQUOTE_COND(ptr_, VAL, l_, DO_QUOTE); \
41 #define ENSC_DETAIL2(RES,FUNC, VAL0,VAL1, DO_QUOTE0,DO_QUOTE1) \
42 size_t l0_ = strlen(VAL0); \
43 size_t l1_ = strlen(VAL1); \
44 char RES[l0_ + l1_ + sizeof(FUNC "('','')")]; \
46 memcpy(ptr_, FUNC "(", sizeof(FUNC)); ptr_ += sizeof(FUNC); \
47 ENSC_DOQUOTE_COND(ptr_, VAL0, l0_, DO_QUOTE0); \
49 ENSC_DOQUOTE_COND(ptr_, VAL1, l1_, DO_QUOTE1); \
54 #ifdef ENSC_WRAPPERS_UNISTD
55 # include "wrappers-unistd.hc"
58 #ifdef ENSC_WRAPPERS_FCNTL
59 # include "wrappers-fcntl.hc"
62 #ifdef ENSC_WRAPPERS_MOUNT
63 # include "wrappers-mount.hc"
66 #ifdef ENSC_WRAPPERS_RESOURCE
67 # include "wrappers-resource.hc"
70 #ifdef ENSC_WRAPPERS_IOCTL
71 # include "wrappers-ioctl.hc"
74 #ifdef ENSC_WRAPPERS_WAIT
75 # include "wrappers-wait.hc"
78 #ifdef ENSC_WRAPPERS_VSERVER
79 # include "wrappers-vserver.hc"
82 #ifdef ENSC_WRAPPERS_IO
83 # include "wrappers-io.hc"
86 #ifdef ENSC_WRAPPERS_IOSOCK
87 # include "wrappers-iosock.hc"
90 #ifdef ENSC_WRAPPERS_DIRENT
91 # include "wrappers-dirent.hc"
94 #ifdef ENSC_WRAPPERS_CLONE
95 # include "wrappers-clone.hc"
98 #ifdef ENSC_WRAPPERS_STDLIB
99 # include "wrappers-stdlib.hc"
102 #ifdef ENSC_WRAPPERS_STRING
103 # include "wrappers-string.hc"
106 #ifdef ENSC_WRAPPERS_SOCKET
107 # include "wrappers-socket.hc"
110 #ifdef ENSC_WRAPPERS_STAT
111 # include "wrappers-stat.hc"
114 #ifdef ENSC_WRAPPERS_TERMIOS
115 # include "wrappers-termios.hc"
120 #undef ENSC_DOQUOTE_COND
121 #undef H_ENSC_IN_WRAPPERS_H
124 #endif // H_UTIL_VSERVER_SRC_WRAPPERS_H