Fix iOS 5.0 issue (file descriptors for regular files can't be put in nonblocking...
[gambit-c.git] / lib / os_shell.h
blobf5f28dc5ff2e19df8d6d077e7f9aa89b542ecdfe
1 /* File: "os_shell.h", Time-stamp: <2009-03-14 09:15:04 feeley> */
3 /* Copyright (c) 1994-2009 by Marc Feeley, All Rights Reserved. */
5 #ifndef ___OS_SHELL_H
6 #define ___OS_SHELL_H
8 #include "os.h"
11 /*---------------------------------------------------------------------------*/
14 typedef struct ___shell_module_struct
16 ___BOOL setup;
18 #ifdef USE_environ
20 int environ_unused_at_end;
21 ___BOOL environ_was_extended;
23 #define ___SHELL_MODULE_INIT , 0, 0
25 #endif
26 } ___shell_module;
29 extern ___shell_module ___shell_mod;
32 /*---------------------------------------------------------------------------*/
34 /* Access to shell environment variables. */
37 #ifdef USE_WIN32
38 #ifdef _UNICODE
39 #define ___GETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
40 #define ___SETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
41 #define ___ENVIRON_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
42 #define ENV_CHAR_BYTES 2
43 #else
44 #define ___GETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
45 #define ___SETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
46 #define ___ENVIRON_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
47 #define ENV_CHAR_BYTES 1
48 #endif
49 #endif
51 #ifndef ENV_CHAR_BYTES
52 #define ENV_CHAR_BYTES 1
53 #endif
56 /********************************** obsolete.... use ___getenv_UCS_2 */
57 char *___getenv
58 ___P((char *name),
59 ());
61 extern ___SCMOBJ ___getenv_UCS_2
62 ___P((___UCS_2STRING name,
63 ___UCS_2STRING *value),
64 ());
66 extern ___SCMOBJ ___setenv_UCS_2
67 ___P((___UCS_2STRING name,
68 ___UCS_2STRING value),
69 ());
71 extern ___SCMOBJ ___unsetenv_UCS_2
72 ___P((___UCS_2STRING name),
73 ());
75 extern ___SCMOBJ ___os_getenv
76 ___P((___SCMOBJ name),
77 ());
79 extern ___SCMOBJ ___os_setenv
80 ___P((___SCMOBJ name,
81 ___SCMOBJ value),
82 ());
84 extern ___SCMOBJ ___os_environ ___PVOID;
87 /*---------------------------------------------------------------------------*/
89 /* Shell command. */
92 /* Max length of a shell command, not including null. */
94 #define ___CMD_MAX_LENGTH 1024
97 extern ___SCMOBJ ___os_shell_command
98 ___P((___SCMOBJ cmd,
99 ___SCMOBJ dir),
100 ());
103 /*---------------------------------------------------------------------------*/
105 /* Shell module initialization/finalization. */
108 extern ___SCMOBJ ___setup_shell_module ___PVOID;
110 extern void ___cleanup_shell_module ___PVOID;
113 /*---------------------------------------------------------------------------*/
116 #endif