50 #define SYSINITIALADDRESS "ksh"
51 #elif defined(OPSYS_SUN)
52 #define SYSINITIALADDRESS "sh"
54 #define SYSINITIALADDRESS "bash"
57 int main (
int argc,
char **argv) {
60 const char *program_name = NULL;
61 char arg_buffer[8192];
67 bool from_string =
false;
68 bool real_argument =
true;
78 for (i = 1; i < argc; i++) {
80 if (program_name == NULL && (*(cp=*(argv+i)) ==
'-')) {
87 program_name =
"INSTORE";
88 instore[0].
strptr = argv[i+1];
89 instore[0].
strlength = strlen(instore[0].strptr);
92 real_argument =
false;
97 fprintf(stdout,
"%s", ptr);
98 fprintf(stdout,
"\n");
106 if (program_name == NULL) {
107 program_name = argv[i];
108 }
else if (real_argument) {
109 if (arg_buffer[0] !=
'\0')
110 strcat(arg_buffer,
" ");
111 strcat(arg_buffer, argv[i]);
114 real_argument =
true;
118 if (program_name == NULL) {
120 fprintf(stderr,
"\n");
121 fprintf(stderr,
"Syntax is \"rexx filename [arguments]\"\n");
122 fprintf(stderr,
"or \"rexx -e program_string [arguments]\"\n");
123 fprintf(stderr,
"or \"rexx -v\".\n");
127 argCount = (argCount==0) ? 0 : 1;
147 rxargs = pgmThrdInst->NewArray(1);
148 pgmThrdInst->ArrayPut(rxargs,
149 pgmThrdInst->NewStringFromAsciiz(arg_buffer), 1);
151 rxargs = pgmThrdInst->NewArray(0);
157 rxcargs = pgmThrdInst->NewArray(argc - 2);
161 rxcargs = pgmThrdInst->NewArray(0);
163 for (i = 2; i < argc; i++) {
164 pgmThrdInst->ArrayPut(rxcargs,
165 pgmThrdInst->NewStringFromAsciiz(argv[i]),
168 pgmThrdInst->DirectoryPut(dir, rxcargs,
"SYSCARGS");
170 result = pgmThrdInst->CallProgram(program_name, rxargs);
173 rc = pgmThrdInst->DisplayCondition();
175 pgmInst->Terminate();
178 if (result != NULL) {
179 pgmThrdInst->ObjectToInt32(result, &rc);
182 pgmInst->Terminate();
186 return rc ? rc : rexxrc;
char *REXXENTRY RexxGetVersionInformation()
int REXXENTRY RexxStart(size_t argcount, PCONSTRXSTRING arglist, const char *programname, PRXSTRING instore, const char *envname, int calltype, PRXSYSEXIT exits, short *retcode, PRXSTRING result)
RexxReturnCode RexxEntry RexxCreateInterpreter(RexxInstance **instance, RexxThreadContext **context, RexxOption *options)
RexxReturnCode REXXENTRY RexxFreeMemory(void *)
struct _RexxArrayObject * RexxArrayObject
struct _RexxObjectPtr * RexxObjectPtr
#define MAKERXSTRING(r, p, l)
struct _RexxDirectoryObject * RexxDirectoryObject
int main(int argc, char **argv)
#define SYSINITIALADDRESS