unixutil.xml 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <fpdoc-descriptions>
  3. <package name="rtl">
  4. <!--
  5. ====================================================================
  6. unixutil
  7. ====================================================================
  8. -->
  9. <module name="unixutil">
  10. <short>Unix utility routines.</short>
  11. <descr>
  12. <p>
  13. The <file>UnixUtil</file> unit contains some of the routines that were
  14. present in the old <file>Linux</file> unit, but which do not really belong
  15. in the <link id="#rtl.unix">unix</link> or <link id="#rtl.baseunix">baseunix</link>
  16. units.
  17. </p>
  18. <p>
  19. Most of the functions described here have cross-platform counterparts in the
  20. <link id="#rtl.sysutils">SysUtils</link> unit. It is therefore recommended
  21. to use that unit.
  22. </p>
  23. </descr>
  24. <!-- variable Visibility: default -->
  25. <element name="tzseconds">
  26. <short>Seconds west of GMT</short>
  27. </element>
  28. <element name="ComStr">
  29. <short>Command-line string type.</short>
  30. </element>
  31. <element name="PathStr">
  32. <short>Filename full path string type.</short>
  33. </element>
  34. <element name="DirStr">
  35. <short>Filename directory part string type.</short>
  36. </element>
  37. <element name="NameStr">
  38. <short>Filename name part string type.</short>
  39. </element>
  40. <element name="ExtStr">
  41. <short>Filename extension part string type.</short>
  42. </element>
  43. <!-- function Visibility: default -->
  44. <element name="Dirname">
  45. <short>Extract directory part from filename</short>
  46. <descr>
  47. <p>
  48. Returns the directory part of <var>Path</var>.
  49. The directory is the part of <var>Path</var> before the last slash,
  50. or empty if there is no slash.
  51. The last character of the result is not a slash, unless the directory is the
  52. root directory.
  53. </p>
  54. </descr>
  55. <errors>
  56. None.
  57. </errors>
  58. <seealso>
  59. <link id="BaseName"/>
  60. </seealso>
  61. <example file="unutilex/ex47"/>
  62. </element>
  63. <!-- function Visibility: default -->
  64. <element name="StringToPPChar">
  65. <short>Split string in list of null-terminated strings</short>
  66. <descr>
  67. <p>
  68. <var>StringToPPChar</var> splits the string <var>S</var> in words, replacing any
  69. whitespace with zero characters. It returns a pointer to an array of pchars
  70. that point to the first letters of the words in <var>S</var>. This array is terminated
  71. by a <var>Nil</var> pointer.
  72. </p>
  73. <p>
  74. The function does <em> not</em> add a zero character to the end of the string
  75. unless it ends on whitespace.
  76. </p>
  77. <p>
  78. The function reserves memory on the heap to store the array of <var>PChar</var>;
  79. The caller is responsible for freeing this memory.
  80. </p>
  81. <p>
  82. This function can be called to create arguments for the various <var>Exec</var>
  83. calls.
  84. </p>
  85. </descr>
  86. <errors>
  87. None.
  88. </errors>
  89. <seealso>
  90. <link id="ArrayStringToPPchar"/>
  91. <link id="#rtl.baseunix.FpExecve"/>
  92. </seealso>
  93. <example file="unutilex/ex70"/>
  94. </element>
  95. <!-- function Visibility: default -->
  96. <element name="ArrayStringToPPchar">
  97. <short>Concert an array of string to an array of null-terminated strings</short>
  98. <descr>
  99. <p>
  100. <var>ArrayStringToPPchar</var> creates an array of null-terminated strings
  101. that point to strings which are the same as the strings in the array
  102. <var>S</var>. The function returns a pointer to this array. The array and
  103. the strings it contains must be disposed of after being used, because it
  104. they are allocated on the heap.
  105. </p>
  106. <p>
  107. The <var>ReserveEntries</var> parameter tells <var>ArrayStringToPPchar</var>
  108. to allocate room at the end of the array for another <var>ReserveEntries</var>
  109. entries.
  110. </p>
  111. </descr>
  112. <errors>
  113. If not enough memory is available, an error may occur.
  114. </errors>
  115. <seealso>
  116. <link id="StringToPPChar"/>
  117. </seealso>
  118. </element>
  119. <!-- function Visibility: default -->
  120. <element name="Basename">
  121. <short>Return basename of a file</short>
  122. <descr>
  123. <p>
  124. Returns the filename part of <var>Path</var>, stripping off <var>Suf</var> if it
  125. exists.
  126. The filename part is the whole name if <var>Path</var> contains no slash,
  127. or the part of <var>Path</var> after the last slash.
  128. The last character of the result is not a slash, unless the directory is the
  129. root directory.
  130. </p>
  131. </descr>
  132. <errors>
  133. None.
  134. </errors>
  135. <seealso>
  136. <link id="DirName"/>
  137. </seealso>
  138. <example file="unutilex/ex48"/>
  139. </element>
  140. <!-- function Visibility: default -->
  141. <element name="FNMatch">
  142. <short>Check whether filename matches wildcard specification</short>
  143. <descr>
  144. <p>
  145. <var>FNMatch</var> returns <var>True</var> if the filename in <var>Name</var>
  146. matches the wildcard pattern in <var>Pattern</var>, <var>False</var> otherwise.
  147. </p>
  148. <p>
  149. <var>Pattern</var> can contain the wildcards <var>*</var> (match zero or more
  150. arbitrary characters) or <var>?</var> (match a single character).
  151. </p>
  152. </descr>
  153. <errors>
  154. None.
  155. </errors>
  156. <seealso>
  157. <link id="#rtl.unix.FSearch"/>
  158. </seealso>
  159. <example file="unutilex/ex69"/>
  160. </element>
  161. <!-- function Visibility: default -->
  162. <element name="GetFS">
  163. <short>Return file selector</short>
  164. <descr>
  165. <var>GetFS</var> returns the file selector that the kernel provided for your
  166. file. In principle you don' need this file selector. Only for some calls
  167. it is needed, such as the <link id="#rtl.baseunix.fpSelect"/> call or so.
  168. </descr>
  169. <errors>
  170. In case the file was not opened, then -1 is returned.
  171. </errors>
  172. <seealso>
  173. <link id="#rtl.baseunix.fpSelect"/>
  174. </seealso>
  175. <example file="unutilex/ex34"/>
  176. </element>
  177. <!-- procedure Visibility: default -->
  178. <element name="FSplit">
  179. <short>Split filename into path, name and extension</short>
  180. <descr>
  181. <var>FSplit</var> splits a full file name into 3 parts : A <var>Path</var>, a
  182. <var>Name</var> and an extension (in <var>ext</var>).
  183. The extension is taken to be all letters after the last dot (.).
  184. </descr>
  185. <errors>
  186. None.
  187. </errors>
  188. <seealso>
  189. <link id="#rtl.unix.FSearch"/>
  190. </seealso>
  191. <example file="unutilex/ex67"/>
  192. </element>
  193. <!-- function Visibility: default -->
  194. <element name="LocalToEpoch">
  195. <short>Convert local time to epoch (unix) time</short>
  196. <descr>
  197. Converts the Local time to epoch time (=Number of seconds since 00:00:00 , January 1,
  198. 1970 ).
  199. </descr>
  200. <errors>
  201. None
  202. </errors>
  203. <seealso>
  204. <link id="EpochToLocal"/>
  205. </seealso>
  206. <example file="unutilex/ex4"/>
  207. </element>
  208. <!-- procedure Visibility: default -->
  209. <element name="EpochToLocal">
  210. <short>Convert epoch time to local time</short>
  211. <descr>
  212. <p>
  213. Converts the epoch time (=Number of seconds since 00:00:00 , January 1,
  214. 1970, corrected for your time zone ) to local date and time.
  215. </p>
  216. <p>
  217. This function takes into account the timzeone settings of your system.
  218. </p>
  219. </descr>
  220. <errors>
  221. None
  222. </errors>
  223. <seealso>
  224. <link id="LocalToEpoch"/>
  225. </seealso>
  226. <example file="unutilex/ex3"/>
  227. </element>
  228. <!-- procedure Visibility: default -->
  229. <element name="JulianToGregorian">
  230. <short>Converts a julian date to a gregorian date</short>
  231. <descr>
  232. <var>JulianToGregorian</var> takes a julian day and converts it to a
  233. gregorian date. (Start of the Julian Date count is from 0 at 12 noon 1 JAN -4712
  234. (4713 BC),)
  235. </descr>
  236. <errors>
  237. None.
  238. </errors>
  239. <seealso>
  240. <link id="GregorianToJulian"/>
  241. </seealso>
  242. </element>
  243. <!-- function Visibility: default -->
  244. <element name="GregorianToJulian">
  245. <short>Converts a gregorian date to a julian date</short>
  246. <descr>
  247. <var>GregorianToJulian</var> takes a gregorian date and converts it to a
  248. Julian day.
  249. </descr>
  250. <errors>
  251. None.
  252. </errors>
  253. <seealso>
  254. <link id="JulianToGregorian"/>
  255. </seealso>
  256. </element>
  257. </module> <!-- unixutil -->
  258. </package>
  259. </fpdoc-descriptions>