Version 1.8.0.0
[socat.git] / xioopen.h
blob481b527524d1546ec2f9d92f3b6232cb74ec2967
1 /* source: xioopen.h */
2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
3 /* Published under the GNU General Public License V.2, see file COPYING */
5 #ifndef __xioopen_h_included
6 #define __xioopen_h_included 1
8 #include "compat.h" /* F_pid */
9 #include "mytypes.h"
10 #include "error.h"
11 #include "utils.h"
12 #include "sysutils.h"
14 #include "sycls.h"
15 #include "sslcls.h"
16 #include "dalan.h"
17 #include "filan.h"
18 #include "xio.h"
19 #include "xioopts.h"
22 #if WITH_HELP
23 #define HELP(x) , x
24 #else
25 #define HELP(x)
26 #endif
30 /* xioinitialize performs asserts on these records */
31 extern const struct optdesc opt_crdly;
32 extern const struct optdesc opt_tabdly;
33 extern const struct optdesc opt_csize;
36 struct addrname {
37 const char *name;
38 const struct addrdesc *desc;
39 } ;
41 extern const char *ddirection[];
42 extern const char *filetypenames[];
43 extern const struct addrname addressnames[];
44 extern const struct optname optionnames[];
46 extern int xioopen_makedual(xiofile_t *file);
48 #if WITH_HELP
49 extern int xio_syntax(const char *addr, int expectnum, int isnum, const char *syntax);
50 #else
51 #define xio_syntax(a,e,i,s) Error3("%s: wrong number of parameters (%d instead of %d)", a, i, e);
52 #endif
54 #define retropt_2bytes(o,c,r) retropt_ushort(o,c,r)
56 /* mode_t might be unsigned short or unsigned int or what else? */
57 #if HAVE_BASIC_MODE_T==1
58 # define retropt_modet(x,y,z) retropt_short(x,y,z)
59 #elif HAVE_BASIC_MODE_T==2
60 # define retropt_modet(x,y,z) retropt_ushort(x,y,z)
61 #elif HAVE_BASIC_MODE_T==3
62 # define retropt_modet(x,y,z) retropt_int(x,y,z)
63 #elif HAVE_BASIC_MODE_T==4
64 # define retropt_modet(x,y,z) retropt_uint(x,y,z)
65 #elif HAVE_BASIC_MODE_T==5
66 # define retropt_modet(x,y,z) retropt_long(x,y,z)
67 #elif HAVE_BASIC_MODE_T==6
68 # define retropt_modet(x,y,z) retropt_ulong(x,y,z)
69 #endif
71 #if HAVE_BASIC_UID_T==1
72 # define retropt_uidt(x,y,z) retropt_short(x,y,z)
73 #elif HAVE_BASIC_UID_T==2
74 # define retropt_uidt(x,y,z) retropt_ushort(x,y,z)
75 #elif HAVE_BASIC_UID_T==3
76 # define retropt_uidt(x,y,z) retropt_int(x,y,z)
77 #elif HAVE_BASIC_UID_T==4
78 # define retropt_uidt(x,y,z) retropt_uint(x,y,z)
79 #elif HAVE_BASIC_UID_T==5
80 # define retropt_uidt(x,y,z) retropt_long(x,y,z)
81 #elif HAVE_BASIC_UID_T==6
82 # define retropt_uidt(x,y,z) retropt_ulong(x,y,z)
83 #endif
85 #if HAVE_BASIC_GID_T==1
86 # define retropt_gidt(x,y,z) retropt_short(x,y,z)
87 #elif HAVE_BASIC_GID_T==2
88 # define retropt_gidt(x,y,z) retropt_ushort(x,y,z)
89 #elif HAVE_BASIC_GID_T==3
90 # define retropt_gidt(x,y,z) retropt_int(x,y,z)
91 #elif HAVE_BASIC_GID_T==4
92 # define retropt_gidt(x,y,z) retropt_uint(x,y,z)
93 #elif HAVE_BASIC_GID_T==5
94 # define retropt_gidt(x,y,z) retropt_long(x,y,z)
95 #elif HAVE_BASIC_GID_T==6
96 # define retropt_gidt(x,y,z) retropt_ulong(x,y,z)
97 #endif
100 #endif /* !defined(__xioopen_h_included) */