File: termnet.h

package info (click to toggle)
postit 0.5-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 160 kB
  • ctags: 218
  • sloc: ansic: 753; sh: 241; makefile: 61
file content (149 lines) | stat: -rw-r--r-- 4,902 bytes parent folder | download | duplicates (3)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/* Replace normal networking commands */

#ifndef TERMWRAP
#ifdef _LIBC
#ifdef SHAREDIR
/* These are used for including termnet.c functions in libt.so.4 */
/* I don't use __* directly, because __ has special meaning to some compilers... */
#define term_accept     accept
#define x__accept       __accept
#define term_bind       bind
#define x__bind         __bind
#define term_chroot     chroot
#define x__chroot       __chroot
#define term_close      close
#define x__close        __close
#define term_connect    connect
#define x__connect      __connect
#define term_dup        dup
#define x__dup          __dup
#define term_dup2       dup2
#define x__dup2         __dup2
#define term_fcntl      fcntl
#define x__fcntl        __fcntl
#define term_fork       fork
#define x__fork         __fork
#define term_gethostbyname    __gethostbyname
#define x__gethostbyname      gethostbyname
#define term_gethostbyaddr    __gethostbyaddr
#define x__gethostbyaddr      gethostbyaddr
#define term_gethostname      __gethostname
#define x__gethostname        gethostname
#define term_getpeername      __getpeername
#define x__getpeername        getpeername
#define term_getsockname      __getsockname
#define x__getsockname        getsockname
#define term_listen   __listen
#define x__listen     listen
#define term_perror   _IO_perror
#define __perror      ___IO_perror
#define x__perror     ___IO_perror
#define term_rcmd     __rcmd
#define x__rcmd       rcmd
#define term_recv     __recv
#define x__recv       recv
#define term_recvfrom __recvfrom
#define x__recvfrom   recvfrom
#define term_send     __send
#define x__send       send
#define term_sendto   __sendto
#define x__sendto     sendto
#define term_shutdown __shutdown
#define x__shutdown   shutdown
#define term_socket   __socket
#define x__socket     socket
#define term_strerror __strerror
#define x__strerror   strerror
#else
/* These are to rename the original libc.so.4 functions when including them in */
/* libt.so.4 */
#define accept          __accept
#define bind            __bind
#define chroot(x)       __chroot(x)
#define connect         __connect
#define close(x)        __close(x)
#define dup(x)          __dup(x)
#define dup2(x,y)       __dup2(x,y)
#ifndef linux
#define fcntl           __fcntl
#endif
#define fork(x)         __fork(x)
#define gethostbyname   __gethostbyname
#define gethostbyaddr   __gethostbyaddr
#define getpeername     __getpeername
#define getsockname     __getsockname
#define gethostname(x,y) __gethostname(x,y)
#define listen          __listen
#define perror  	___IO_perror
#define _IO_perror  	___IO_perror
#define rcmd            __rcmd
#define recv            __recv
#define recvfrom        __recvfrom
#define send            __send
#define sendto          __sendto
#define shutdown        __shutdown
#define socket          __socket
#define strerror	__strerror
#endif
#else
#if defined(_LIBTERMNET)
/* This is for compiling libtermnet.so.2 */
#define x__accept          accept
#define x__bind            bind
#define x__chroot          chroot
#define x__close           close
#define x__connect         connect
#define x__dup             dup
#define x__dup2            dup2
#define x__fcntl           fcntl
#define x__fork            fork
#define x__gethostbyname   gethostbyname
#define x__gethostbyaddr   gethostbyaddr
#define x__gethostname     gethostname
#define x__getpeername     getpeername
#define x__getsockname     getsockname
#define x__listen          listen
#define x__perror  	   perror
#define x__rcmd            rcmd
#define x__recv            recv
#define x__recvfrom        recvfrom
#define x__send            send
#define x__sendto          sendto
#define x__shutdown        shutdown
#define x__socket          socket
#define x__strerror	   strerror
#define x__vfork           vfork
#else
/* This is for when the user ports a program to use libtermnet.so.4. */
error error error
#define accept          term_accept
#define bind            term_bind
#define chroot          term_chroot
#define close           term_close
#define connect         term_connect
#define dup             term_dup
#define dup2            term_dup2
#define fcntl           term_fcntl
#define fork            term_fork
#define gethostbyname   term_gethostbyname
#define gethostbyaddr   term_gethostbyaddr
#define gethostname     term_gethostname
#define getpeername     term_getpeername
#define getsockname     term_getsockname
#define listen          term_listen
#define perror  	term_perror
#define rcmd            term_rcmd
#define recv            term_recv
#define recvfrom        term_recvfrom
#define send            term_send
#define sendto          term_sendto
#define shutdown        term_shutdown
#define socket          term_socket
#define strerror	term_strerror
#ifndef vfork
#define vfork           term_vfork
#endif /* vfork */
#endif /* _LIBTERMNET */
#endif /* _LIBC */
#endif /* TERMWRAP */