unix/PlatformDefinitions.h
Go to the documentation of this file.
1 /*----------------------------------------------------------------------------*/
2 /* */
3 /* Copyright (c) 1995, 2004 IBM Corporation. All rights reserved. */
4 /* Copyright (c) 2005-2009 Rexx Language Association. All rights reserved. */
5 /* */
6 /* This program and the accompanying materials are made available under */
7 /* the terms of the Common Public License v1.0 which accompanies this */
8 /* distribution. A copy is also available at the following address: */
9 /* http://www.oorexx.org/license.html */
10 /* */
11 /* Redistribution and use in source and binary forms, with or */
12 /* without modification, are permitted provided that the following */
13 /* conditions are met: */
14 /* */
15 /* Redistributions of source code must retain the above copyright */
16 /* notice, this list of conditions and the following disclaimer. */
17 /* Redistributions in binary form must reproduce the above copyright */
18 /* notice, this list of conditions and the following disclaimer in */
19 /* the documentation and/or other materials provided with the distribution. */
20 /* */
21 /* Neither the name of Rexx Language Association nor the names */
22 /* of its contributors may be used to endorse or promote products */
23 /* derived from this software without specific prior written permission. */
24 /* */
25 /* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS */
26 /* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT */
27 /* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS */
28 /* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT */
29 /* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, */
30 /* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED */
31 /* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, */
32 /* OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY */
33 /* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING */
34 /* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS */
35 /* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
36 /* */
37 /*----------------------------------------------------------------------------*/
38 /******************************************************************************/
39 /* REXX AIX/Linux Support aixrexx.h */
40 /* */
41 /* AIX/Linux master definition file */
42 /* */
43 /******************************************************************************/
44 /******************************************************************************/
45 /* Template for system specific declarations for Object REXX. The following */
46 /* sections are a series of required and optional sections where system */
47 /* specific information is provided to the rest of the interpreter code. */
48 /* Wherever possible, reasonable defaults are provided for these settings. */
49 /******************************************************************************/
50 
51 #ifndef AIXREXX_H /* provide a define here to protect */
52 #define AIXREXX_H /* against multiple includes */
53 
54 /******************************************************************************/
55 /* REQUIRED: The implemenation must decide on the C_STACK_SIZE defining */
56 /* constants that are compiler/linker dependent. */
57 /******************************************************************************/
58 #define MIN_C_STACK 1024*16
59 #define TOTAL_STACK_SIZE 1024*512
60 #define C_STACK_SIZE TOTAL_STACK_SIZE
61 
62 // No definition needed on Linux systems.
63 #define SysCall
64 
65 #ifdef HAVE_CONFIG_H
66 #include <config.h>
67 #endif
68 
69 
70 #ifdef LINUX
71 #define FNONBLOCK O_NONBLOCK
72 #endif
73 
74 
75 #define RXTRACE_SUPPORT
76 
77 /******************************************************************************/
78 /* OPTIONAL: Perform stack checking on new message invocations. If this type*/
79 /* of information is not available, then do not include this define */
80 /******************************************************************************/
81 
82 #define STACKCHECK
83 
84 /******************************************************************************/
85 /* OPTIONAL: No time slicing support for REXX activation yields is available.*/
86 /* Code will yield after a given count of instructions. */
87 /* This option is mutually exclusive with TIMESLICE. */
88 /******************************************************************************/
89 
90 #define NOTIMER
91 
92 /******************************************************************************/
93 /* OPTIONAL: Enable concurrency timeslice dispatching support. Default is */
94 /* only yield at specific event points. */
95 /******************************************************************************/
96 
97 /* #define TIMESLICE */
98 
99 /******************************************************************************/
100 /* OPTIONAL: If the implementation enables external scripting support, then */
101 /* additional hand-shaking with an the exernal environment is enabled for */
102 /* providing default values for uninitialized variables. */
103 /******************************************************************************/
104 //#define SCRIPTING
105 
106 /******************************************************************************/
107 /* REQUIRED: Define the REXX type for semaphores. These can be system */
108 /* specific semaphore types or the REXX define OSEM. */
109 /******************************************************************************/
110 
111 #define _POSIX_THREADS_
112 
113 /******************************************************************************/
114 /* REQUIRED: Define the string used for the default initial address setting. */
115 /******************************************************************************/
116 
117 #if defined(AIX)
118 #define SYSINITIALADDRESS "ksh"
119 #elif defined(OPSYS_SUN)
120 #define SYSINITIALADDRESS "sh"
121 #else
122 #define SYSINITIALADDRESS "bash"
123 #endif
124 
125 
126 #ifdef __APPLE__
127 # include <crt_externs.h>
128 inline char **getEnvironment()
129 {
130  return (*_NSGetEnviron());
131 }
132 #else
133 inline char **getEnvironment()
134 {
135  extern char **environ;
136  return environ;
137 }
138 #endif
139 
140 /******************************************************************************/
141 /* REQUIRED: Define the name of the image file that is saved and restored. */
142 /******************************************************************************/
143 
144 #define BASEIMAGE "rexx.img"
145 
146 /******************************************************************************/
147 /* REQUIRED: Define the name of the program called to load create the saved */
148 /* image file. */
149 /******************************************************************************/
150 
151 #define BASEIMAGELOAD "CoreClasses.orx" /* MHES 29122004 */
152 
153 /******************************************************************************/
154 /* REQUIRED: Name of the file used to store the external message repository */
155 /******************************************************************************/
156 #define REXXMESSAGEFILE "rexx.cat"
157 
158 /******************************************************************************/
159 /* REQUIRED: define the path delimiter and end of line information */
160 /* appropriate for this file system. */
161 /******************************************************************************/
162 
163 #define delimiter '/'
164 #define line_end "\n"
165 #define line_end_size 1
166 
167 /******************************************************************************/
168 /* OPTIONAL: Finally, any other global defined constants for system specific */
169 /* code usage. */
170 /******************************************************************************/
171 
172 #define DEFRXSTRING 256 /* Default RXSTRING return size */
173 
174 #ifdef __cplusplus
175 extern "C" {
176 #endif
177 
178 #define REXXTIMESLICE 100 /* 100 milliseconds (1/10 second) */
179 
180 #include "APIDefinitions.h"
181 
182 #ifdef __cplusplus
183 }
184 #endif
185 
186 /*
187  * OPTIONAL: For EBCDIC systems.
188  */
189 #if defined(__MVS__)
190  #define EBCDIC
191 #endif
192 
193 #endif
char ** getEnvironment()