73 #define MAX_FREQUENCY 32767
74 #define MIN_FREQUENCY 37
75 #define MAX_DURATION 60000
76 #define MIN_DURATION 0
79 #define FILESPEC_DRIVE 'D'
80 #define FILESPEC_PATH 'P'
81 #define FILESPEC_NAME 'N'
82 #define FILESPEC_LOCATION 'L'
83 #define FILESPEC_EXTENSION 'E'
109 context->ArrayAppend(subs, context->NewStringFromAsciiz(
"frequency"));
110 context->ArrayAppend(subs, context->WholeNumberToObject(
MIN_FREQUENCY));
111 context->ArrayAppend(subs, context->WholeNumberToObject(
MAX_FREQUENCY));
112 context->ArrayAppend(subs, context->WholeNumberToObject(Frequency));
121 context->ArrayAppend(subs, context->NewStringFromAsciiz(
"duration"));
122 context->ArrayAppend(subs, context->WholeNumberToObject(
MIN_DURATION));
123 context->ArrayAppend(subs, context->WholeNumberToObject(
MAX_DURATION));
124 context->ArrayAppend(subs, context->WholeNumberToObject(Duration));
129 Beep((DWORD)Frequency, (DWORD)Duration);
139 char buffer[MAX_PATH+1];
144 if ((strlen(dir) == 2) && (dir[1] ==
':'))
146 rc = _chdrive(toupper( dir[0] ) -
'A' + 1);
154 if (rc != 0 || _getcwd(buffer, MAX_PATH) == NULL)
156 return context->NullString();
160 return context->NewStringFromAsciiz(buffer);
170 const char *endPtr = name + strlen(name);
171 const char *pathEnd = strrchr(name,
'\\');
172 const char *altPathEnd = strrchr(name,
'/');
173 if (altPathEnd > pathEnd)
175 pathEnd = altPathEnd;
177 const char *driveEnd = strchr(name,
':');
179 const char *pathStart = driveEnd == NULL ? name : driveEnd + 1;
183 pathEnd = pathEnd == NULL ? pathStart : pathEnd + 1;
185 const char *nameStart = pathEnd == name ? name : pathEnd;
187 switch (toupper(*option))
191 return context->String(pathStart, pathEnd - pathStart);
196 return context->String(nameStart, endPtr - nameStart);
201 return context->String(name, pathEnd - name);
206 if (driveEnd != NULL)
208 return context->String(name, driveEnd + 1 - name);
212 return context->NullString();
219 const char *lastDot = strrchr(name,
'.');
221 if (lastDot >= nameStart)
225 return context->String(lastDot, endPtr - lastDot);
229 return context->NullString();
236 optionChar[0] = *option;
237 optionChar[1] =
'\0';
240 context->String(
"DELNP"), context->String(optionChar));
266 size_t named_argcount,
280 if (activation->
callExternalRexx(target, arguments, argcount, named_argcount, calltype, result))
329 char *str = strdup(other);
347 MB_DEFAULT_DESKTOP_ONLY,
351 MB_SERVICE_NOTIFICATION
354 const char *extra[] =
368 "SERVICENOTIFICATION"
371 ULONG extraStyle = 0;
373 int count =
sizeof(extra) /
sizeof(
const char *);
375 token = strtok(str,
" ");
376 while ( token != NULL )
378 for ( i = 0; i < count; i += 1 )
380 if ( !stricmp(token, extra[i]) )
382 extraStyle |= extraFlag[i];
394 token = strtok(NULL,
" ");
397 *style = *style | extraStyle;
420 OPTIONAL_CSTRING, button, OPTIONAL_CSTRING, icon, OPTIONAL_CSTRING, other)
426 INITCOMMONCONTROLSEX ctrlex;
427 ctrlex.dwSize =
sizeof(ctrlex);
428 ctrlex.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES;
429 InitCommonControlsEx(&ctrlex);
431 PSZ Button_Styles[] =
443 ULONG Button_Flags[] =
446 MB_CANCELTRYCONTINUE,
484 style = MB_SETFOREGROUND;
486 if ( button == NULL )
494 maxCnt =
sizeof(Button_Styles) /
sizeof(PSZ);
495 for ( index = 0; index < maxCnt; index++ )
497 if ( !stricmp(button, Button_Styles[index]) )
500 style |= Button_Flags[index];
504 if ( index == maxCnt )
507 context->InvalidRoutine();
516 maxCnt =
sizeof(Icon_Styles)/
sizeof(PSZ);
517 for ( index = 0; index < maxCnt; index += 1 )
519 if ( !stricmp(icon,Icon_Styles[index]) )
522 style |= Icon_Flags[index];
526 if ( index == maxCnt )
529 context->InvalidRoutine();
540 context->InvalidRoutine();
545 return MessageBox(NULL, text, title, style);
static bool callNativeRoutine(RexxActivity *activity, RexxString *name, RexxObject **arguments, size_t argcount, size_t named_argcount, ProtectedObject &result)
bool callExternalRexx(RexxString *, RexxObject **, size_t, size_t, RexxString *, ProtectedObject &)
bool callMacroSpaceFunction(RexxString *, RexxObject **, size_t, size_t, RexxString *, int, ProtectedObject &)
static bool invokeExternalFunction(RexxActivation *, RexxActivity *, RexxString *, RexxObject **, size_t, size_t, RexxString *, ProtectedObject &)
static RexxObject * popEnvironment(RexxActivation *context)
static RexxObject * pushEnvironment(RexxActivation *context)
static void restoreEnvironment(void *CurrentEnv)
#define Rexx_Error_Invalid_argument_range
#define Rexx_Error_Incorrect_call_list
struct _RexxStringObject * RexxStringObject
struct _RexxArrayObject * RexxArrayObject
static bool addMBStyle(CSTRING other, ULONG *style)
RexxRoutine1(RexxStringObject, sysDirectory, OPTIONAL_CSTRING, dir)
RexxRoutine2(CSTRING, sysBeep, wholenumber_t, Frequency, wholenumber_t, Duration)
#define FILESPEC_LOCATION
RexxRoutine5(int, sysMessageBox, CSTRING, text, OPTIONAL_CSTRING, title, OPTIONAL_CSTRING, button, OPTIONAL_CSTRING, icon, OPTIONAL_CSTRING, other)
struct _ENVENTRY ENVENTRY
#define FILESPEC_EXTENSION