60 int __cdecl
main(
int argc,
char *argv[]);
68 int __cdecl
main(
int argc,
char *argv[]) {
72 const char *program_name;
73 char arg_buffer[8192];
78 BOOL from_string = FALSE;
79 BOOL real_argument = TRUE;
101 for (i = 1; i < argc; i++)
104 if ((*(cp=*(argv+i)) ==
'-' || *cp ==
'/')) {
108 if (from_string == FALSE) {
113 program_name =
"INSTORE";
114 instore[0].
strptr = argv[i+1];
115 instore[0].
strlength = strlen(instore[0].strptr);
118 real_argument = FALSE;
126 fprintf(stdout, ptr);
127 fprintf(stdout,
"\n");
138 if (program_name == NULL) {
139 program_name = argv[i];
142 else if ( real_argument ) {
143 if (arg_buffer[0] !=
'\0') {
144 strcat(arg_buffer,
" ");
146 strcat(arg_buffer, argv[i]);
148 real_argument = TRUE;
152 if (program_name == NULL) {
156 fprintf(stderr,
"Syntax is \"rexx filename [arguments]\"\n");
157 fprintf(stderr,
"or \"rexx -e program_string [arguments]\"\n");
158 fprintf(stderr,
"or \"rexx -v\".\n");
162 getArguments(NULL, GetCommandLine(), &argcount, &arguments);
166 printf(
"program_name = %s\n", program_name);
167 printf(
"argv 0 = %s\n", argv[0]);
168 printf(
"argv 1 = %s\n", argv[1]);
169 printf(
"argv 2 = %s\n", argv[2]);
170 printf(
"argument.strptr = %s\n", argument.strptr);
171 printf(
"argument.strlenth = %lu\n", argument.strlength);
189 if ((rc==0) && rxretbuf.
strptr) {
198 if ( arguments.
strptr != NULL )
200 rxargs = pgmThrdInst->NewArray(1);
201 pgmThrdInst->ArrayPut(rxargs, pgmThrdInst->String(arguments.
strptr), 1);
205 rxargs = pgmThrdInst->NewArray(0);
212 rxcargs = pgmThrdInst->NewArray(argc - 2);
216 rxcargs = pgmThrdInst->NewArray(0);
218 for (i = 2; i < argc; i++)
220 pgmThrdInst->ArrayPut(rxcargs,
221 pgmThrdInst->NewStringFromAsciiz(argv[i]),
224 pgmThrdInst->DirectoryPut(dir, rxcargs,
"SYSCARGS");
226 result = pgmThrdInst->CallProgram(program_name, rxargs);
231 rc = (int)pgmThrdInst->DisplayCondition();
234 pgmInst->Terminate();
238 if (result != NULL) {
239 pgmThrdInst->ObjectToInt32(result, &rc);
242 pgmInst->Terminate();
247 return rc ? rc : rexxrc;
PCONSTRXSTRING getArguments(const char **program, const char *argptr, size_t *count, PCONSTRXSTRING retarr)
void freeArguments(const char *program, PCONSTRXSTRING arguments)
char *REXXENTRY RexxGetVersionInformation()
RexxReturnCode RexxEntry RexxCreateInterpreter(RexxInstance **instance, RexxThreadContext **context, RexxOption *options)
RexxReturnCode REXXENTRY RexxFreeMemory(void *)
struct _RexxArrayObject * RexxArrayObject
struct _RexxObjectPtr * RexxObjectPtr
struct _RexxDirectoryObject * RexxDirectoryObject
int __cdecl main(int argc, char *argv[])
LONG REXXENTRY MY_IOEXIT(LONG ExitNumber, LONG Subfunction, PEXIT ParmBlock)