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*(32 + sizeof(void *))
59 // official settings are not enough to execute RosetaCode ackermann-function-1.rexx
60 // multiply by 2: not enough!
61 // multiply by 4
62 #define TOTAL_STACK_SIZE 1024*512*4
63 #define C_STACK_SIZE TOTAL_STACK_SIZE
64 
65 // No definition needed on Linux systems.
66 #define SysCall
67 
68 #ifdef HAVE_CONFIG_H
69 #include <config.h>
70 #endif
71 
72 
73 #ifdef LINUX
74 #define FNONBLOCK O_NONBLOCK
75 #endif
76 
77 
78 #define RXTRACE_SUPPORT
79 
80 /******************************************************************************/
81 /* OPTIONAL: Perform stack checking on new message invocations. If this type*/
82 /* of information is not available, then do not include this define */
83 /******************************************************************************/
84 
85 #define STACKCHECK
86 
87 /******************************************************************************/
88 /* OPTIONAL: No time slicing support for REXX activation yields is available.*/
89 /* Code will yield after a given count of instructions. */
90 /* This option is mutually exclusive with TIMESLICE. */
91 /******************************************************************************/
92 
93 #define NOTIMER
94 
95 /******************************************************************************/
96 /* OPTIONAL: Enable concurrency timeslice dispatching support. Default is */
97 /* only yield at specific event points. */
98 /******************************************************************************/
99 
100 /* #define TIMESLICE */
101 
102 /******************************************************************************/
103 /* OPTIONAL: If the implementation enables external scripting support, then */
104 /* additional hand-shaking with an the exernal environment is enabled for */
105 /* providing default values for uninitialized variables. */
106 /******************************************************************************/
107 //#define SCRIPTING
108 
109 /******************************************************************************/
110 /* REQUIRED: Define the REXX type for semaphores. These can be system */
111 /* specific semaphore types or the REXX define OSEM. */
112 /******************************************************************************/
113 
114 #define _POSIX_THREADS_
115 
116 /******************************************************************************/
117 /* REQUIRED: Define the string used for the default initial address setting. */
118 /******************************************************************************/
119 
120 #if defined(AIX)
121 #define SYSINITIALADDRESS "ksh"
122 #elif defined(OPSYS_SUN)
123 #define SYSINITIALADDRESS "sh"
124 #else
125 #define SYSINITIALADDRESS "bash"
126 #endif
127 
128 
129 #ifdef __APPLE__
130 # include <crt_externs.h>
131 inline char **getEnvironment()
132 {
133  return (*_NSGetEnviron());
134 }
135 #else
136 inline char **getEnvironment()
137 {
138  extern char **environ;
139  return environ;
140 }
141 #endif
142 
143 /******************************************************************************/
144 /* REQUIRED: Define the name of the image file that is saved and restored. */
145 /******************************************************************************/
146 
147 #define BASEIMAGE "rexx.img"
148 
149 /******************************************************************************/
150 /* REQUIRED: Define the name of the program called to load create the saved */
151 /* image file. */
152 /******************************************************************************/
153 
154 #define BASEIMAGELOAD "CoreClasses.orx" /* MHES 29122004 */
155 
156 /******************************************************************************/
157 /* REQUIRED: Name of the file used to store the external message repository */
158 /******************************************************************************/
159 #define REXXMESSAGEFILE "rexx.cat"
160 
161 /******************************************************************************/
162 /* REQUIRED: define the path delimiter and end of line information */
163 /* appropriate for this file system. */
164 /******************************************************************************/
165 
166 #define delimiter '/'
167 #define line_end "\n"
168 #define line_end_size 1
169 
170 /******************************************************************************/
171 /* OPTIONAL: Finally, any other global defined constants for system specific */
172 /* code usage. */
173 /******************************************************************************/
174 
175 #define DEFRXSTRING 256 /* Default RXSTRING return size */
176 
177 #ifdef __cplusplus
178 extern "C" {
179 #endif
180 
181 #define REXXTIMESLICE 100 /* 100 milliseconds (1/10 second) */
182 
183 #include "APIDefinitions.h"
184 
185 #ifdef __cplusplus
186 }
187 #endif
188 
189 /*
190  * OPTIONAL: For EBCDIC systems.
191  */
192 #if defined(__MVS__)
193  #define EBCDIC
194 #endif
195 
196 #endif
char ** getEnvironment()