unix/SystemCommands.cpp File Reference
#include <string.h>
#include <sys/wait.h>
#include <stdlib.h>
#include <unistd.h>
#include "RexxCore.h"
#include "StringClass.hpp"
#include "RexxActivity.hpp"
#include "ActivityManager.hpp"
#include "SystemInterpreter.hpp"
#include "InterpreterInstance.hpp"
#include "SysInterpreterInstance.hpp"
#include "RexxInternalApis.h"
#include <sys/types.h>
#include <pwd.h>
#include <limits.h>
Include dependency graph for unix/SystemCommands.cpp:

Go to the source code of this file.

Macros

#define CMDBUFSIZE   1024 /* Max size of executable cmd */
 
#define MAX_COMMAND_ARGS   400
 
#define CMDDEFNAME   "/bin/bash" /* Bourne Again Shell is default */
 
#define UNKNOWN_COMMAND   127 /* unknown command return code */
 
#define SYSENV   "command" /* Default cmd environment */
 
#define SHELL   "SHELL" /* UNIX cmd handler env. var. name*/
 
#define EXPORT_FLAG   1
 
#define SET_FLAG   2
 
#define UNSET_FLAG   3
 
#define MAX_VALUE   1280
 

Functions

bool sys_process_export (RexxExitContext *context, const char *cmd, RexxObjectPtr &rc, int flag)
 
char * unquote (const char *s)
 
bool sys_process_cd (RexxExitContext *context, const char *cmd, RexxObjectPtr rc)
 
bool scan_cmd (const char *parm_cmd, char **argPtr)
 
RexxObjectPtr RexxEntry systemCommandHandler (RexxExitContext *context, RexxStringObject address, RexxStringObject command)
 

Variables

int putflag
 

Macro Definition Documentation

◆ CMDBUFSIZE

#define CMDBUFSIZE   1024 /* Max size of executable cmd */

Definition at line 73 of file unix/SystemCommands.cpp.

◆ CMDDEFNAME

#define CMDDEFNAME   "/bin/bash" /* Bourne Again Shell is default */

Definition at line 81 of file unix/SystemCommands.cpp.

◆ EXPORT_FLAG

#define EXPORT_FLAG   1

Definition at line 88 of file unix/SystemCommands.cpp.

◆ MAX_COMMAND_ARGS

#define MAX_COMMAND_ARGS   400

Definition at line 74 of file unix/SystemCommands.cpp.

◆ MAX_VALUE

#define MAX_VALUE   1280

Definition at line 91 of file unix/SystemCommands.cpp.

◆ SET_FLAG

#define SET_FLAG   2

Definition at line 89 of file unix/SystemCommands.cpp.

◆ SHELL

#define SHELL   "SHELL" /* UNIX cmd handler env. var. name*/

Definition at line 87 of file unix/SystemCommands.cpp.

◆ SYSENV

#define SYSENV   "command" /* Default cmd environment */

Definition at line 86 of file unix/SystemCommands.cpp.

◆ UNKNOWN_COMMAND

#define UNKNOWN_COMMAND   127 /* unknown command return code */

Definition at line 84 of file unix/SystemCommands.cpp.

◆ UNSET_FLAG

#define UNSET_FLAG   3

Definition at line 90 of file unix/SystemCommands.cpp.

Function Documentation

◆ scan_cmd()

bool scan_cmd ( const char *  parm_cmd,
char **  argPtr 
)

Definition at line 533 of file unix/SystemCommands.cpp.

References MAX_COMMAND_ARGS.

Referenced by systemCommandHandler().

◆ sys_process_cd()

bool sys_process_cd ( RexxExitContext context,
const char *  cmd,
RexxObjectPtr  rc 
)

Definition at line 400 of file unix/SystemCommands.cpp.

References unquote().

Referenced by systemCommandHandler().

◆ sys_process_export()

bool sys_process_export ( RexxExitContext context,
const char *  cmd,
RexxObjectPtr rc,
int  flag 
)

Definition at line 107 of file unix/SystemCommands.cpp.

References EXPORT_FLAG, getEnvironment(), MAX_VALUE, putflag, SET_FLAG, and UNSET_FLAG.

Referenced by systemCommandHandler().

◆ systemCommandHandler()

◆ unquote()

char* unquote ( const char *  s)

Definition at line 361 of file unix/SystemCommands.cpp.

Referenced by sys_process_cd().

Variable Documentation

◆ putflag

int putflag
extern