home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 28 / amigaformatcd28.iso / -seriously_amiga- / comms / other / rxsocket / rmh.doc < prev    next >
Encoding:
Text File  |  1998-05-09  |  12.9 KB  |  599 lines

  1. ----------------------------------------------------------------------------------------------------
  2.  
  3.                                 RMH.LIBRARY
  4.                                 version 1.5
  5.  
  6.                                MINI MINI DOC
  7.  
  8. ----------------------------------------------------------------------------------------------------
  9.  
  10.                                   WARNING
  11.             THIS SOFTWARE AND INFORMATION ARE PROVIDED "AS IS".
  12.               ALL USE IS AT YOUR OWN RISK, AND NO LIABILITY OR
  13.                          RESPONSIBILITY IS ASSUMED.
  14.                           NO WARRANTIES ARE MADE.
  15.  
  16. ----------------------------------------------------------------------------------------------------
  17.  
  18.                                    INDEX
  19.  
  20.  1. Introdution
  21.  2. Installation
  22.  3. System Requirements
  23.  4. Author
  24.  5. Distribution
  25.  6. Terms
  26.  7. Bugs
  27.  8. Functions in alphabetic order
  28.  
  29. ----------------------------------------------------------------------------------------------------
  30.  
  31. 1. Introdution
  32.  
  33. The name of the library stands for RexxMusthave, so the library is a set
  34. of functions I think ARexx macros should have.
  35.  
  36. All resources created are automagically freed at the exit of the macro
  37. if it is not done in the macro.
  38.  
  39. ----------------------------------------------------------------------------------------------------
  40.  
  41. 2. Installation
  42.  
  43. No installation script is given.
  44.  
  45. To install the library:
  46. - copy rmh.library.library to LIBS:
  47. - write in a shell: rx "call addlib('rmh.library',0,-30)"
  48.  
  49. ----------------------------------------------------------------------------------------------------
  50.  
  51. 3. System Requirements
  52.  
  53. The library needs AmigaOS, version >=2.
  54.  
  55. ----------------------------------------------------------------------------------------------------
  56.  
  57. 4. Author
  58.  
  59. The author is:
  60.  
  61.     Alfonso Ranieri
  62.  
  63. His e-mail address is:
  64.  
  65.     alfier@iol.it
  66.  
  67. You can find him at:
  68.  
  69.     - #amichat    dalnet;
  70.     - #amigaita   ircnet;
  71.     - #amyita     ircnet.
  72.  
  73. You can find last version of this library at
  74.  
  75.     http://users.iol.it/alfier/
  76.  
  77. ----------------------------------------------------------------------------------------------------
  78.  
  79. 5. Distribution
  80.  
  81. rmh.library is FreeWare.
  82.  
  83. You are free to detribute it as long as the original archive is kept intact.
  84. Commercial use or its inclusion in other software package is prohibited
  85. without prior consens from the Author.
  86.  
  87. ----------------------------------------------------------------------------------------------------
  88.  
  89. 6. Terms
  90.  
  91. - stem or stemName: a valid ARexx variable name i.e. var, var.0, var.name, var;
  92.  
  93. - DateStam: a stem set by macro or returned by the function, with
  94.   the fields:
  95.   - DAYS"
  96.   - "MINUTE"
  97.   - "TICK
  98.   set;
  99.  
  100. - types of arguments: the types used are:
  101.   D   any data            --
  102.   N   numeric             /N
  103.   S   symbol              /S ARexx valid symbol
  104.   V   stemName            /V ARexx valid symbol as S but with length<20
  105.  
  106. ----------------------------------------------------------------------------------------------------
  107.  
  108. 7. Bugs
  109.  
  110.    None knonw.
  111.  
  112. ----------------------------------------------------------------------------------------------------
  113.  
  114. 8. Functions in alphabetic order:
  115.  
  116. --------------------------------
  117.  
  118. ADDPART
  119. Usage: complete = ADDPART(path,file)
  120. <path>,<file>
  121.  
  122. Adds a path to a file.
  123.  
  124. Returns the complete path to file.
  125.  
  126. --------------------------------
  127.  
  128. ALLOCSIGNAL
  129. Usage: sigBit = ALLOCSIGNAL()
  130. ---
  131.  
  132. Allocates an returns a signal bit.
  133. The mask to wait for is 2**sigBit.
  134.  
  135. Returns -1 for failure
  136.  
  137. --------------------------------
  138.  
  139. AND
  140. Usage: res = AND(val1,val2,..)
  141. <val1/N>,<val2/N>,{val/N}
  142.  
  143. And till to 15 integer.
  144.  
  145. --------------------------------
  146.  
  147. CHECKTIMER
  148. Usage: res = CHECKTIMER(timerid)
  149. <timerid/N>
  150.  
  151. Check if a timer completed.
  152. If the timer was not started, the function returns 1, as the timer
  153. completed. See StartTimer().
  154.  
  155. Returs an arexx boolean.
  156.  
  157. --------------------------------
  158.  
  159. COMPAREDATES
  160. Usage: res = COMPAREDATES(date1,date2)
  161. <date1/V>,<date2/V>
  162.  
  163. Compares 2 dates set as DateStamp.
  164.  
  165. Returns:
  166. -1 date1>date2
  167.  0 date1==date2
  168.  1 date1>date2
  169.  
  170. --------------------------------
  171.  
  172. CREATETIMER
  173. Usage: CREATETIMER()
  174.  
  175. Creates a timer. See StartTimer().
  176.  
  177. Returns the id of the timer.
  178.  
  179. --------------------------------
  180.  
  181. DELETEVAR
  182. Usage: DELETEVAR(name,[options])
  183. <name>,[options]
  184.  
  185. Deletes the var name.
  186.  
  187. If present, options is one or more of:
  188. - "VAR"
  189. - "ALIAS"
  190. - "IGNORE"
  191. - "GLOBAL"
  192. - "BINARY"
  193. - "NTNULL"
  194. - "SAVE"
  195. i.e. "VAR GLOBAL"
  196. The default is "VAR GLOBAL"
  197.  
  198. --------------------------------
  199.  
  200. EASYREQUEST
  201. Usage: res = EASYREQUEST(text,title,gadgetText,screenName,flags,idcmp)
  202. <text>,[title],[gadgetText],[screeName],[NOFALLBACK],[idcmp/N]
  203.  
  204. Creates and shows and intuition easy requester.
  205.  
  206. - text is the text of the requester
  207.  
  208. - title is the title (default "Arexx Macro Request")
  209.  
  210. - gadgetText is the string for gadgets text; each gadgetText must be
  211.   separeted by the other with a | (i.e "a|b|c" creates 3 gadgets a b c)
  212.  
  213. - screenName is the name of a pubblic screen where to open the requester
  214.  
  215. - "FALLBACK", if present as the 5th argument makes the function to not
  216.   open the requester on the default pubblic screen if the screenName
  217.   dosn't exist, but to fail
  218.  
  219. - idcmp is an integer value of IDCMP flags wich will stop the requesters
  220.  
  221. The text and gadgetText can't contain % but followed by an another %.
  222. Gadget are counted from left to right and first is number 1, last 0.
  223.  
  224. Returns:
  225.  
  226. -20   the requester was not created
  227. -30   the window was not created (indicates no screen too)
  228.  -1   idcmp received
  229.   0   last gadget pressed
  230. n>=0  gadget number n pressed
  231.  
  232. --------------------------------
  233.  
  234. EXPAND
  235. Usage: num = EXPAND(stem,pattern,[FILE|DIR])
  236. <stem/V>,<pattern>,[FILE|DIR]
  237.  
  238. Reads entries which match pattern given.
  239. The entries are written in the fields .i the given stem and the
  240. entry type is written in .i.DIRENTRYTYPE , where i = 0...num-1.
  241.  
  242. Normally every kind of entries are read, but if the 3nd argument is:
  243. - FILE only files are read
  244. - DIR  only dir are read
  245.  
  246. Returns the numbers of entries that match pattern.
  247.  
  248. --------------------------------
  249.  
  250. FAULT
  251. Usage: FAULT(code,name)
  252. <code/N>,<name>
  253.  
  254. Builds and returns the string:
  255.  
  256. <name>":" <dos error string of code>
  257.  
  258. --------------------------------
  259.  
  260. FILEPART
  261. Usage: FILEPART(path)
  262. <path>
  263.  
  264. Returns the file part of a path.
  265.  
  266. --------------------------------
  267.  
  268. FORMATDATE
  269. Usage: FORMATDATE(date,fmt,locale)
  270. [date/V],[fmt],[locale]
  271.  
  272. Returns a formatted date string.
  273.  
  274. If date is present, it must be a stem set as a DateStamp and the date
  275. is read from it. If it is not present, the date is the current system
  276. date.
  277.  
  278. If fmt is present, it must be a valid locale/FormatDate format string.
  279. If it is not present, it is the short date format of the locale.
  280.  
  281. If locale is given, the functions tries to open the locale to format
  282. the date in that locale way. If it is not present, locale is the
  283. default locale of the system.
  284.  
  285. --------------------------------
  286.  
  287. FREESIGNAL
  288. Usage: call FREESIGNAL(signal)
  289. <signal/N>
  290.  
  291. Free an allocated signal bit.
  292.  
  293. --------------------------------
  294.  
  295. FREETIMER
  296. Usage: call FREETIMER(timerid)
  297. <timerid/N>
  298.  
  299. Free a timer allocated by CreateTimer().
  300. The timer id can't be used anymore, after a call to this function.
  301.  
  302. --------------------------------
  303.  
  304. GETFILEDATE
  305. Usage: res = GETFILEDATE(fileName,date)
  306. <fileName>,<date/V>
  307.  
  308. Reads the date of a file and set date as a DateStamp struct.
  309.  
  310. Returns:
  311. 0 the file was not found
  312. 1 success
  313.  
  314. --------------------------------
  315.  
  316. GETUNIQUEID
  317. Usage: res GETUNIQUEID()
  318.  
  319. Each call to this function returns an unique integer.
  320.  
  321. --------------------------------
  322.  
  323. GETVAR
  324. Usage: GETVAR(name,options)
  325. <name>,[options]
  326.  
  327. Gets the value of the var name.
  328.  
  329. If present, options is one or more of:
  330. - "VAR"
  331. - "ALIAS"
  332. - "IGNORE"
  333. - "GLOBAL"
  334. - "BINARY"
  335. - "NTNULL"
  336. - "SAVE"
  337. i.e. "VAR GLOBAL"
  338. The default is "VAR".
  339.  
  340. --------------------------------
  341.  
  342. HELP
  343. Usage: HELP(funName)
  344. <funName>
  345.  
  346. Returns the arguments types mask of the function funName.
  347.  
  348. --------------------------------
  349.  
  350. IOERR
  351. Usage: IOERR()
  352.  
  353. Returns the current I/O error code.
  354.  
  355. --------------------------------
  356.  
  357. MATCHPATTERN
  358. Usage: res = MATCHPATTERN(pattern,string,[CASE])
  359. <pattern>,<string>,[CASE]
  360.  
  361. Verifies if string match pattern.
  362.  
  363. pattern must be the result of ParsePattern().
  364. If the 3rd argument CASE is given, the matching is case sensitive.
  365.  
  366. --------------------------------
  367.  
  368. OR
  369. Usage: OR(val1,val2,...)
  370. <val1/N>,<val2/N>,{val/N}
  371.  
  372. Or till to 15 integers.
  373.  
  374. --------------------------------
  375.  
  376. PARSEDATE
  377. Usage: PARSEDATE(string,fmt,stem,locale)
  378. <string>,[fmt],[stem],[locale]
  379.  
  380. Verify if string is a well formatted date according to fmt.
  381.  
  382. If fmt is present, it must be a valid locale/ParseDate format string.
  383. If it is not present, it is the short date format of the locale.
  384.  
  385. If stem is givin, sets it as a dateStamps.
  386.  
  387. If locale is given, the functions tries to open the locale to parse
  388. the date in that locale way. If it is not present, locale is the
  389. default locale of the system.
  390.  
  391. Returns an arexx boolean.
  392.  
  393. --------------------------------
  394.  
  395. PARSEPATTERN
  396. Usage: pattern = PARSEPATTERN(pattern,CASE)
  397. <pattern>,[CASE]
  398.  
  399. Creates an returns a pattern to be use with MatchPattern().
  400. If the 2nd argument CASE is given, the parsing is case sensitive.
  401.  
  402. --------------------------------
  403.  
  404. PATHPART
  405. Usage: PATHPART(path)
  406. <path>
  407.  
  408. Returns the path part of a path.
  409.  
  410. --------------------------------
  411.  
  412. PORTSIGNAL
  413. Usage: PORTSIGNAL(portName)
  414. <portName>
  415.  
  416. Return the signal bit of a in-macro-created port.
  417.  
  418. --------------------------------
  419.  
  420. PRINTFAULT
  421. Usage: PRINTFAULT(code,msg)
  422. <code/N>,<msg>
  423.  
  424. Prints to STDERR/STDOUT the same string fault() would return.
  425.  
  426. --------------------------------
  427.  
  428. PROGRAMNAME
  429. Usage: PROGRAMNAME(FULL)
  430. [FULL]
  431.  
  432. Returns the "program name" of the macro.
  433.  
  434. If FULL is given the complete path is returned.
  435. If FULL is not given just the macro name is returned.
  436.  
  437. --------------------------------
  438.  
  439. READARGS
  440. Usage: res = READARGS(<template>,[help],[stem/V],[args])
  441. <template>,[help],[stem/V],[args]
  442.  
  443. Calls dos/ReadArgs().
  444.  
  445. - template is the template of the arguments
  446.  
  447. - help is the help string to prompt when a ? is given (default TEMPLATE itself)
  448.  
  449. - var is the stem nme where to write the arguments (default "PARM")
  450.  
  451. - args is the arguments line for an online arguments parsing, not from STDIN
  452.  
  453. If STDERR is opend with (i.e. by open(STDERR,"*","W") ) all intermedie I/O
  454. is made with it.
  455.  
  456. The function writes (lets supposed "PARM" is the stem name), counting
  457. them arguments from left to right:
  458.  
  459. - i.value the value of the argument
  460.  
  461. - i.flag arexx boolean indicating if the arguments was give
  462.  
  463. - i.mult   number of MULTI if /M givien for argument i
  464.   i.value.j multi value j of arguments i (j = 0 ... i.mult)
  465.  
  466. EXAMPLE
  467.  
  468.     /* */
  469.  
  470.     if ~ReadArgs("FILE/M/A,BUFFER=BUFF/N,QUICK/S") then do
  471.         call PrintFault(IoErr(),ProgramName())
  472.         exit
  473.     end
  474.  
  475.     if parm.1.flag then say "BUFFER:" parm.1.value
  476.     if parm.2.flag then say "QUICK"
  477.  
  478.     say "FILE(s):" parm.0.mult
  479.     do i = 0 to parm.0.mult
  480.  
  481.         num = expand("F",parm.0.value.i)
  482.         do j = 0 to num-1
  483.             say f.j
  484.         end
  485.  
  486.     end
  487.  
  488.  
  489. --------------------------------
  490.  
  491. READTEXTCLIP
  492. Usage: res = READTEXTCLIP(var,clip/N)
  493. <var>,[clip/N]
  494.  
  495. Reads in var the text content of the clipborad unit clip.
  496.  
  497. Returns an arexx boolean.
  498.  
  499. --------------------------------
  500.  
  501. SETFILEDATE
  502. Usage: res = SETFILEDATE(fileName,date)
  503. <fileName>,<date/V>
  504.  
  505. Sets the date of a file from date, a DateStamp set stem.
  506.  
  507. Returns an arexx boolean.
  508.  
  509. --------------------------------
  510.  
  511. SETIOERR
  512. Usage: call SETIOERR(code)
  513. <code/N>
  514.  
  515. Sets the current I/O error code.
  516.  
  517. --------------------------------
  518.  
  519. SETVAR
  520. Usage: res = SETVAR(name,value,options)
  521. <name>,<value>,[options]
  522.  
  523. Sets the var name to the value value.
  524.  
  525. If present, options is one or more of:
  526. - "VAR"
  527. - "ALIAS"
  528. - "IGNORE"
  529. - "GLOBAL"
  530. - "BINARY"
  531. - "NTNULL"
  532. - "SAVE"
  533. i.e. "VAR GLOBAL"
  534. The default is "VAR GLOBAL"
  535.  
  536. --------------------------------
  537.  
  538. SIGNAL
  539. Usage: call SIGNAL(task,signals)
  540. <task/N>,<signals/N>
  541.  
  542. Signals the task with signal.
  543.  
  544. --------------------------------
  545.  
  546. STARTTIMER
  547. Usage: call STARTTIMER(timerid,secs,micros)
  548. <timerid/N>,[secs/N],[micros/N]
  549.  
  550. Starts a timer to wait for secs seconds and micros microseconds.
  551. The timer is started async, so you can go on doing what you want
  552. after this call. To wait for the timer to complete just make a
  553. wait to Wait() with its signal bit obteined with timerSignal().
  554. If the timer was already started, it is stopped and re-started
  555. with new values.
  556.  
  557. If the timer is not stopped or not freed, it is stopped and freed
  558. at the exit of the macro.
  559.  
  560. Returns always 1.
  561.  
  562. --------------------------------
  563.  
  564. STOPTIMER
  565. Usage: call STOPTIMER(timerid)
  566. <timerid/N>
  567.  
  568. Stop a timer.
  569. Returns always 1, even if the timer was not started.
  570.  
  571. --------------------------------
  572.  
  573. TIMERSIGNAL
  574. Usage: signal = TIMERSIGNAL(timerid)
  575. <timerid/N>
  576.  
  577. Returns the signal.
  578. The mask to wait for is signal.
  579.  
  580. --------------------------------
  581.  
  582. WAIT
  583. Usage: WAIT(signals,secs,micros)
  584. <signals/N>,[secs/N],[micros/N]
  585.  
  586. Waits for signals or sec seconds and micros microsends of timeout.
  587.  
  588. Returns the signals received or 0 is timeout.
  589.  
  590. --------------------------------
  591.  
  592. WRITETEXTCLIP
  593. Usage: WRITETEXTCLIP(text,clip)
  594. <text>,[clip/N]
  595.  
  596. Writes a text in the clipboard units clip.
  597.  
  598. --------------------------------
  599.