File: os_shell.h

package info (click to toggle)
gambc 4.2.8-1.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, squeeze, wheezy
  • size: 54,404 kB
  • ctags: 10,660
  • sloc: ansic: 661,388; lisp: 143,554; sh: 3,531; makefile: 3,320; cpp: 2,143; perl: 1,730; sed: 498; java: 265
file content (116 lines) | stat: -rw-r--r-- 2,486 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
/* File: "os_shell.h", Time-stamp: <2007-12-19 11:17:57 feeley> */

/* Copyright (c) 1994-2007 by Marc Feeley, All Rights Reserved. */

#ifndef ___OS_SHELL_H
#define ___OS_SHELL_H

#include "os.h"


/*---------------------------------------------------------------------------*/


typedef struct ___shell_module_struct
  {
    ___BOOL setup;

#ifdef USE_environ

    int environ_unused_at_end;
    ___BOOL environ_was_extended;

#define ___SHELL_MODULE_INIT , 0, 0

#endif
  } ___shell_module;


extern ___shell_module ___shell_mod;


/*---------------------------------------------------------------------------*/

/* Access to shell environment variables. */


#ifdef USE_POSIX
#define ENV_CHAR_BYTES 1
#endif

#ifdef USE_WIN32
#ifdef _UNICODE
#define ___GETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
#define ___SETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
#define ___ENVIRON_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) ucs2
#define ENV_CHAR_BYTES 2
#else
#define ___GETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
#define ___SETENV_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
#define ___ENVIRON_CE_SELECT(latin1,utf8,ucs2,ucs4,wchar,native) native
#define ENV_CHAR_BYTES 1
#endif
#endif


/********************************** obsolete.... use ___getenv_UCS_2 */
char *___getenv
   ___P((char *name),
        ());

extern ___SCMOBJ ___getenv_UCS_2
   ___P((___UCS_2STRING name,
         ___UCS_2STRING *value),
        ());

extern ___SCMOBJ ___setenv_UCS_2
   ___P((___UCS_2STRING name,
         ___UCS_2STRING value),
        ());

extern ___SCMOBJ ___unsetenv_UCS_2
   ___P((___UCS_2STRING name),
        ());

extern ___SCMOBJ ___os_getenv
   ___P((___SCMOBJ name),
        ());

extern ___SCMOBJ ___os_setenv
   ___P((___SCMOBJ name,
         ___SCMOBJ value),
        ());

extern ___SCMOBJ ___os_environ ___PVOID;


/*---------------------------------------------------------------------------*/

/* Shell command. */


/* Max length of a shell command, not including null. */

#define ___CMD_MAX_LENGTH 1024


extern ___SCMOBJ ___os_shell_command
   ___P((___SCMOBJ cmd,
         ___SCMOBJ dir),
        ());


/*---------------------------------------------------------------------------*/

/* Shell module initialization/finalization. */


extern ___SCMOBJ ___setup_shell_module ___PVOID;

extern void ___cleanup_shell_module ___PVOID;


/*---------------------------------------------------------------------------*/


#endif