home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 22 gnu / 22-gnu.zip / rexxmd11.zip / rexx-os2.el < prev    next >
Lisp/Scheme  |  1994-07-11  |  7KB  |  170 lines

  1. ;;; rexx-os2.el --- REXX completion and documentation for OS/2 external
  2. ;;;            functions for use with rexx-mode.el
  3. ;; Copyright (C) 1994 Scott Maxwell
  4.  
  5. ;; Maintainer: Scott Maxwell - scottmax@netcom.com
  6. ;; Keywords: rexx
  7.  
  8. ;; To add REXX external commands to your completion and documentation table,
  9. ;; add the following line to your .emacs:
  10. ;;    (setq rexx-additional-doc-files '("rexx-os2"))
  11. ;;
  12. ;; If you already define rexx-additional-doc-files, you can make a list
  13. ;; of packages like this:
  14. ;;    (setq rexx-additional-doc-files '("rexx-os2"
  15. ;;                      "rexxbase-doc"
  16. ;;                      "vxrexx-doc"))
  17. ;; You may have to reload Emacs for your changes to take affect.
  18.  
  19.  
  20. (setq rexx-external-function-table
  21.       (append
  22.        '(
  23.      ("rxfuncadd" . ("RxFuncAdd" "OS/2 REXX function"
  24.              "r=RxFuncAdd(name,module,procedure)\n
  25. RXFuncAdd registers external functions, making them available
  26. to all REXX sessions.  A return value of 0 indicates success.
  27. Generally, name and procedure are both the name of the function
  28. and module is the name of the DLL or external library file.
  29.  
  30. Example: Call RxFuncAdd(\"SysFileDelete\",\"RexxUtil\",\"SysFileDelete\"))"
  31.              nil 'rexx-rxfuncadd))
  32.      ("rxfuncdrop" . ("RxFuncDrop" "OS/2 REXX function" "r=RxFuncDrop(name)"))
  33.      ("rxfuncquery" . ("RxFuncQuery" "OS/2 REXX function" "r=RxFuncQuery(name)\n
  34. Returns 0 if function is registered, 1 if not."))
  35.      ("rxmessagebox" . ("RxMessageBox" "RexxUtil" "
  36. r=RxMessageBox(text, [title],[button],[icon])
  37.  
  38. Creates a message box.  The button defaults to OK and can be:
  39.     OK OKCANCEL CANCEL ENTER ENTERCANCEL RETRYCANCEL
  40.     ABORTRETRYIGNORE YESNO YESNOCANCEL
  41. The icon can be:
  42.     NONE HAND QUESTION EXCLAMATION ASTERISK
  43.     INFORMATION QUERY WARNING ERROR
  44. This cannot be used in a REXX program running in a commandline window."))
  45.      ("syscls" . ("SysCls" "RexxUtil" "CALL SysCls\n
  46. Clears the screen."))
  47.      ("syscreateobject" . ("SysCreateObject" "RexxUtil" "
  48. r=SysCreateObject(classname, title, location, [setup], [option]
  49.  
  50. Returns 1 if successful, 0 if not."))
  51.      ("syscurpos" . ("SysCurPos" "RexxUtil" "pos=SysCurPos([row],[col])\n
  52. Move the cursor to row,col if specified.
  53. Return current position as 'row col'."))
  54.      ("syscurstate" . ("SysCurState" "RexxUtil" "CALL SysCurState state\n
  55. Turn curson 'ON' or 'OFF'."))
  56.      ("sysderegisterclass" . ("SysDeregisterClass" "RexxUtil" "
  57. r=SysDeregisterClass(classname)
  58.  
  59. Returns 1 if successful, 0 if not."))
  60.      ("sysdestroyobject" . ("SysDestroyObject" "RexxUtil" "
  61. r=SysDestroyObject(name)
  62.  
  63. Returns 1 if successful, 0 if not."))
  64.      ("sysdriveinfo" . ("SysDriveInfo" "RexxUtil" "info=SysDriveInfo(drive)
  65.  
  66. Returns 'drive: free total label"))
  67.      ("sysdrivemap" . ("SysDriveMap" "RexxUtil" "
  68. map=SysDriveMap([drive],[opt])
  69.  
  70. drive specifies the drive to start from.
  71. opt can be 'USED' 'FREE' 'LOCAL' 'REMOTE' 'DETACHED'.
  72. Returns a list of drives, i.e. 'C: D: E:'"))
  73.      ("sysdropfuncs" . ("SysDropFuncs" "RexxUtil" "CALL SysDropFuncs\n
  74. Drops all RexxUtil functions."))
  75.      ("sysfiledelete" . ("SysFileDelete" "RexxUtil" "rc=SysFileDelete(file)\n
  76. Delete one file.  Return 0 if successful."))
  77.      ("sysfiletree" . ("SysFileTree" "RexxUtil" "
  78. CALL SysFileTree filespec,stem,[options],[attrib],[newattrib]
  79.  
  80. Returns a list of files, one per variable in stem, setting stem.0 to filecount.
  81. Options are:
  82.  'F'iles only
  83.  'D'irectories only
  84.  'B'oth files and directories
  85.  'S'can subdirectories
  86.  'T'ime field format is YY/MM/DD/HH/MM
  87.  'O'nly report full filenames
  88. The default is to return 'date time size attributes fullpath' for each file."))
  89.      ("sysfilesearch" . ("SysFileSearch" "RexxUtil" "
  90. CALL SysFileSearch string, file, stem, [options]
  91.  
  92. Search file for string, return all matched lines in stem, setting stem.0
  93. to match count.  Option may contain 'C' to change to case sensitive and/or
  94. 'N' to include line numbers in returned strings."))
  95.      ("sysgetea" . ("SysGetEA" "RexxUtil" "ea=SysGetEA(file,name,variable)
  96.  
  97. Retrieves extended attribute from file.  Returns 0 if successful.
  98. Places value in variable."))
  99.      ("sysgetkey" . ("SysGetKey" "RexxUtil" "key=SysGetKey([opt])\n
  100. Gets the next key from the keyboard.
  101. opt can be 'ECHO' (default) or 'NOECHO'."))
  102.      ("sysgetmessage" . ("SysGetMessage" "RexxUtil" "
  103. msg=SysGetMessage(num,[file],[str1],...[str0])
  104.  
  105. Returns the message associated with num."))
  106.      ("sysini" . ("SysIni" "RexxUtil"))
  107.      ("sysmkdir" . ("SysMkDir" "RexxUtil" "rc=SysMkDir(name)\n
  108. Create directory.  Returns 0 if successful."))
  109.      ("sysos2ver" . ("SysOS2Ver" "RexxUtil" "ver=SysOS2Ver()\n
  110. Version in form 'x.xx'"))
  111.      ("sysputea" . ("SysPutEA" "RexxUtil" "ea=SysPutEA(file,name,value)\n
  112. Writes value to extended attribute called name in file.
  113. Returns 0 if successful."))
  114.      ("sysqueryclasslist" . ("SysQueryClassList" "RexxUtil" "
  115. CALL SysQueryClassList stem
  116.  
  117. Returns a list of all WPS classes in stem, setting stem.0 to count."))
  118.      ("sysregisterobjectclass" . ("SysRegisterObjectClass" "RexxUtil" "
  119. r=SysRegisterObjectClass(classname,module)
  120.  
  121. Register a new WPS class contained in module.DLL.
  122. Returns 1 if successful."))
  123.      ("sysrmdir" . ("SysRmDir" "RexxUtil" "rc=SysRmDir(name)\n
  124. Remove directory.  Returns 0 if successful."))
  125.      ("syssearchpath" . ("SysSearchPath" "RexxUtil" "
  126. spath=SysSearchPath(path,filename)
  127.  
  128. path specifies an environment variable.
  129. Return the first location of filename in the path."))
  130.      ("sysseticon" . ("SysSetIcon" "RexxUtil" "
  131. r=SysSetIcon(filename,iconfilename)
  132.  
  133. Attaches icon to file.  Returns 1 if successful."))
  134.      ("syssetobjectdata" . ("SysSetObjectData" "RexxUtil" "
  135. r=SysSetObjectData(name,setup)
  136.  
  137. Returns 1 if successful."))
  138.      ("syssleep" . ("SysSleep" "RexxUtil" "CALL SysSleep secs"))
  139.      ("systempfilename" . ("SysTempFileName" "RexxUtil" "
  140. file=SysTempFileName(template,[filter])
  141.  
  142. Returns a unique filename given template.  Template is generally of
  143. the form \"C:\OS2\??TMP.???\", having up to 5 filter characters.
  144. Filter specifies an alternative filter character to '?'."))
  145.      ("systextscreenread" . ("SysTextScreenRead" "RexxUtil" "
  146. string=SysTextScreenRead(row,col,[len])
  147.  
  148. Reads characters from the screen into string.  If len is not specified,
  149. reads to the end of the screen."))
  150.      ("systextscreensize" . ("SysTextScreenSize" "RexxUtil" "
  151. size=SysTextScreenSize()
  152.  
  153. Returns 'row col'."))
  154.      ("syswaitnamedpipe" . ("SysWaitNamedPipe" "RexxUtil" "
  155. r=SysWaitNamedPipe(name,[timeout])
  156.  
  157. timeout specifies the number of microseconds to wait.  If not
  158. specified, waits the default time.  -1 specifies to wait until
  159. not busy.
  160.  
  161. Returns 0 if not busy, 2 if not found, 231 if timed-out.")))
  162.        rexx-external-function-table))
  163.  
  164. (defun rexx-rxfuncadd ()
  165.   (let* ((funcname (rexx-complete-external "Name of function to register: "))
  166.      (package (or
  167.            (elt (assoc (downcase funcname) rexx-external-function-table) 2)
  168.            (read-string "Name of package: "))))
  169.     (insert "\"" funcname "\",\"" package "\",\"" funcname "\"")))
  170.