"Fossies" - the Fresh Open Source Software Archive

Member "links-1.03/os_dep.h" (22 Nov 2011, 4989 Bytes) of archive /linux/www/links-1.03.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 "os_dep.h" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.8_vs_1.03.

    1 #define SYS_UNIX    1
    2 #define SYS_OS2     2
    3 #define SYS_WIN_32  3
    4 #define SYS_BEOS    4
    5 #define SYS_RISCOS  5
    6 #define SYS_ATHEOS  6
    7 #define SYS_SPAD    7
    8 #define SYS_INTERIX 8
    9 
   10 /* hardcoded limit of 10 OSes in default.c */
   11 
   12 #if defined(__EMX__)
   13 #define OS2
   14 #elif defined(_WIN32) || defined(__CYGWIN__)
   15 #define WIN32
   16 #elif defined(__INTERIX)
   17 #define INTERIX
   18 #elif defined(__BEOS__) || defined(__HAIKU__)
   19 #define BEOS
   20 #elif defined(__riscos__)
   21 #define RISCOS
   22 #elif defined(__ATHEOS__) || defined(__SYLLABLE__)
   23 #define ATHEOS
   24 #elif defined(__SPAD__)
   25 #define SPAD
   26 #else
   27 #define UNIX
   28 #endif
   29 
   30 #if defined(OS2) || defined(WIN32) || defined(INTERIX) || defined(BEOS) || defined(RISCOS) || defined(SPAD)
   31 #ifdef UNIX
   32 #undef UNIX
   33 #endif
   34 #endif
   35 
   36 #if defined(UNIX)
   37 
   38 static inline int dir_sep(char x) { return x == '/'; }
   39 #define NEWLINE "\n"
   40 #define FS_UNIX_RIGHTS
   41 #define FS_UNIX_HARDLINKS
   42 #define FS_UNIX_SOFTLINKS
   43 #define FS_UNIX_USERS
   44 #define SYSTEM_ID SYS_UNIX
   45 #define SYSTEM_NAME "Unix"
   46 #define DEFAULT_SHELL "/bin/sh"
   47 #define GETSHELL getenv("SHELL")
   48 #define SHARED_CONFIG_DIR "/etc/"
   49 #ifdef HAVE_SYS_UN_H
   50 #define USE_AF_UNIX
   51 #else
   52 #define DONT_USE_AF_UNIX
   53 #endif
   54 #define ASSOC_BLOCK
   55 #define ASSOC_CONS_XWIN
   56 
   57 #elif defined(OS2)
   58 
   59 static inline int dir_sep(char x) { return x == '/' || x == '\\'; }
   60 #define NEWLINE "\r\n"
   61 /*#define NO_ASYNC_LOOKUP*/
   62 #define SYSTEM_ID SYS_OS2
   63 #define SYSTEM_NAME "OS/2"
   64 #define DEFAULT_SHELL "cmd.exe"
   65 #define GETSHELL getenv("COMSPEC")
   66 #define NO_FG_EXEC
   67 #define NO_CTRL_Z
   68 #define DOS_FS
   69 #define NO_FILE_SECURITY
   70 #define NO_FORK_ON_EXIT
   71 #define ASSOC_CONS_XWIN
   72 #define DISABLE_SMB
   73 
   74 #elif defined(WIN32)
   75 
   76 static inline int dir_sep(char x) { return x == '/' || x == '\\'; }
   77 #define NEWLINE "\r\n"
   78 /*#define NO_ASYNC_LOOKUP*/
   79 #define SYSTEM_ID SYS_WIN_32
   80 #define SYSTEM_NAME "Win32"
   81 #define DEFAULT_SHELL "cmd.exe"
   82 #define GETSHELL getenv("COMSPEC")
   83 #define NO_FG_EXEC
   84 #define NO_CTRL_Z
   85 #define DOS_FS
   86 #define SET_WINDOW_TITLE_UTF_8
   87 #define ASSOC_CONS_XWIN
   88 #define OS_BAD_SIGNALS
   89 #ifndef HAVE_PTHREADS
   90   #define HAVE_PTHREADS
   91 #endif
   92 
   93 #elif defined(INTERIX)
   94 
   95 static inline int dir_sep(char x) { return x == '/'; }
   96 #define NEWLINE "\n"
   97 #define FS_UNIX_RIGHTS
   98 #define FS_UNIX_HARDLINKS
   99 #define FS_UNIX_SOFTLINKS
  100 #define FS_UNIX_USERS
  101 #define SYSTEM_ID SYS_INTERIX
  102 #define SYSTEM_NAME "Interix"
  103 #define DEFAULT_SHELL "/bin/sh"
  104 #define GETSHELL getenv("SHELL")
  105 #define SHARED_CONFIG_DIR "/etc/"
  106 #ifdef HAVE_SYS_UN_H
  107 #define USE_AF_UNIX
  108 #else
  109 #define DONT_USE_AF_UNIX
  110 #endif
  111 #define ASSOC_BLOCK
  112 #define ASSOC_CONS_XWIN
  113 
  114 #elif defined(BEOS)
  115 
  116 static inline int dir_sep(char x) { return x == '/'; }
  117 #define NEWLINE "\n"
  118 #define NO_ASYNC_LOOKUP /* async lookup works on BeOS but crashes the Haiku kernel */
  119 #define FS_UNIX_RIGHTS
  120 #define FS_UNIX_SOFTLINKS
  121 #define FS_UNIX_USERS
  122 #define SYSTEM_ID SYS_BEOS
  123 #define SYSTEM_NAME "BeOS"
  124 #define DEFAULT_SHELL "/bin/sh"
  125 #define GETSHELL getenv("SHELL")
  126 #define NO_CTRL_Z
  127 #define SHARED_CONFIG_DIR "/etc/"
  128 #define NO_FORK_ON_EXIT
  129 #define ASSOC_BLOCK
  130 
  131 #include <sys/time.h>
  132 #include <sys/types.h>
  133 #ifdef HAVE_NET_SOCKET_H
  134 #include <net/socket.h>
  135 #endif
  136 #include <sys/socket.h>
  137 
  138 int be_socket(int, int, int);
  139 int be_connect(int, struct sockaddr *, int);
  140 int be_getpeername(int, struct sockaddr *, int *);
  141 int be_getsockname(int, struct sockaddr *, int *);
  142 int be_listen(int, int);
  143 int be_accept(int, struct sockaddr *, int *);
  144 int be_bind(int, struct sockaddr *, int);
  145 int be_pipe(int *);
  146 int be_read(int, void *, int);
  147 int be_write(int, void *, int);
  148 int be_close(int);
  149 int be_select(int, struct fd_set *, struct fd_set *, struct fd_set *, struct timeval *);
  150 int be_getsockopt(int, int, int, void *, int *);
  151 
  152 #elif defined(RISCOS)
  153 
  154 static inline int dir_sep(char x) { return x == '/' || x == '\\'; }
  155 #define NEWLINE        "\n"
  156 #define SYSTEM_ID SYS_RISCOS
  157 #define SYSTEM_NAME "RISC OS"
  158 #define DEFAULT_SHELL "gos"
  159 #define GETSHELL getenv("SHELL")
  160 #define NO_FG_EXEC
  161 #define NO_FILE_SECURITY
  162 #define NO_FORK_ON_EXIT
  163 
  164 #elif defined(ATHEOS)
  165 
  166 static inline int dir_sep(char x) { return x == '/'; }
  167 #define NEWLINE "\n"
  168 #define FS_UNIX_RIGHTS
  169 #define FS_UNIX_HARDLINKS
  170 #define FS_UNIX_SOFTLINKS
  171 #define FS_UNIX_USERS
  172 #define SYSTEM_ID SYS_ATHEOS
  173 #define SYSTEM_NAME "Atheos"
  174 #define DEFAULT_SHELL "/bin/sh"
  175 #define GETSHELL getenv("SHELL")
  176 #define SHARED_CONFIG_DIR "/etc/"
  177 #define ASSOC_BLOCK
  178 
  179 #elif defined(SPAD)
  180 
  181 static inline int dir_sep(char x) { return x == '/'; }
  182 #define NEWLINE "\n"
  183 #define SYSTEM_ID SYS_SPAD
  184 #define SYSTEM_NAME "Spad"
  185 #define DEFAULT_SHELL "LIB.:/SHELL.EXE"
  186 #define GETSHELL "LIB.:/SHELL.EXE"
  187 #define NO_CTRL_Z
  188 #define SHARED_CONFIG_DIR "ETC.:/"
  189 #ifdef HAVE_SYS_UN_H
  190 #define USE_AF_UNIX
  191 #else
  192 #define DONT_USE_AF_UNIX
  193 #endif
  194 #define ASSOC_BLOCK
  195 #define ASSOC_CONS_XWIN
  196 #define NO_FORK_ON_EXIT
  197 
  198 #endif
  199 
  200 #ifdef FS_UNIX_USERS
  201 #if !defined(HAVE_GETPWUID) || !defined(HAVE_GETGRGID)
  202 #undef FS_UNIX_USERS
  203 #endif
  204 #endif
  205 
  206 #if !defined(HAVE_BEGINTHREAD) && !defined(BEOS) && !defined(HAVE_PTHREADS)
  207 #define THREAD_SAFE_LOOKUP
  208 #endif
  209