#include "oorexxapi.h"
#include <memory.h>
#include <fcntl.h>
#include <ctype.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <limits.h>
#include <shlwapi.h>
#include <math.h>
#include <algorithm>
Go to the source code of this file.
Classes | |
struct | _GetFileData |
struct | RxTreeData |
struct | RxStemData |
Macros | |
#define | OM_WAKEUP (WM_USER+10) |
#define | MAX_LABEL 13 /* max label length (sdrvinfo)*/ |
#define | MAX_DIGITS 9 /* max digits in numeric arg */ |
#define | MAX 264 /* temporary buffer length */ |
#define | IBUF_LEN 4096 /* Input buffer length */ |
#define | MAX_READ 0x10000 /* full segment of buffer */ |
#define | CH_EOF 0x1A /* end of file marker */ |
#define | CH_CR '\r' /* carriage return character */ |
#define | CH_NL '\n' /* new line character */ |
#define | AllocFlag PAG_COMMIT | PAG_WRITE /* for DosAllocMem */ |
#define | RNDFACTOR 1664525L |
#define | MAX_ENVVAR 1024 |
#define | MAX_LINE_LEN 4096 /* max line length */ |
#define | MAX_CREATEPROCESS_CMDLINE (32 * 1024) |
#define | USED 0 |
#define | FREE 1 |
#define | CDROM 2 |
#define | REMOTE 3 |
#define | LOCAL 4 |
#define | RAMDISK 5 |
#define | REMOVABLE 6 |
#define | RECURSE 0x0002 |
#define | DO_DIRS 0x0004 |
#define | DO_FILES 0x0008 |
#define | NAME_ONLY 0x0010 |
#define | EDITABLE_TIME 0x0020 |
#define | LONG_TIME 0x0040 /* long time format for SysFileTree */ |
#define | CASELESS 0x0080 |
#define | RXIGNORE 2 /* Ignore attributes entirely */ |
#define | AllAtts |
#define | AllFiles |
#define | AllDirs |
#define | SORT_CASESENSITIVE 0 |
#define | SORT_CASEIGNORE 1 |
#define | SORT_ASCENDING 0 |
#define | SORT_DECENDING 1 |
#define | WC_ERR_INVALID_CHARS 0x00000080 |
#define | FNAMESPEC_BUF_EXTRA 8 |
#define | FNAMESPEC_BUF_LEN MAX_PATH + FNAMESPEC_BUF_EXTRA |
#define | FOUNDFILE_BUF_LEN MAX_PATH |
#define | FILETIME_BUF_LEN 64 |
#define | FILEATTR_BUF_LEN 16 |
#define | FOUNDFILELINE_BUF_LEN FOUNDFILE_BUF_LEN + FILETIME_BUF_LEN + FILEATTR_BUF_LEN |
#define | NO_UTIL_ERROR "0" /* No error whatsoever */ |
#define | ERROR_NOMEM "2" /* Insufficient memory */ |
#define | ERROR_FILEOPEN "3" /* Error opening text file */ |
#define | ERROR_RETSTR "ERROR:" |
#define | INVALID_ROUTINE 40 /* Raise Rexx error */ |
#define | VALID_ROUTINE 0 /* Successful completion */ |
#define | BUILDRXSTRING(t, s) |
#define | RETVAL(retc) |
#define | STATUS_SUCCESS (0x00000000) |
Typedefs | |
typedef struct _GetFileData | GetFileData |
typedef struct RxTreeData | RXTREEDATA |
typedef struct RxStemData | RXSTEMDATA |
typedef BOOL(WINAPI * | P_GDFSE) (LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER) |
Functions | |
VOID CALLBACK | SleepTimerProc (HWND, UINT, UINT, DWORD) |
void | outOfMemoryException (RexxThreadContext *c) |
void | nullStringException (RexxThreadContext *c, CSTRING fName, size_t pos) |
void | safeLocalFree (void *p) |
static void | systemServiceExceptionCode (RexxThreadContext *c, CSTRING api, uint32_t rc) |
static bool | isWindowsVersion (DWORD major, DWORD minor, unsigned int sp, unsigned int type, unsigned int condition) |
bool | string2size_t (const char *string, size_t *number) |
bool | isAtLeastVista (void) |
void | memupper (char *location, size_t length) |
bool | ReadNextBuffer (GetFileData *filedata) |
bool | MyOpenFile (const char *file, GetFileData *filedata) |
void | CloseFile (GetFileData *filedata) |
bool | GetLine (char *line, size_t size, GetFileData *filedata) |
bool | SetFileMode (const char *file, size_t attr) |
char * | mystrstr (const char *haystack, const char *needle, size_t hlen, size_t nlen, bool sensitive) |
const char * | mystrstr (const char *haystack, const char *needle) |
VOID | GetUniqueFileName (CHAR *Template, CHAR Filler, CHAR *file) |
size_t RexxEntry | SysCls (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine2 (RexxStringObject, SysCurPos, OPTIONAL_stringsize_t, inrow, OPTIONAL_stringsize_t, incol) | |
RexxRoutine1 (int, SysCurState, CSTRING, option) | |
size_t RexxEntry | SysDriveInfo (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysDriveMap (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysDropFuncs (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine1 (int, SysFileDelete, CSTRING, name) | |
size_t RexxEntry | SysFileSearch (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
static void | badSFTOptsException (RexxThreadContext *c, size_t pos, CSTRING actual) |
static void | badMaskException (RexxThreadContext *c, size_t pos, CSTRING actual) |
size_t | neededSize (size_t need, size_t have) |
static bool | getBiggerBuffer (RexxCallContext *c, char **dBuf, size_t *nBuf, size_t needed, size_t nStaticBuffer) |
static bool | sameAttr (int32_t *mask, uint32_t attr, uint32_t options) |
static uint32_t | newAttr (int32_t *mask, uint32_t attr) |
static bool | setAttr (const char *file, uint32_t attr) |
static bool | formatFile (RexxCallContext *c, char *path, RXTREEDATA *treeData, int32_t *newMask, uint32_t options, WIN32_FIND_DATA *wfd) |
static bool | recursiveFindFile (RexxCallContext *c, char *path, RXTREEDATA *treeData, int32_t *targetMask, int32_t *newMask, uint32_t options) |
static char * | adjustFSpec (char *fSpec) |
static bool | safeGetCurrentDirectory (RexxCallContext *c, char **pPath, size_t *pPathLen) |
static bool | expandNonPath2fullPath (RexxCallContext *c, char *fSpec, char **pPath, size_t *pPathLen, int *lastSlashPos) |
static bool | expandPath2fullPath (RexxCallContext *c, char *fSpec, size_t lastSlashPos, char **pPath, size_t *pPathLen) |
static bool | getPath (RexxCallContext *c, char *fSpec, char **path, char *filename, size_t *pathLen) |
static bool | goodOpts (RexxCallContext *c, char *opts, uint32_t *pOpts) |
static bool | goodMask (RexxCallContext *c, char *msk, int32_t *mask) |
static bool | getMaskFromArg (RexxCallContext *context, char *msk, int32_t *mask, size_t argPos) |
static bool | getOptionsFromArg (RexxCallContext *context, char *opts, uint32_t *options, size_t argPos) |
static char * | getFileSpecFromArg (RexxCallContext *context, CSTRING fSpec, size_t *fSpecLen, size_t *fSpecBufLen, size_t argPos) |
static char * | getPathBuffer (RexxCallContext *context, size_t fSpecLen, size_t *pathLen) |
static bool | illegalFileNameChars (char *fSpec) |
RexxRoutine5 (uint32_t, SysFileTree, CSTRING, fSpec, RexxStemObject, files, OPTIONAL_CSTRING, opts, OPTIONAL_CSTRING, targetAttr, OPTIONAL_CSTRING, newAttr) | |
size_t RexxEntry | SysGetKey (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysIni (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysLoadFuncs (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine1 (int, SysMkDir, CSTRING, dir) | |
size_t RexxEntry | SysGetErrortext (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysWinEncryptFile (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysWinDecryptFile (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysWinVer (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysVersion (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine1 (int, SysRmDir, CSTRING, dir) | |
size_t RexxEntry | SysSearchPath (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine1 (int, SysSleep, RexxStringObject, delay) | |
size_t RexxEntry | SysTempFileName (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine3 (RexxStringObject, SysTextScreenRead, int, row, int, col, OPTIONAL_int, len) | |
RexxRoutine5 (RexxStringObject, SysTextScreenSize, OPTIONAL_CSTRING, optionString, OPTIONAL_stringsize_t, rows, OPTIONAL_stringsize_t, columns, OPTIONAL_stringsize_t, rows2, OPTIONAL_stringsize_t, columns2) | |
size_t RexxEntry | RxWinExec (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine3 (int, SysAddRexxMacro, CSTRING, name, CSTRING, file, OPTIONAL_CSTRING, option) | |
RexxRoutine2 (int, SysReorderRexxMacro, CSTRING, name, CSTRING, option) | |
RexxRoutine1 (int, SysDropRexxMacro, CSTRING, name) | |
RexxRoutine1 (CSTRING, SysQueryRexxMacro, CSTRING, name) | |
RexxRoutine0 (int, SysClearRexxMacroSpace) | |
RexxRoutine1 (int, SysSaveRexxMacroSpace, CSTRING, file) | |
RexxRoutine1 (int, SysLoadRexxMacroSpace, CSTRING, file) | |
size_t RexxEntry | SysBootDrive (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysSystemDirectory (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysFileSystemType (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
size_t RexxEntry | SysVolumeLabel (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine1 (RexxObjectPtr, SysCreateMutexSem, OPTIONAL_CSTRING, name) | |
RexxRoutine1 (uintptr_t, SysOpenMutexSem, CSTRING, name) | |
RexxRoutine1 (int, SysReleaseMutexSem, uintptr_t, h) | |
RexxRoutine1 (int, SysCloseMutexSem, uintptr_t, h) | |
RexxRoutine2 (int, SysRequestMutexSem, uintptr_t, h, OPTIONAL_int, timeout) | |
RexxRoutine2 (RexxObjectPtr, SysCreateEventSem, OPTIONAL_CSTRING, name, OPTIONAL_CSTRING, reset) | |
RexxRoutine1 (uintptr_t, SysOpenEventSem, CSTRING, name) | |
RexxRoutine1 (int, SysPostEventSem, uintptr_t, h) | |
RexxRoutine1 (int, SysResetEventSem, uintptr_t, h) | |
RexxRoutine1 (int, SysPulseEventSem, uintptr_t, h) | |
RexxRoutine1 (int, SysCloseEventSem, uintptr_t, h) | |
RexxRoutine2 (int, SysWaitEventSem, uintptr_t, h, OPTIONAL_int, timeout) | |
RexxRoutine2 (int, SysSetPriority, RexxObjectPtr, classArg, RexxObjectPtr, levelArg) | |
RexxRoutine1 (RexxObjectPtr, SysQueryProcess, OPTIONAL_CSTRING, option) | |
RexxRoutine5 (uint32_t, SysShutDownSystem, OPTIONAL_CSTRING, computer, OPTIONAL_CSTRING, message, OPTIONAL_uint32_t, timeout, OPTIONAL_logical_t, forceAppsClosed, OPTIONAL_logical_t, reboot) | |
RexxRoutine1 (int, SysSwitchSession, CSTRING, name) | |
RexxRoutine2 (int, SysWaitNamedPipe, CSTRING, name, OPTIONAL_int, timeout) | |
size_t RexxEntry | SysDumpVariables (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine3 (int, SysSetFileDateTime, CSTRING, name, OPTIONAL_CSTRING, newdate, OPTIONAL_CSTRING, newtime) | |
RexxRoutine2 (RexxObjectPtr, SysGetFileDateTime, CSTRING, name, OPTIONAL_CSTRING, selector) | |
RexxReturnCode REXXENTRY | RexxStemSort (const char *stemname, int order, int type, size_t start, size_t end, size_t firstcol, size_t lastcol) |
size_t RexxEntry | SysStemSort (const char *name, size_t numargs, CONSTRXSTRING args[], const char *queuename, PRXSTRING retstr) |
RexxRoutine3 (int, SysStemDelete, RexxStemObject, toStem, stringsize_t, start, OPTIONAL_stringsize_t, count) | |
RexxRoutine3 (int, SysStemInsert, RexxStemObject, toStem, stringsize_t, position, RexxObjectPtr, newValue) | |
RexxRoutine6 (int, SysStemCopy, RexxStemObject, fromStem, RexxStemObject, toStem, OPTIONAL_stringsize_t, from, OPTIONAL_stringsize_t, to, OPTIONAL_stringsize_t, count, OPTIONAL_CSTRING, option) | |
RexxRoutine0 (RexxStringObject, SysUtilVersion) | |
static bool | canUseWideCharFlags (UINT cp) |
RexxRoutine5 (int, SysFromUniCode, RexxStringObject, sourceString, OPTIONAL_CSTRING, codePageOpt, OPTIONAL_CSTRING, mappingFlags, OPTIONAL_CSTRING, defaultChar, RexxStemObject, stem) | |
RexxRoutine4 (int, SysToUniCode, RexxStringObject, source, OPTIONAL_CSTRING, codePageOpt, OPTIONAL_CSTRING, mappingFlags, RexxStemObject, stem) | |
RexxRoutine1 (uint32_t, SysWinGetPrinters, RexxStemObject, stem) | |
RexxRoutine0 (RexxStringObject, SysWinGetDefaultPrinter) | |
RexxRoutine1 (int, SysWinSetDefaultPrinter, CSTRING, printer) | |
RexxRoutine2 (int, SysFileCopy, CSTRING, fromFile, CSTRING, toFile) | |
RexxRoutine2 (int, SysFileMove, CSTRING, fromFile, CSTRING, toFile) | |
RexxRoutine1 (logical_t, SysIsFile, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileDirectory, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileLink, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileCompressed, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileEncrypted, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileNotContentIndexed, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileOffline, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileSparse, CSTRING, file) | |
RexxRoutine1 (logical_t, SysIsFileTemporary, CSTRING, file) | |
RexxRoutine1 (logical_t, SysFileExists, CSTRING, file) | |
RexxRoutine1 (RexxStringObject, SysGetLongPathName, CSTRING, path) | |
RexxRoutine1 (RexxStringObject, SysGetShortPathName, CSTRING, path) | |
OOREXX_GET_PACKAGE (rexxutil) | |
Variables | |
static int | ExtendedFlag = 0 |
static char | ExtendedChar |
static P_GDFSE | pGetDiskFreeSpaceEx = NULL |
RexxRoutineEntry | rexxutil_routines [] |
RexxPackageEntry | rexxutil_package_entry |
#define AllAtts |
Definition at line 227 of file windows/rexxutil.cpp.
#define AllDirs |
Definition at line 231 of file windows/rexxutil.cpp.
#define AllFiles |
Definition at line 229 of file windows/rexxutil.cpp.
#define AllocFlag PAG_COMMIT | PAG_WRITE /* for DosAllocMem */ |
Definition at line 197 of file windows/rexxutil.cpp.
#define BUILDRXSTRING | ( | t, | |
s | |||
) |
Definition at line 354 of file windows/rexxutil.cpp.
#define CASELESS 0x0080 |
Definition at line 225 of file windows/rexxutil.cpp.
#define CDROM 2 |
Definition at line 209 of file windows/rexxutil.cpp.
#define CH_CR '\r' /* carriage return character */ |
Definition at line 195 of file windows/rexxutil.cpp.
#define CH_EOF 0x1A /* end of file marker */ |
Definition at line 194 of file windows/rexxutil.cpp.
#define CH_NL '\n' /* new line character */ |
Definition at line 196 of file windows/rexxutil.cpp.
#define DO_DIRS 0x0004 |
Definition at line 220 of file windows/rexxutil.cpp.
#define DO_FILES 0x0008 |
Definition at line 221 of file windows/rexxutil.cpp.
#define EDITABLE_TIME 0x0020 |
Definition at line 223 of file windows/rexxutil.cpp.
#define ERROR_FILEOPEN "3" /* Error opening text file */ |
Definition at line 335 of file windows/rexxutil.cpp.
#define ERROR_NOMEM "2" /* Insufficient memory */ |
Definition at line 334 of file windows/rexxutil.cpp.
#define ERROR_RETSTR "ERROR:" |
Definition at line 341 of file windows/rexxutil.cpp.
#define FILEATTR_BUF_LEN 16 |
Definition at line 256 of file windows/rexxutil.cpp.
#define FILETIME_BUF_LEN 64 |
Definition at line 255 of file windows/rexxutil.cpp.
#define FNAMESPEC_BUF_EXTRA 8 |
Definition at line 252 of file windows/rexxutil.cpp.
#define FNAMESPEC_BUF_LEN MAX_PATH + FNAMESPEC_BUF_EXTRA |
Definition at line 253 of file windows/rexxutil.cpp.
#define FOUNDFILE_BUF_LEN MAX_PATH |
Definition at line 254 of file windows/rexxutil.cpp.
#define FOUNDFILELINE_BUF_LEN FOUNDFILE_BUF_LEN + FILETIME_BUF_LEN + FILEATTR_BUF_LEN |
Definition at line 257 of file windows/rexxutil.cpp.
#define FREE 1 |
Definition at line 208 of file windows/rexxutil.cpp.
#define IBUF_LEN 4096 /* Input buffer length */ |
Definition at line 192 of file windows/rexxutil.cpp.
#define INVALID_ROUTINE 40 /* Raise Rexx error */ |
Definition at line 347 of file windows/rexxutil.cpp.
#define LOCAL 4 |
Definition at line 211 of file windows/rexxutil.cpp.
#define LONG_TIME 0x0040 /* long time format for SysFileTree */ |
Definition at line 224 of file windows/rexxutil.cpp.
#define MAX 264 /* temporary buffer length */ |
Definition at line 191 of file windows/rexxutil.cpp.
#define MAX_CREATEPROCESS_CMDLINE (32 * 1024) |
Definition at line 201 of file windows/rexxutil.cpp.
#define MAX_DIGITS 9 /* max digits in numeric arg */ |
Definition at line 190 of file windows/rexxutil.cpp.
#define MAX_ENVVAR 1024 |
Definition at line 199 of file windows/rexxutil.cpp.
#define MAX_LABEL 13 /* max label length (sdrvinfo)*/ |
Definition at line 189 of file windows/rexxutil.cpp.
#define MAX_LINE_LEN 4096 /* max line length */ |
Definition at line 200 of file windows/rexxutil.cpp.
#define MAX_READ 0x10000 /* full segment of buffer */ |
Definition at line 193 of file windows/rexxutil.cpp.
#define NAME_ONLY 0x0010 |
Definition at line 222 of file windows/rexxutil.cpp.
#define NO_UTIL_ERROR "0" /* No error whatsoever */ |
Definition at line 333 of file windows/rexxutil.cpp.
#define OM_WAKEUP (WM_USER+10) |
Definition at line 182 of file windows/rexxutil.cpp.
#define RAMDISK 5 |
Definition at line 212 of file windows/rexxutil.cpp.
#define RECURSE 0x0002 |
Definition at line 219 of file windows/rexxutil.cpp.
#define REMOTE 3 |
Definition at line 210 of file windows/rexxutil.cpp.
#define REMOVABLE 6 |
Definition at line 213 of file windows/rexxutil.cpp.
#define RETVAL | ( | retc | ) |
Definition at line 359 of file windows/rexxutil.cpp.
#define RNDFACTOR 1664525L |
Definition at line 198 of file windows/rexxutil.cpp.
#define RXIGNORE 2 /* Ignore attributes entirely */ |
Definition at line 226 of file windows/rexxutil.cpp.
#define SORT_ASCENDING 0 |
Definition at line 240 of file windows/rexxutil.cpp.
#define SORT_CASEIGNORE 1 |
Definition at line 238 of file windows/rexxutil.cpp.
#define SORT_CASESENSITIVE 0 |
Definition at line 237 of file windows/rexxutil.cpp.
#define SORT_DECENDING 1 |
Definition at line 241 of file windows/rexxutil.cpp.
#define STATUS_SUCCESS (0x00000000) |
#define USED 0 |
Definition at line 207 of file windows/rexxutil.cpp.
#define VALID_ROUTINE 0 /* Successful completion */ |
Definition at line 348 of file windows/rexxutil.cpp.
#define WC_ERR_INVALID_CHARS 0x00000080 |
Definition at line 248 of file windows/rexxutil.cpp.
typedef struct _GetFileData GetFileData |
typedef BOOL(WINAPI * P_GDFSE) (LPCTSTR, PULARGE_INTEGER, PULARGE_INTEGER, PULARGE_INTEGER) |
Definition at line 325 of file windows/rexxutil.cpp.
typedef struct RxStemData RXSTEMDATA |
typedef struct RxTreeData RXTREEDATA |
|
static |
This is a SysFileTree() specific function. It is only called, indirectly through getPath(), from SysFileTree().
This function mimics the old IBM code.
Leading spaces are stripped, in some cases. A file specification of "." is changed to "*.*" and a file specification of ".." is changed to "..\*.*"
Leading spaces in fSpec are stripped IFF the first character(s) after the leading spaces:
is '\' or '/' or is '.\' or './' or is '..\' or '../' or is z: (i.e., a drive letter)
fSpec | The SysFileTree search specification |
@side effects: fSpec may be changed from "." to "*.*" or may be changed from ".." to "..\*.*"
@assumes: The buffer for fSpec is large enough for the possible changes.
Definition at line 2176 of file windows/rexxutil.cpp.
Referenced by getPath().
|
static |
This is a SysFile specific function.
c | |
pos | |
actual |
Definition at line 1589 of file windows/rexxutil.cpp.
References Rexx_Error_Incorrect_call_user_defined.
Referenced by getMaskFromArg().
|
static |
This is a SysFileTree specific function.
c | |
pos | |
actual |
Definition at line 1572 of file windows/rexxutil.cpp.
References Rexx_Error_Incorrect_call_user_defined.
Referenced by getOptionsFromArg().
|
static |
Check if the dwFlags arguement to WideCharToMultiByte() can be used by the specified code page. See MSDN documentation for WideCharToMultiByte() for clarification. This is used by SysFromUnicode()
cp | Code page to check. |
Definition at line 5986 of file windows/rexxutil.cpp.
Referenced by RexxRoutine5().
void CloseFile | ( | GetFileData * | filedata | ) |
Definition at line 617 of file windows/rexxutil.cpp.
References _GetFileData::buffer, and _GetFileData::handle.
Referenced by SysFileSearch().
|
static |
Definition at line 2274 of file windows/rexxutil.cpp.
References outOfMemoryException(), safeGetCurrentDirectory(), safeLocalFree(), systemServiceExceptionCode(), and RexxCallContext_::threadContext.
Referenced by getPath().
|
static |
Splits the path portion off from fSpec and returns it in the path buffer.
When this function is called, there is always at least one slash in fSpec.
c | |
fSpec | |
lastSlashPos | |
pPath | |
pPathLen |
We may have to enlarge the passed in path buffer. If we do, we need to be sure and update the path buffer pointer and the path length. As long as we keep pPath and pPathLen correct, the caller will take care of freeing any memory.
But if we do change pPath, we need to free the buffer it was pointing to.
Definition at line 2378 of file windows/rexxutil.cpp.
References getBiggerBuffer().
Referenced by getPath().
|
static |
This function is used by SysFileTree only.
Formats the line for a found file and adds it to the stem containing all the found files.
c | @parm path |
treeData | |
newMask | |
options | |
wfd |
If the file search is a very deep recursion in the host file system, a very large number of String objects may be created in the single Call context of SysFileTree. A reference to each created object is saved in a hash table to protect it from garbage collection, which can lead to a very large hash table. To prevent the creation of a very large hash table, we create a temp object, pass that object to the interpreter, and then tell the interpreter the object no longer needs to be protected in this call context.
Definition at line 1826 of file windows/rexxutil.cpp.
References RxTreeData::count, EDITABLE_TIME, RxTreeData::fileAttr, RxTreeData::files, RxTreeData::fileTime, RxTreeData::foundFile, RxTreeData::foundFileLine, LONG_TIME, NAME_ONLY, newAttr(), outOfMemoryException(), setAttr(), and RexxCallContext_::threadContext.
Referenced by recursiveFindFile().
|
static |
Allocates a buffer that is at least twice as big as the buffer passed in.
c | Call context we are operating in. |
dBuf | Pointer to the buffer to reallocate |
nBuf | Size of current dBuf buffer. Will be updated on return to size of newly allocated buffer. |
needed | Minimum size needed. |
nStaticBuffer | Size of original static buffer. |
Definition at line 1628 of file windows/rexxutil.cpp.
References neededSize(), outOfMemoryException(), and RexxCallContext_::threadContext.
Referenced by expandPath2fullPath(), and RexxRoutine5().
|
static |
This is a SysFileTree specific helper function.
Allocates and returns a buffer containing the file specification to search for.
The file specification consists of the search string as sent by the Rexx user, with possibly some glob characters added. The returned buffer is bigger than the original string to accommodate these, possible, added characters. The number of bytes added to the buffer is 8, which is what the original IBM code used. 8 is probably 1 byte more than needed, but there is no reason that this needs to be exact, better too long than too short.
If the file speicfication ends in a slash ('\') or a period ('.') or two periods ('..'), then a wild card specification ('*.*') is appended.
However, note that there is also the case where a single '.' at the end of the file specification is not used as a directory specifier, but rather is tacked on to the end of a file name.
Windows has a sometimes used convention that a '.' at the end of a file name can be used to indicate the file has no extension. For example, given a file named: MyFile a command of "dir MyFile." will produce a listing of "MyFile".
In this case we want to leave the file specification alone. that is, do not append a "*.*". A command of "dir *." will produce a directory listing of all files that do not have an extension.
context | |
fSpec | |
fSpecLen | [returned] The length of the original fSpec argument, not the length of the allocated buffer. |
fSpecBufLen | [returned] The length of the length of the allocated fSpec buffer. |
argPos |
If the returned buffer is null, a condition has been raised.
FNAMESPEC_BUF_EXTRA (8) is sized to contain the terminating NULL. So the allocated buffer has room to concatenate 7 characters.
Definition at line 2824 of file windows/rexxutil.cpp.
References FNAMESPEC_BUF_EXTRA, nullStringException(), outOfMemoryException(), and RexxCallContext_::threadContext.
Referenced by RexxRoutine5().
bool GetLine | ( | char * | line, |
size_t | size, | ||
GetFileData * | filedata | ||
) |
Definition at line 682 of file windows/rexxutil.cpp.
References CH_CR, CH_NL, _GetFileData::data, line, min, ReadNextBuffer(), _GetFileData::residual, and _GetFileData::scan.
Referenced by SysFileSearch().
|
static |
This is a SysFileTree specific helper function.
Checks the validity of an attribute mask argument and converts the character based mask into an integer based mask.
context | |
msk | |
mask | |
argPos |
Definition at line 2718 of file windows/rexxutil.cpp.
References argumentExists, badMaskException(), goodMask(), RXIGNORE, and RexxCallContext_::threadContext.
Referenced by RexxRoutine5().
|
static |
This is a SysFileTree specific helper function.
Checks the validity of the options argument to SysFileTree and converts the character based argument to the proper set of flags.
context | |
opts | |
options | |
argPos |
Definition at line 2755 of file windows/rexxutil.cpp.
References argumentExists, badSFTOptsException(), DO_DIRS, DO_FILES, goodOpts(), nullStringException(), and RexxCallContext_::threadContext.
Referenced by RexxRoutine5().
|
static |
This is a SysFileTree() specific function..
This function expands the file spec passed in to the funcition into its full path name. The full path name is then split into the path portion and the file name portion. The path portion is then returned in path and the file name portion is returned in fileName.
The path portion will end with the '\' char if fSpec contains a path.
fSpec | |
path | Pointer to path buffer. Path buffer is allocated memory, not a static buffer. |
filename | |
pathLen | Pointer to size of the path buffer. |
In addition, the path buffer is guarenteed to be at least that size also.
Definition at line 2537 of file windows/rexxutil.cpp.
References adjustFSpec(), expandNonPath2fullPath(), and expandPath2fullPath().
Referenced by RexxRoutine5().
|
static |
This is a SysFileTree specific helper function.
Allocates and returns a buffer large enough to contain the path to search along.
We need a minimum size for the path buffer of at least MAX (264). But the old code seemed to think fileSpecLen + FNAMESPEC_BUF_EXTRA could be longer than that. I guess it could if the user put in a non-existent long file path.
The old code of checking fSpecLen is still used, but I'm unsure of its exact purpose.
context | |
fSpecLen | |
pathLen |
LocalAlloc(), not malloc() is used for memory allocation. Note that the path buffer is guarenteed to be FNAMESPEC_BUF_EXTRA (8) bytes larger than the fNameSpec buffer in the caller. This is important in later checks for buffer overflow.
Definition at line 2892 of file windows/rexxutil.cpp.
References FNAMESPEC_BUF_EXTRA, MAX, outOfMemoryException(), and RexxCallContext_::threadContext.
Referenced by RexxRoutine5().
VOID GetUniqueFileName | ( | CHAR * | Template, |
CHAR | Filler, | ||
CHAR * | file | ||
) |
Determine number of filler characters *
Return NULL string if less than 1 or greater than 4 *
Get a random number in the appropriate range
Do until a unique name is found
Generate string which represents the number
Subsitute filler characters with numeric string
See if the file exists
Make sure we are not wasting our time
Definition at line 903 of file windows/rexxutil.cpp.
References RNDFACTOR.
Referenced by SysTempFileName().
|
static |
This is a SysFileTree() specific helper function.
Set a mask of unsigned ints to what is specified by a mask of chars.
c | |
msk | |
mask |
If a character in position N is a '-' then the unsigned int at position N is set to -1. This is turning it off.
If a character in position N is a '*' then the unsigned int at position N is set to 0. This is saying ignore it, it doesn't matter what the attribute is.
Definition at line 2675 of file windows/rexxutil.cpp.
Referenced by getMaskFromArg().
|
static |
This is a SysFileTree specific function.
Determines the options by converting the character based argument to the correct set of flags.
c | |
opts | |
pOpts |
Definition at line 2602 of file windows/rexxutil.cpp.
References DO_DIRS, DO_FILES, EDITABLE_TIME, LONG_TIME, NAME_ONLY, and RECURSE.
Referenced by getOptionsFromArg().
|
static |
Tests for illegal file name characters in fSpec.
fSpec |
A ':' is only valid if it is the second character. Technically a '*' and a '?' are not valid characters for a file name, but they are okay for fSpec. Same thing for '\' and '/', they are not valid in a file name, but they are valid in fSpec. A '/' is iffy. The Windows API accepts '/' as a directory separator, but most Rexx programmers probably don't know that. Not sure if we should flag that as illegal or not.
Definition at line 2930 of file windows/rexxutil.cpp.
Referenced by RexxRoutine5().
|
inline |
Definition at line 511 of file windows/rexxutil.cpp.
References isWindowsVersion().
Referenced by RexxRoutine5().
|
static |
Tests if the the current operating system version meets the specified requirements. Really a front end to VerifyVersionInfo(). See MSDN docs for type and condition flags.
major | OS major number. |
minor | OS minor number. |
sp | Service pack level. |
type | Further refines the test. See MSDN for all the flags, but for example there is VER_NT_WORKSTATION to differentiate between NT desktop and NT server. |
condition | The test condition. Typical flags would be VER_EQUAL or VER_GREATER_EQUAL. |
Definition at line 430 of file windows/rexxutil.cpp.
References type.
Referenced by isAtLeastVista().
void memupper | ( | char * | location, |
size_t | length | ||
) |
Definition at line 529 of file windows/rexxutil.cpp.
Referenced by SysFileSearch(), and SysIni().
bool MyOpenFile | ( | const char * | file, |
GetFileData * | filedata | ||
) |
Definition at line 549 of file windows/rexxutil.cpp.
References _GetFileData::buffer, _GetFileData::data, _GetFileData::handle, MAX_READ, ReadNextBuffer(), _GetFileData::residual, _GetFileData::scan, and _GetFileData::size.
Referenced by SysFileSearch().
const char* mystrstr | ( | const char * | haystack, |
const char * | needle | ||
) |
Definition at line 867 of file windows/rexxutil.cpp.
char* mystrstr | ( | const char * | haystack, |
const char * | needle, | ||
size_t | hlen, | ||
size_t | nlen, | ||
bool | sensitive | ||
) |
Definition at line 828 of file windows/rexxutil.cpp.
References line, and MAX_LINE_LEN.
Referenced by RexxRoutine4(), and SysFileSearch().
|
inline |
Returns a value that is greater than 'need' by doubling 'have' until that value is reached.
Definition at line 1603 of file windows/rexxutil.cpp.
Referenced by getBiggerBuffer().
Returns a new file attribute value given a mask of attributes to be changed and the current attribute value.
mask | |
attr |
Definition at line 1724 of file windows/rexxutil.cpp.
References RXIGNORE.
Referenced by formatFile(), and RexxRoutine5().
|
inline |
<routineName> argument <argPos> must not be a null string
SysFileTree argument 2 must not be a null string
c | Threade context we are operating in. |
fName | Routine name. |
pos | Argument position. |
Definition at line 384 of file windows/rexxutil.cpp.
References Rexx_Error_Incorrect_call_null.
Referenced by getFileSpecFromArg(), and getOptionsFromArg().
OOREXX_GET_PACKAGE | ( | rexxutil | ) |
|
inline |
Definition at line 370 of file windows/rexxutil.cpp.
References Rexx_Error_System_service_user_defined.
Referenced by expandNonPath2fullPath(), formatFile(), getBiggerBuffer(), getFileSpecFromArg(), getPathBuffer(), recursiveFindFile(), and safeGetCurrentDirectory().
bool ReadNextBuffer | ( | GetFileData * | filedata | ) |
Reads the next buffer of data.
filedata | Global file information. |
Definition at line 631 of file windows/rexxutil.cpp.
References _GetFileData::buffer, _GetFileData::data, _GetFileData::handle, MAX_READ, min, _GetFileData::residual, and _GetFileData::scan.
Referenced by GetLine(), and MyOpenFile().
|
static |
Finds all files matching a file specification, formats a file name line and adds the formatted line to a stem. Much of the data to complete this operation is contained in the treeData struct.
This is a recursive function that may search through subdirectories if the recurse option is used.
c | Call context we are operating in. |
path | Current directory we are searching. |
treeData | Struct containing data pertaining to the search, such as the file specification we are searching for, the stem to put the results in, etc.. |
targetMask | An array of integers which describe the source attribute mask. Only files with attributes matching this mask will be found. |
newMask | An array of integers which describe the target attribute mask. Attributes of all found files will be changed / set to the values specified by this mask. |
options |
mask[0] = FILE_ARCHIVED mask[1] = FILE_DIRECTORY mask[2] = FILE_HIDDEN mask[3] = FILE_READONLY mask[4] = FILE_SYSTEMA negative value at a given index indicates that the attribute bit of the file is not set. A positive number indicates that the attribute should be set. A value of 0 indicates a "Don't Care" setting.
A close reading of MSDN seems to indicate that as long as we are compiled for ANSI, which we are, that MAX_PATH is sufficiently large. But, we will code for the possibility that it is not large enough, by mallocing dynamic memory if _snprintf indicates a failure.
We point dTmpFileName at the static buffer and nTmpFileName is set to the size of the buffer. If we have to allocate memory, nTmpFileName will be set to the size we allocate and if nTmpFileName does not equal what it is originally set to, we know we have to free the allocated memory.
Definition at line 2029 of file windows/rexxutil.cpp.
References RxTreeData::dFNameSpec, FNAMESPEC_BUF_LEN, formatFile(), outOfMemoryException(), RECURSE, safeLocalFree(), sameAttr(), and RexxCallContext_::threadContext.
Referenced by RexxRoutine5().
RexxRoutine0 | ( | int | , |
SysClearRexxMacroSpace | |||
) |
Definition at line 4398 of file windows/rexxutil.cpp.
References RexxClearMacroSpace().
RexxRoutine0 | ( | RexxStringObject | , |
SysUtilVersion | |||
) |
Definition at line 5968 of file windows/rexxutil.cpp.
RexxRoutine0 | ( | RexxStringObject | , |
SysWinGetDefaultPrinter | |||
) |
Definition at line 6499 of file windows/rexxutil.cpp.
Definition at line 4369 of file windows/rexxutil.cpp.
References RexxQueryMacro(), and RXMACRO_SEARCH_BEFORE.
RexxRoutine1 | ( | int | , |
SysCloseEventSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4857 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysCloseMutexSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4699 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysCurState | , | ||
CSTRING | , | ||
option | |||
) |
Definition at line 1110 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysDropRexxMacro | , | ||
CSTRING | , | ||
name | |||
) |
Definition at line 4354 of file windows/rexxutil.cpp.
References RexxDropMacro().
RexxRoutine1 | ( | int | , |
SysFileDelete | , | ||
CSTRING | , | ||
name | |||
) |
Definition at line 1422 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysLoadRexxMacroSpace | , | ||
CSTRING | , | ||
file | |||
) |
Definition at line 4428 of file windows/rexxutil.cpp.
References RexxLoadMacroSpace().
Definition at line 3458 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysPostEventSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4810 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysPulseEventSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4841 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysReleaseMutexSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4684 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysResetEventSem | , | ||
uintptr_t | , | ||
h | |||
) |
Definition at line 4825 of file windows/rexxutil.cpp.
Definition at line 3666 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysSaveRexxMacroSpace | , | ||
CSTRING | , | ||
file | |||
) |
Definition at line 4413 of file windows/rexxutil.cpp.
References RexxSaveMacroSpace().
RexxRoutine1 | ( | int | , |
SysSleep | , | ||
RexxStringObject | , | ||
delay | |||
) |
Using Sleep with a long timeout risks sleeping on a thread with a message queue, which can make the system sluggish, or possibly deadlocked. If the sleep is longer than 333 milliseconds use a window timer to avoid this risk.
Definition at line 3804 of file windows/rexxutil.cpp.
References isnan, OM_WAKEUP, Rexx_Error_Invalid_argument_number, Rexx_Error_Invalid_argument_range, Rexx_Error_System_resources_user_defined, and SleepTimerProc().
RexxRoutine1 | ( | int | , |
SysSwitchSession | , | ||
CSTRING | , | ||
name | |||
) |
Definition at line 5230 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | int | , |
SysWinSetDefaultPrinter | , | ||
CSTRING | , | ||
printer | |||
) |
Definition at line 6518 of file windows/rexxutil.cpp.
Definition at line 6772 of file windows/rexxutil.cpp.
Definition at line 6624 of file windows/rexxutil.cpp.
Definition at line 6673 of file windows/rexxutil.cpp.
Definition at line 6641 of file windows/rexxutil.cpp.
Definition at line 6689 of file windows/rexxutil.cpp.
Definition at line 6657 of file windows/rexxutil.cpp.
Definition at line 6706 of file windows/rexxutil.cpp.
Definition at line 6722 of file windows/rexxutil.cpp.
Definition at line 6738 of file windows/rexxutil.cpp.
Definition at line 6755 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | RexxObjectPtr | , |
SysCreateMutexSem | , | ||
OPTIONAL_CSTRING | , | ||
name | |||
) |
Definition at line 4627 of file windows/rexxutil.cpp.
RexxRoutine1 | ( | RexxObjectPtr | , |
SysQueryProcess | , | ||
OPTIONAL_CSTRING | , | ||
option | |||
) |
Definition at line 5021 of file windows/rexxutil.cpp.
References NULLOBJECT.
RexxRoutine1 | ( | RexxStringObject | , |
SysGetLongPathName | , | ||
CSTRING | , | ||
path | |||
) |
Definition at line 6791 of file windows/rexxutil.cpp.
References MAX.
RexxRoutine1 | ( | RexxStringObject | , |
SysGetShortPathName | , | ||
CSTRING | , | ||
path | |||
) |
Definition at line 6818 of file windows/rexxutil.cpp.
References MAX.
RexxRoutine1 | ( | uint32_t | , |
SysWinGetPrinters | , | ||
RexxStemObject | , | ||
stem | |||
) |
Definition at line 6445 of file windows/rexxutil.cpp.
Definition at line 4792 of file windows/rexxutil.cpp.
Definition at line 4666 of file windows/rexxutil.cpp.
Definition at line 6593 of file windows/rexxutil.cpp.
Definition at line 6609 of file windows/rexxutil.cpp.
References MoveFile().
Definition at line 4321 of file windows/rexxutil.cpp.
References RexxReorderMacro(), RXMACRO_SEARCH_AFTER, and RXMACRO_SEARCH_BEFORE.
RexxRoutine2 | ( | int | , |
SysRequestMutexSem | , | ||
uintptr_t | , | ||
h | , | ||
OPTIONAL_int | , | ||
timeout | |||
) |
Definition at line 4714 of file windows/rexxutil.cpp.
References argumentOmitted.
RexxRoutine2 | ( | int | , |
SysSetPriority | , | ||
RexxObjectPtr | , | ||
classArg | , | ||
RexxObjectPtr | , | ||
levelArg | |||
) |
Definition at line 4901 of file windows/rexxutil.cpp.
RexxRoutine2 | ( | int | , |
SysWaitEventSem | , | ||
uintptr_t | , | ||
h | , | ||
OPTIONAL_int | , | ||
timeout | |||
) |
Definition at line 4872 of file windows/rexxutil.cpp.
References argumentExists.
RexxRoutine2 | ( | int | , |
SysWaitNamedPipe | , | ||
CSTRING | , | ||
name | , | ||
OPTIONAL_int | , | ||
timeout | |||
) |
Definition at line 5262 of file windows/rexxutil.cpp.
References argumentOmitted.
RexxRoutine2 | ( | RexxObjectPtr | , |
SysCreateEventSem | , | ||
OPTIONAL_CSTRING | , | ||
name | , | ||
OPTIONAL_CSTRING | , | ||
reset | |||
) |
Definition at line 4744 of file windows/rexxutil.cpp.
RexxRoutine2 | ( | RexxObjectPtr | , |
SysGetFileDateTime | , | ||
CSTRING | , | ||
name | , | ||
OPTIONAL_CSTRING | , | ||
selector | |||
) |
Definition at line 5504 of file windows/rexxutil.cpp.
References NULLOBJECT.
RexxRoutine2 | ( | RexxStringObject | , |
SysCurPos | , | ||
OPTIONAL_stringsize_t | , | ||
inrow | , | ||
OPTIONAL_stringsize_t | , | ||
incol | |||
) |
Definition at line 1063 of file windows/rexxutil.cpp.
References argumentExists, and argumentOmitted.
RexxRoutine3 | ( | int | , |
SysAddRexxMacro | , | ||
CSTRING | , | ||
name | , | ||
CSTRING | , | ||
file | , | ||
OPTIONAL_CSTRING | , | ||
option | |||
) |
Definition at line 4282 of file windows/rexxutil.cpp.
References RexxAddMacro(), RXMACRO_SEARCH_AFTER, and RXMACRO_SEARCH_BEFORE.
RexxRoutine3 | ( | int | , |
SysSetFileDateTime | , | ||
CSTRING | , | ||
name | , | ||
OPTIONAL_CSTRING | , | ||
newdate | , | ||
OPTIONAL_CSTRING | , | ||
newtime | |||
) |
Definition at line 5428 of file windows/rexxutil.cpp.
RexxRoutine3 | ( | int | , |
SysStemDelete | , | ||
RexxStemObject | , | ||
toStem | , | ||
stringsize_t | , | ||
start | , | ||
OPTIONAL_stringsize_t | , | ||
count | |||
) |
Definition at line 5719 of file windows/rexxutil.cpp.
References argumentOmitted, and NULLOBJECT.
RexxRoutine3 | ( | int | , |
SysStemInsert | , | ||
RexxStemObject | , | ||
toStem | , | ||
stringsize_t | , | ||
position | , | ||
RexxObjectPtr | , | ||
newValue | |||
) |
Definition at line 5782 of file windows/rexxutil.cpp.
References NULLOBJECT.
RexxRoutine3 | ( | RexxStringObject | , |
SysTextScreenRead | , | ||
int | , | ||
row | , | ||
int | , | ||
col | , | ||
OPTIONAL_int | , | ||
len | |||
) |
Definition at line 3941 of file windows/rexxutil.cpp.
References argumentOmitted, and NULLOBJECT.
RexxRoutine4 | ( | int | , |
SysToUniCode | , | ||
RexxStringObject | , | ||
source | , | ||
OPTIONAL_CSTRING | , | ||
codePageOpt | , | ||
OPTIONAL_CSTRING | , | ||
mappingFlags | , | ||
RexxStemObject | , | ||
stem | |||
) |
Definition at line 6326 of file windows/rexxutil.cpp.
References mystrstr().
RexxRoutine5 | ( | int | , |
SysFromUniCode | , | ||
RexxStringObject | , | ||
sourceString | , | ||
OPTIONAL_CSTRING | , | ||
codePageOpt | , | ||
OPTIONAL_CSTRING | , | ||
mappingFlags | , | ||
OPTIONAL_CSTRING | , | ||
defaultChar | , | ||
RexxStemObject | , | ||
stem | |||
) |
Definition at line 6085 of file windows/rexxutil.cpp.
References canUseWideCharFlags(), isAtLeastVista(), and WC_ERR_INVALID_CHARS.
RexxRoutine5 | ( | RexxStringObject | , |
SysTextScreenSize | , | ||
OPTIONAL_CSTRING | , | ||
optionString | , | ||
OPTIONAL_stringsize_t | , | ||
rows | , | ||
OPTIONAL_stringsize_t | , | ||
columns | , | ||
OPTIONAL_stringsize_t | , | ||
rows2 | , | ||
OPTIONAL_stringsize_t | , | ||
columns2 | |||
) |
Definition at line 4035 of file windows/rexxutil.cpp.
References argumentExists, and argumentOmitted.
RexxRoutine5 | ( | uint32_t | , |
SysFileTree | , | ||
CSTRING | , | ||
fSpec | , | ||
RexxStemObject | , | ||
files | , | ||
OPTIONAL_CSTRING | , | ||
opts | , | ||
OPTIONAL_CSTRING | , | ||
targetAttr | , | ||
OPTIONAL_CSTRING | , | ||
newAttr | |||
) |
SysFileTree() implementation. Searches for files in a directory tree matching the specified search pattern.
fSpec | [required] The search pattern, may contain glob characters and full or partial path informattion. E.g., *.bat, or ../../*.txt, or C:\temp. May not contain illegal file name characters which are: ", <, >, |, and : The semicolon is only legal if it is exactly the second character. Do not use a double quote in fSpec, it is not needed and is taken as a character in a file name, which is an illegal character. |
files | [required] A stem to contain the returned results. On return, files.0 contains the count N of found files and files.1 through files.N will contain the found files. |
opts | [optional] Any combination of the following letters that specify how the search takes place, or how the returned found file line is formatted. Case is not significant: |
'B' - Search for files and directories. 'D' - Search for directories only. 'F' - Search for files only. 'O' - Only output file names. 'S' - Recursively scan subdirectories. 'T' - Combine time & date fields into one. 'L' - Long time format 'I' - Case Insensitive search.
The defualt is 'B' using normal time (neither 'T' nor 'L'.) The 'I'option is meaningless on Windows.
targetAttr | [optional] Target attribute mask. Only files with these attributes will be searched for. The default is to ignore the attributes of the files found, so all files found are returned. |
newAttr | [optional] New attribute mask. Each found file will have its attributes set (changed) to match this mask. The default is to not change any attributes. |
Definition at line 3006 of file windows/rexxutil.cpp.
References RxTreeData::count, RxTreeData::dFNameSpec, RxTreeData::files, RxTreeData::fNameSpec, FNAMESPEC_BUF_LEN, getBiggerBuffer(), getFileSpecFromArg(), getMaskFromArg(), getOptionsFromArg(), getPath(), getPathBuffer(), illegalFileNameChars(), newAttr(), RxTreeData::nFNameSpec, recursiveFindFile(), and safeLocalFree().
RexxRoutine5 | ( | uint32_t | , |
SysShutDownSystem | , | ||
OPTIONAL_CSTRING | , | ||
computer | , | ||
OPTIONAL_CSTRING | , | ||
message | , | ||
OPTIONAL_uint32_t | , | ||
timeout | , | ||
OPTIONAL_logical_t | , | ||
forceAppsClosed | , | ||
OPTIONAL_logical_t | , | ||
reboot | |||
) |
SysShutDownSystem()
Interface to the InitiateSystemShutdown() API on Windows.
computer | The name of the computer to shut down. If omitted or the empty string, the local machine is shut down. Otherwise this is the name of a remote machine to shut down. |
message | If timout is not 0, a shut down dialog is displayed on the machine being shut down, naming the user who initiated the shut down, a timer counting down the seconds until the machine is shut down, and prompting the local user to log off. This parametr can be an additional message to add to the dialog box. It can be ommitted if no additional message is desired. |
timeout | Number of seconds to display the shut down dialog. If this is 0 no dialog is displayed. The default is 30 seconds, see the remarks below. The user can force a 0 timeout by explicitly specifying 0. |
forceAppsClosed | If true applications with unsaved data are forcibly closed. If false, the user is presented with a dialog telling the user to close the applcation(s). |
reboot | If true, the system is rebooted, if false the system is shut down. |
machine == NULL message == NULL timeout == 0 forceAppsClosed == false reboot == false
Because of this, there would be no need to check if any argument is ommitted or not. However, the consequences of having a 0 timeout value are severe if the system has an application open with unsaved data. Therefore for 4.0.0 and on the default time out value is changed to 30 (seconds.)
Definition at line 5157 of file windows/rexxutil.cpp.
References argumentOmitted.
RexxRoutine6 | ( | int | , |
SysStemCopy | , | ||
RexxStemObject | , | ||
fromStem | , | ||
RexxStemObject | , | ||
toStem | , | ||
OPTIONAL_stringsize_t | , | ||
from | , | ||
OPTIONAL_stringsize_t | , | ||
to | , | ||
OPTIONAL_stringsize_t | , | ||
count | , | ||
OPTIONAL_CSTRING | , | ||
option | |||
) |
Definition at line 5837 of file windows/rexxutil.cpp.
References argumentExists, argumentOmitted, and NULLOBJECT.
RexxReturnCode REXXENTRY RexxStemSort | ( | const char * | stemname, |
int | order, | ||
int | type, | ||
size_t | start, | ||
size_t | end, | ||
size_t | firstcol, | ||
size_t | lastcol | ||
) |
Process a stemsort call for the rexxutil SysStemSort function.
stemname | The name of the stem. |
order | The sort order. |
type | The type of sort (case sensitivity). |
start | The starting element number. |
end | The end element number. |
firstcol | The first sort column. |
lastcol | The last sort column. |
Definition at line 413 of file InterpreterAPI.cpp.
References NativeContextBlock::self, RexxNativeActivation::stemSort(), and type.
Referenced by SysStemSort().
size_t RexxEntry RxWinExec | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 4169 of file windows/rexxutil.cpp.
References BUILDRXSTRING, INVALID_ROUTINE, MAX_CREATEPROCESS_CMDLINE, NO_UTIL_ERROR, RXVALIDSTRING, _RXSTRING::strlength, _CONSTRXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, and VALID_ROUTINE.
|
static |
Definition at line 2234 of file windows/rexxutil.cpp.
References FNAMESPEC_BUF_EXTRA, outOfMemoryException(), systemServiceExceptionCode(), and RexxCallContext_::threadContext.
Referenced by expandNonPath2fullPath().
|
inline |
Definition at line 389 of file windows/rexxutil.cpp.
Referenced by expandNonPath2fullPath(), recursiveFindFile(), and RexxRoutine5().
Checks that attr is the same as that specified by the mask.
mask | |
attr | |
options |
Definition at line 1656 of file windows/rexxutil.cpp.
References DO_DIRS, DO_FILES, and RXIGNORE.
Referenced by recursiveFindFile().
|
static |
Changes the file attributes of the specified file to those specified by attr.
file | File to change the attributes of. |
attr | New file attributes. |
Definition at line 1787 of file windows/rexxutil.cpp.
Referenced by formatFile().
bool SetFileMode | ( | const char * | file, |
size_t | attr | ||
) |
Definition at line 792 of file windows/rexxutil.cpp.
VOID CALLBACK SleepTimerProc | ( | HWND | hwnd, |
UINT | uMsg, | ||
UINT | idEvent, | ||
DWORD | dwTime | ||
) |
Definition at line 3875 of file windows/rexxutil.cpp.
References OM_WAKEUP.
Referenced by RexxRoutine1().
bool string2size_t | ( | const char * | string, |
size_t * | number | ||
) |
Definition at line 480 of file windows/rexxutil.cpp.
References MAX_DIGITS.
Referenced by SysStemSort().
size_t RexxEntry SysBootDrive | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 4444 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysCls | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 1029 of file windows/rexxutil.cpp.
References BUILDRXSTRING, INVALID_ROUTINE, NO_UTIL_ERROR, and VALID_ROUTINE.
size_t RexxEntry SysDriveInfo | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 1149 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, pGetDiskFreeSpaceEx, _RXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysDriveMap | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 1270 of file windows/rexxutil.cpp.
References BUILDRXSTRING, CDROM, FREE, INVALID_ROUTINE, LOCAL, MAX, RAMDISK, REMOTE, REMOVABLE, _RXSTRING::strlength, USED, and VALID_ROUTINE.
size_t RexxEntry SysDropFuncs | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 1405 of file windows/rexxutil.cpp.
References _RXSTRING::strlength, and VALID_ROUTINE.
size_t RexxEntry SysDumpVariables | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 5308 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, RETVAL, RexxFreeMemory(), RexxVariablePool(), RXSHV_LVAR, RXSHV_NEXTV, RXSHV_OK, RXVALIDSTRING, _SHVBLOCK::shvcode, _SHVBLOCK::shvname, _SHVBLOCK::shvnamelen, _SHVBLOCK::shvnext, _SHVBLOCK::shvret, _SHVBLOCK::shvvalue, _SHVBLOCK::shvvaluelen, _RXSTRING::strlength, and _RXSTRING::strptr.
size_t RexxEntry SysFileSearch | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 1445 of file windows/rexxutil.cpp.
References BUILDRXSTRING, CloseFile(), RxStemData::count, ERROR_FILEOPEN, GetLine(), RxStemData::ibuf, IBUF_LEN, INVALID_ROUTINE, line, MAX_LINE_LEN, memupper(), min, MyOpenFile(), mystrstr(), NO_UTIL_ERROR, RexxVariablePool(), RXSHV_BADN, RXSHV_SET, RXVALIDSTRING, RxStemData::shvb, _SHVBLOCK::shvcode, _SHVBLOCK::shvname, _SHVBLOCK::shvnamelen, _SHVBLOCK::shvnext, _SHVBLOCK::shvret, _SHVBLOCK::shvvalue, _SHVBLOCK::shvvaluelen, RxStemData::stemlen, _RXSTRING::strlength, _CONSTRXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, VALID_ROUTINE, RxStemData::varname, and RxStemData::vlen.
size_t RexxEntry SysFileSystemType | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 4498 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysGetErrortext | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3474 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysGetKey | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3108 of file windows/rexxutil.cpp.
References ExtendedChar, ExtendedFlag, INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysIni | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3183 of file windows/rexxutil.cpp.
References BUILDRXSTRING, RxStemData::count, ERROR_NOMEM, ERROR_RETSTR, RxStemData::ibuf, INVALID_ROUTINE, memupper(), RexxVariablePool(), RXSHV_BADN, RXSHV_SET, RXVALIDSTRING, RxStemData::shvb, _SHVBLOCK::shvcode, _SHVBLOCK::shvname, _SHVBLOCK::shvnamelen, _SHVBLOCK::shvnext, _SHVBLOCK::shvret, _SHVBLOCK::shvvalue, _SHVBLOCK::shvvaluelen, RxStemData::stemlen, _RXSTRING::strlength, _CONSTRXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, VALID_ROUTINE, RxStemData::varname, and RxStemData::vlen.
size_t RexxEntry SysLoadFuncs | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3439 of file windows/rexxutil.cpp.
References _RXSTRING::strlength, and VALID_ROUTINE.
size_t RexxEntry SysSearchPath | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3688 of file windows/rexxutil.cpp.
References BUILDRXSTRING, INVALID_ROUTINE, MAX_ENVVAR, RXVALIDSTRING, SearchPath(), and VALID_ROUTINE.
size_t RexxEntry SysStemSort | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 5590 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, RexxStemSort(), RXVALIDSTRING, SIZE_MAX, SORT_ASCENDING, SORT_CASEIGNORE, SORT_CASESENSITIVE, SORT_DECENDING, string2size_t(), _RXSTRING::strlength, _CONSTRXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysSystemDirectory | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 4470 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysTempFileName | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3898 of file windows/rexxutil.cpp.
References GetUniqueFileName(), INVALID_ROUTINE, RXNULLSTRING, RXVALIDSTRING, _RXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, and VALID_ROUTINE.
|
static |
Raises an exception for an unrecoverable system API failure.
c | Call context we are operating in. |
api | System API name. |
rc | Return code from calling the API. |
Definition at line 404 of file windows/rexxutil.cpp.
References Rexx_Error_System_service_user_defined.
Referenced by expandNonPath2fullPath(), and safeGetCurrentDirectory().
size_t RexxEntry SysVersion | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3648 of file windows/rexxutil.cpp.
References SysWinVer().
size_t RexxEntry SysVolumeLabel | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 4564 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, _CONSTRXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysWinDecryptFile | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3566 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysWinEncryptFile | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3531 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
size_t RexxEntry SysWinVer | ( | const char * | name, |
size_t | numargs, | ||
CONSTRXSTRING | args[], | ||
const char * | queuename, | ||
PRXSTRING | retstr | ||
) |
Definition at line 3595 of file windows/rexxutil.cpp.
References INVALID_ROUTINE, STATUS_SUCCESS, _RXSTRING::strlength, _RXSTRING::strptr, and VALID_ROUTINE.
Referenced by SysVersion().
|
static |
Definition at line 320 of file windows/rexxutil.cpp.
Referenced by SysGetKey().
|
static |
Definition at line 319 of file windows/rexxutil.cpp.
Referenced by SysGetKey().
|
static |
Definition at line 327 of file windows/rexxutil.cpp.
Referenced by SysDriveInfo().
RexxPackageEntry rexxutil_package_entry |
Definition at line 6920 of file windows/rexxutil.cpp.
RexxRoutineEntry rexxutil_routines[] |
Definition at line 6834 of file windows/rexxutil.cpp.