home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / rximc175.zip / THE-2.7-rexximc.patch < prev    next >
Text File  |  1999-02-10  |  3KB  |  64 lines

  1. You will probably want to apply this patch to THE-2.7 if you compile it with
  2. REXX/imc.  Normally it registers its functions in lower case, which means
  3. that if you write incommand() it will not be found (unquoted function names
  4. are uppercased before they are searched for).  This makes THE register the
  5. functions in both upper and lower case.
  6.  
  7. --- rexx.c.orig    Mon Dec 28 05:05:00 1998
  8. +++ rexx.c    Wed Feb 10 16:46:36 1999
  9. @@ -111,6 +111,36 @@
  10.  #else
  11.  #endif
  12.  
  13. +#if !defined(USE_REXX6000)
  14. +/***********************************************************************/
  15. +/* This hack is by imc (sorry) - when registering external functions,  */
  16. +/* register both the original name and the name in upper case, so as   */
  17. +/* to satisfy case sensitive interpreters.                             */
  18. +/***********************************************************************/
  19. +static ULONG MyRexxRegisterFunctionExe
  20. +#if defined(HAVE_PROTO)
  21. +   (
  22. +   RRFE_ARG0_TYPE Name,      /* Name of function to be registered        */
  23. +   RRFE_ARG1_TYPE Entry)     /* Entry point of function to be registered */
  24. +#else
  25. +   (Name, Entry)
  26. +   RRFE_ARG0_TYPE Name;      /* Name of function to be registered        */
  27. +   RRFE_ARG1_TYPE Entry;     /* Entry point of function to be registered */
  28. +#endif
  29. +/***********************************************************************/
  30. +{
  31. +/*--------------------------- local data ------------------------------*/
  32. +   static CHARTYPE newname[80];
  33. +   ULONG rc;
  34. +/*--------------------------- processing ------------------------------*/
  35. +   rc=RexxRegisterFunctionExe(Name, Entry);
  36. +   if (rc != RXFUNC_OK || strlen(Name)+1 > (sizeof newname)/(sizeof (CHARTYPE)))
  37. +      return rc;
  38. +   strcpy((DEFCHAR *)newname, (DEFCHAR *)Name);
  39. +   make_upper(newname);
  40. +   return RexxRegisterFunctionExe(newname, Entry);
  41. +}
  42. +#endif /* !defined(USE_REXX6000) */
  43.  /***********************************************************************/
  44.  RSH_RETURN_TYPE THE_Commands
  45.  #if defined(HAVE_PROTO)
  46. @@ -483,7 +513,7 @@
  47.                                (RRFE_ARG1_TYPE)THE_Function_Handler,
  48.                                NULL);
  49.  #else
  50. -    rc = RexxRegisterFunctionExe((RRFE_ARG0_TYPE)function_item[i].name,
  51. +    rc = MyRexxRegisterFunctionExe((RRFE_ARG0_TYPE)function_item[i].name,
  52.                                   (RRFE_ARG1_TYPE)THE_Function_Handler);
  53.  #endif
  54.      if (rc != RXFUNC_OK)
  55. @@ -508,7 +538,7 @@
  56.                                (RRFE_ARG1_TYPE)THE_Function_Handler,
  57.                                NULL);
  58.  #else
  59. -       rc = RexxRegisterFunctionExe((RRFE_ARG0_TYPE)buf,
  60. +       rc = MyRexxRegisterFunctionExe((RRFE_ARG0_TYPE)buf,
  61.                                   (RRFE_ARG1_TYPE)THE_Function_Handler);
  62.  #endif
  63.         if (rc != RXFUNC_OK)
  64.