"Fossies" - the Fresh Open Source Software Archive

Member "socat-1.7.3.2/sycls.h" (6 Jan 2017, 9837 Bytes) of package /linux/privat/socat-1.7.3.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "sycls.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 1.7.3.1_vs_1.7.3.2.

    1 /* source: sycls.h */
    2 /* Copyright Gerhard Rieger and contributors (see file CHANGES) */
    3 /* Published under the GNU General Public License V.2, see file COPYING */
    4 
    5 #ifndef __sycls_h_included
    6 #define __sycls_h_included 1
    7 
    8 #if WITH_SYCLS
    9 struct termios; /* prevent gcc from spitting silly warning */
   10 struct utsname;
   11 struct flock;
   12 struct addrinfo;
   13 
   14 mode_t Umask(mode_t mask);
   15 #endif /* WITH_SYCLS */
   16 int Open(const char *pathname, int flags, mode_t mode);
   17 #if WITH_SYCLS
   18 int Creat(const char *pathname, mode_t mode);
   19 off_t Lseek(int fildes, off_t offset, int whence);
   20 #if HAVE_LSEEK64
   21 off64_t Lseek64(int fildes, off64_t offset, int whence);
   22 #endif
   23 pid_t Getpid(void);
   24 pid_t Getppid(void);
   25 pid_t Getpgrp(void);
   26 int Getpgid(pid_t pid);
   27 int Setpgid(pid_t pid, pid_t pgid);
   28 int Setpgrp(void);
   29 pid_t Tcgetpgrp(int fd);
   30 int Tcsetpgrp(int fd, pid_t pgrpid);
   31 pid_t Getsid(pid_t pid);
   32 pid_t Setsid(void);
   33 uid_t Getuid(void);
   34 uid_t Geteuid(void);
   35 int Setuid(uid_t uid);
   36 gid_t Getgid(void);
   37 gid_t Getegid(void);
   38 int Setgid(gid_t gid);
   39 int Initgroups(const char *user, gid_t group);
   40 int Getgroups(int size, gid_t list[]);
   41 int Setgroups(size_t size, const gid_t *list);
   42 int Getgrouplist(const char *user, gid_t group, gid_t *groups, int *ngroups);
   43 int Chdir(const char *path);
   44 int Chroot(const char *path);
   45 int Gettimeofday(struct timeval *tv, struct timezone *tz);
   46 int Mknod(const char *pathname, mode_t mode, dev_t dev);
   47 int Mkfifo(const char *pathname, mode_t mode);
   48 int Stat(const char *file_name, struct stat *buf);
   49 int Fstat(int filedes, struct stat *buf);
   50 int Lstat(const char *file_name, struct stat *buf);
   51 #if HAVE_STAT64
   52 int Stat64(const char *file_name, struct stat64 *buf);
   53 int Fstat64(int filedes, struct stat64 *buf);
   54 int Lstat64(const char *file_name, struct stat64 *buf);
   55 #endif /* HAVE_STAT64 */
   56 int Dup(int oldfd);
   57 int Dup2(int oldfd, int newfd);
   58 int Pipe(int filedes[2]);
   59 #endif /* WITH_SYCLS */
   60 ssize_t Read(int fd, void *buf, size_t count);
   61 ssize_t Write(int fd, const void *buf, size_t count);
   62 int Fcntl(int fd, int cmd);
   63 int Fcntl_l(int fd, int cmd, long arg);
   64 int Fcntl_lock(int fd, int cmd, struct flock *l);
   65 #if WITH_SYCLS
   66 int Ftruncate(int fd, off_t length);
   67 #if HAVE_FTRUNCATE64
   68 int Ftruncate64(int fd, off64_t length);
   69 #endif /* HAVE_FTRUNCATE64 */
   70 #endif /* WITH_SYCLS */
   71 int Flock(int fd, int operation);
   72 int Ioctl(int d, int request, void *argp);
   73 int Ioctl_int(int d, int request, int arg);
   74 #if WITH_SYCLS
   75 int Close(int fd);
   76 int Fchown(int fd, uid_t owner, gid_t group);
   77 int Fchmod(int fd, mode_t mode);
   78 int Unlink(const char *pathname);
   79 int Symlink(const char *oldpath, const char *newpath);
   80 int Readlink(const char *path, char *buf, size_t bufsiz);
   81 int Chown(const char *path, uid_t owner, gid_t group);
   82 int Chmod(const char *path, mode_t mode);
   83 #endif /* WITH_SYCLS */
   84 int Poll(struct pollfd *ufds, unsigned int nfds, int timeout);
   85 int Select(int n, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
   86        struct timeval *timeout);
   87 #if WITH_SYCLS
   88 pid_t Fork(void);
   89 #endif /* WITH_SYCLS */
   90 pid_t Waitpid(pid_t pid, int *status, int options);
   91 #if WITH_SYCLS
   92 #ifndef HAVE_TYPE_SIGHANDLER
   93 typedef RETSIGTYPE (*sighandler_t)(int);
   94 #endif
   95 sighandler_t Signal(int signum, sighandler_t handler);
   96 int Sigaction(int signum, const struct sigaction *act,
   97           struct sigaction *oldact);
   98 int Sigprocmask(int how, const sigset_t *set, sigset_t *oset);
   99 unsigned int Alarm(unsigned int seconds);
  100 int Kill(pid_t pid, int sig);
  101 int Link(const char *oldpath, const char *newpath);
  102 int Execvp(const char *file, char *const argv[]);
  103 #endif /* WITH_SYCLS */
  104 int System(const char *string);
  105 #if WITH_SYCLS
  106 int Socketpair(int d, int type, int protocol, int sv[2]);
  107 #endif /* WITH_SYCLS */
  108 #if _WITH_SOCKET
  109 #if WITH_SYCLS
  110 int Socket(int domain, int type, int protocol);
  111 int Bind(int sockfd, struct sockaddr *my_addr, socklen_t addrlen);
  112 #endif /* WITH_SYCLS */
  113 int Connect(int sockfd, const struct sockaddr *serv_addr, socklen_t addrlen);
  114 #if WITH_SYCLS
  115 int Listen(int s, int backlog);
  116 #endif /* WITH_SYCLS */
  117 int Accept(int s, struct sockaddr *addr, socklen_t *addrlen);
  118 #if WITH_SYCLS
  119 int Getsockname(int s, struct sockaddr *name, socklen_t *namelen);
  120 int Getpeername(int s, struct sockaddr *name, socklen_t *namelen);
  121 int Getsockopt(int s, int level, int optname, void *optval, socklen_t *optlen);
  122 int Setsockopt(int s, int level, int optname, const void *optval, int optlen);
  123 #endif /* WITH_SYCLS */
  124 int Recv(int s, void *buf, size_t len, int flags);
  125 int Recvfrom(int s, void *buf, size_t len, int flags, struct sockaddr *from,
  126          socklen_t *fromlen);
  127 int Recvmsg(int s, struct msghdr *msg, int flags);
  128 int Send(int s, const void *mesg, size_t len, int flags);
  129 int Sendto(int s, const void *msg, size_t len, int flags,
  130        const struct sockaddr *to, socklen_t tolen);
  131 #if WITH_SYCLS
  132 int Shutdown(int fd, int how);
  133 #endif /* WITH_SYCLS */
  134 #endif /* _WITH_SOCKET */
  135 #if WITH_SYCLS
  136 unsigned int Sleep(unsigned int seconds);
  137 void Usleep(unsigned long usec);
  138 unsigned int Nanosleep(const struct timespec *req, struct timespec *rem);
  139 int Pause(void);
  140 struct hostent *Gethostbyname(const char *name);
  141 int Getaddrinfo(const char *node, const char *service,
  142         const struct addrinfo *hints, struct addrinfo **res);
  143 struct hostent *Getipnodebyname(const char *name, int af, int flags,
  144                                 int *error_num);
  145 void *Malloc(size_t size);
  146 void *Calloc(size_t nmemb, size_t size);
  147 void *Realloc(void *ptr, size_t size);
  148 int Tcgetattr(int fd, struct termios *termios_p);
  149 int Tcsetattr(int fd, int optional_actions, struct termios *termios_p);
  150 char *Ttyname(int fd);
  151 int Isatty(int fd);
  152 struct winsize; /* avoid warnings */
  153 int Openpty(int *ptyfd, int *ttyfd, char *ptyname, struct termios *termp,
  154         struct winsize *winp);
  155 char *Ptsname(int fd);
  156 int Grantpt(int fd);
  157 int Unlockpt(int fd);
  158 int Gethostname(char *name, size_t len);
  159 int Uname(struct utsname *buf);
  160 int Atexit(void (*func)(void));
  161 #endif /* WITH_SYCLS */
  162 void Exit(int status);
  163 #if WITH_SYCLS
  164 void Abort(void);
  165 int Mkstemp(char *template);
  166 int Setenv(const char *name, const char *value, int overwrite);
  167 void Unsetenv(const char *name);
  168 
  169 char *Readline(const char *prompt);
  170 void Using_history(void);
  171 int Read_history(const char *filename);
  172 int Write_history(const char *filename);
  173 int Append_history(int nelements, const char *filename);
  174 int Read_history(const char *filename);
  175 void Add_history(const char *string);
  176 
  177 #else /* !WITH_SYCLS */
  178 
  179 #define Umask(m) umask(m)
  180 #define Creat(p,m) creat(p,m)
  181 #define Lseek(f,o,w) lseek(f,o,w)
  182 #define Lseek64(f,o,w) lseek64(f,o,w)
  183 #define Getpid() getpid()
  184 #define Getppid() getppid()
  185 #define Getpgrp() getpgrp()
  186 #define Getpgid(p) getpgid(p)
  187 #define Setpgid(p,g) setpgid(p,g)
  188 #define Setpgrp() setpgrp()
  189 #define Tcgetpgrp(f) tcgetpgrp(f)
  190 #define Tcsetpgrp(f,p) tcsetpgrp(f,p)
  191 #define Getsid(p) getsid(p)
  192 #define Setsid() setsid()
  193 #define Getuid() getuid()
  194 #define Geteuid() geteuid()
  195 #define Setuid(u) setuid(u)
  196 #define Getgid() getgid()
  197 #define Getegid() getegid()
  198 #define Setgid(g) setgid(g)
  199 #define Initgroups(u,g) initgroups(u,g)
  200 #define Getgroups(s,l) getgroups(s,l)
  201 #define Setgroups(s,l) setgroups(s,l)
  202 #define Getgrouplist(u,g,gs,n) getgrouplist(u,g,gs,n)
  203 #define Chdir(p) chdir(p)
  204 #define Chroot(p) chroot(p)
  205 #define Gettimeofday(tv,tz) gettimeofday(tv,tz)
  206 #define Mknod(p,m,d) mknod(p,m,d)
  207 #define Mkfifo(p,m) mkfifo(p,m)
  208 #define Stat(f,b) stat(f,b)
  209 #define Stat64(f,b) stat64(f,b)
  210 #define Fstat(f,b) fstat(f,b)
  211 #define Fstat64(f,b) fstat64(f,b)
  212 #define Lstat(f,b) lstat(f,b)
  213 #define Lstat64(f,b) lstat64(f,b)
  214 #define Dup(o) dup(o)
  215 #define Dup2(o,n) dup2(o,n)
  216 #define Pipe(f) pipe(f)
  217 #define Ftruncate(f,l) ftruncate(f,l)
  218 #define Ftruncate64(f,l) ftruncate64(f,l)
  219 #define Close(f) close(f)
  220 #define Fchown(f,o,g) fchown(f,o,g)
  221 #define Fchmod(f,m) fchmod(f,m)
  222 #define Unlink(p) unlink(p)
  223 #define Symlink(op,np) symlink(op,np)
  224 #define Readlink(p,b,s) readlink(p,b,s)
  225 #define Chown(p,o,g) chown(p,o,g)
  226 #define Chmod(p,m) chmod(p,m)
  227 #define Fork() fork()
  228 #define Signal(s,h) signal(s,h)
  229 #define Sigaction(s,a,o) sigaction(s,a,o)
  230 #define Sigprocmask(h,s,o) sigprocmask(h,s,o)
  231 #define Alarm(s) alarm(s)
  232 #define Kill(p,s) kill(p,s)
  233 #define Link(o,n) link(o,n)
  234 #define Execvp(f,a) execvp(f,a)
  235 #define Socketpair(d,t,p,s) socketpair(d,t,p,s)
  236 #define Socket(d,t,p) socket(d,t,p)
  237 #define Bind(s,m,a) bind(s,m,a)
  238 #define Listen(s,b) listen(s,b)
  239 #define Getsockname(s,n,l) getsockname(s,n,l)
  240 #define Getpeername(s,n,l) getpeername(s,n,l)
  241 #define Getsockopt(s,d,n,v,l) getsockopt(s,d,n,v,l)
  242 #define Setsockopt(s,d,n,v,l) setsockopt(s,d,n,v,l)
  243 #define Shutdown(f,h) shutdown(f,h)
  244 #define Sleep(s) sleep(s)
  245 #define Usleep(u) usleep(u)
  246 #define Nanosleep(req,rem) nanosleep(req,rem)
  247 #define Pause() pause()
  248 #define Gethostbyname(n) gethostbyname(n)
  249 #define Getaddrinfo(n,s,h,r) getaddrinfo(n,s,h,r)
  250 #define Getipnodebyname(n,a,f,e) getipnodebyname(n,a,f,e)
  251 #define Malloc(s) malloc(s)
  252 #define Calloc(n,s) calloc(n,s)
  253 #define Realloc(p,s) realloc(p,s)
  254 #define Tcgetattr(f,t) tcgetattr(f,t)
  255 #define Tcsetattr(f,o,t) tcsetattr(f,o,t)
  256 #define Ttyname(f) ttyname(f)
  257 #define Isatty(f) isatty(f)
  258 #define Openpty(p,t,n,i,f) openpty(p,t,n,i,f)
  259 #define Ptsname(f) ptsname(f)
  260 #define Grantpt(f) grantpt(f)
  261 #define Unlockpt(f) unlockpt(f)
  262 #define Getpgid(p) getpgid(p)
  263 #define Gethostname(n,l) gethostname(n,l)
  264 #define Uname(b) uname(b)
  265 #define Atexit(f) atexit(f)
  266 #define Abort() abort()
  267 #define Mkstemp(t) mkstemp(t)
  268 #define Setenv(n,v,o) setenv(n,v,o)
  269 #define Unsetenv(n) unsetenv(n)
  270 
  271 #define Readline(p) readline(p)
  272 #define Using_history() using_history()
  273 #define Read_history(f) read_history(f)
  274 #define Write_history(f) write_history(f)
  275 #define Append_history(n,f) append_history(n,f)
  276 #define Read_history(f) read_history(f)
  277 #define Add_history(s) add_history(s)
  278 
  279 #endif /* !WITH_SYCLS */
  280 
  281 #endif /* !defined(__sycls_h_included) */