objpas.xml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. <?xml version="1.0" encoding="ISO8859-1"?>
  2. <fpdoc-descriptions>
  3. <!--
  4. $Id$
  5. This file is part of the FPC documentation.
  6. Copyright (C) 1997, by Michael Van Canneyt
  7. The FPC documentation is free text; you can redistribute it and/or
  8. modify it under the terms of the GNU Library General Public License as
  9. published by the Free Software Foundation; either version 2 of the
  10. License, or (at your option) any later version.
  11. The FPC Documentation is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. Library General Public License for more details.
  15. You should have received a copy of the GNU Library General Public
  16. License along with the FPC documentation; see the file COPYING.LIB. If not,
  17. write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  18. Boston, MA 02111-1307, USA.
  19. -->
  20. <package name="rtl">
  21. <module name="objpas">
  22. <short>Objpas - Delphi and objfpc mode system overrides</short>
  23. <descr>
  24. <p>
  25. The <file>objpas</file> unit is meant for compatibility with Object Pascal as
  26. implemented by Delphi. The unit is loaded automatically by the Free Pascal compiler
  27. whenever the <var>Delphi</var> or <var>objfpc</var> more is entered, either through
  28. the command line switches <var>-Sd</var> or <var>-Sh</var> or with the
  29. <var>{$MODE DELPHI}</var> or <var>{$MODE OBJFPC}</var> directives.
  30. </p>
  31. <p>
  32. It redefines some basic pascal types, introduces some functions for
  33. compatibility with Delphi's system unit, and introduces some methods for the
  34. management of the resource string tables.
  35. </p>
  36. </descr>
  37. <element name="TResourceIterator">
  38. <short>Enumeration callback type for resource strings</short>
  39. <descr>
  40. <p>
  41. The resource string tables can be managed with a callback function which the
  42. user must provide: <var>TResourceIterator</var>.
  43. </p>
  44. </descr>
  45. </element>
  46. <element name="AssignFile">
  47. <short>Assign text or untyped file</short>
  48. <descr>
  49. <p>
  50. <var>AssignFile</var> is completely equivalent to the system unit's <link
  51. id="#rtl.system.Assign">Assign</link>
  52. function: It assigns <var>Name</var> to a function of any type (<var>FileType</var>
  53. can be <var>Text</var> or a typed or untyped <var>File</var> variable). <var>Name</var> can
  54. be a string, a single character or a <var>PChar</var>.
  55. </p>
  56. <p>
  57. It is most likely introduced to avoid confusion between the regular
  58. <link id="#rtl.system.Assign">Assign</link> function and the <var>Assign</var> method of <var>TPersistent</var>
  59. in the Delphi VCL.
  60. </p>
  61. </descr>
  62. <errors>
  63. None.
  64. </errors>
  65. <seealso>
  66. <link id="CloseFile"/>
  67. <link id="#rtl.system.Assign"/>
  68. <link id="#rtl.system.Reset"/>
  69. <link id="#rtl.system.Rewrite"/>
  70. <link id="#rtl.system.Append"/>
  71. </seealso>
  72. <example file="refex/ex88"/>
  73. </element>
  74. <element name="CloseFile">
  75. <short>Close text or untyped file </short>
  76. <descr>
  77. <p>
  78. <var>CloseFile</var> flushes and closes a file <var>F</var> of any file type.
  79. <var>F</var> can be <var>Text</var> or a typed or untyped <var>File</var> variable.
  80. After a call to <var>CloseFile</var>, any attempt to write to the file <var>F</var>
  81. will result in an error.
  82. </p>
  83. <p>
  84. It is most likely introduced to avoid confusion between the regular
  85. <link id="#rtl.system.Close">Close</link> function and the <var>Close</var> method of <var>TForm</var>
  86. in the Delphi VCL.
  87. </p>
  88. <p>
  89. for an example, see <link id="AssignFile"/>.
  90. </p>
  91. </descr>
  92. <errors>
  93. None.
  94. </errors>
  95. <seealso>
  96. <link id="#rtl.system.Close"/>
  97. <link id="AssignFile"/>
  98. <link id="#rtl.system.Reset"/>
  99. <link id="#rtl.system.Rewrite"/>
  100. <link id="#rtl.system.Append"/>
  101. </seealso>
  102. </element>
  103. <element name="Freemem">
  104. <short>Free memory</short>
  105. <descr>
  106. <p>
  107. <var>FreeMem</var> releases the memory reserved by a call to
  108. <link id="objpasgetmem">GetMem</link>. The (optional) <var>Size</var> parameter is
  109. ignored, since the object pascal version of <var>GetMem</var> stores the amount
  110. of memory that was requested.
  111. </p>
  112. <p>
  113. Be sure not to release memory that was not obtained with the <var>Getmem</var>
  114. call in <file>Objpas</file>. Normally, this should not happen, since objpas
  115. changes the default memory manager to it's own memory manager.
  116. </p>
  117. </descr>
  118. <errors>
  119. None.
  120. </errors>
  121. <seealso>
  122. <link id="#rtl.system.Freemem"/>
  123. <link id="Getmem"/>
  124. </seealso>
  125. <example file="refex/ex89"/>
  126. </element>
  127. <element name="Getmem">
  128. <short>Allocate memory on the heap</short>
  129. <descr>
  130. <p>
  131. <var>GetMem</var> reserves <var>Size</var> bytes of memory on the heap and returns
  132. a pointer to it in <var>P</var>. <var>Size</var> is stored at offset -4 of the
  133. result, and is used to release the memory again. <var>P</var> can be a typed or
  134. untyped pointer.
  135. </p>
  136. <p>
  137. Be sure to release this memory with the <link id="objpasfreemem">FreeMem</link> call
  138. defined in the <file>objpas</file> unit.
  139. </p>
  140. <p>
  141. For an example, see <link id="objpasfreemem">FreeMem</link>.
  142. </p>
  143. </descr>
  144. <errors>
  145. In case no more memory is available, and no more memory could be obtained
  146. from the system a run-time error is triggered.
  147. </errors>
  148. <seealso>
  149. <link id="objpasfreemem">FreeMem</link>
  150. <link id="Getmem"/>.
  151. </seealso>
  152. </element>
  153. <element name="GetResourceStringCurrentValue">
  154. <short>Return current value of resourcestring</short>
  155. <descr>
  156. <p>
  157. <var>GetResourceStringCurrentValue</var> returns the current value of the
  158. resourcestring in table <var>TableIndex</var> with index <var>StringIndex</var>.
  159. </p>
  160. <p>
  161. The current value depends on the system of internationalization that was
  162. used, and which language is selected when the program is executed.
  163. </p>
  164. </descr>
  165. <errors>
  166. If either <var>TableIndex</var> or <var>StringIndex</var> are out of range, then
  167. a empty string is returned.
  168. </errors>
  169. <seealso>
  170. <link id="SetResourceStrings"/>,
  171. <link id="GetResourceStringDefaultValue"/>,
  172. <link id="GetResourceStringHash"/>,
  173. <link id="GetResourceStringName"/>,
  174. <link id="ResourceStringTableCount"/>,
  175. <link id="ResourceStringCount"/>
  176. </seealso>
  177. <example file="refex/ex90"/>
  178. </element>
  179. <element name="GetResourceStringDefaultValue">
  180. <short>Return default (original) value of resourcestring</short>
  181. <descr>
  182. <p>
  183. <var>GetResourceStringDefaultValue</var> returns the default value of the
  184. resourcestring in table <var>TableIndex</var> with index <var>StringIndex</var>.
  185. </p>
  186. <p>
  187. The default value is the value of the string that appears in the source code
  188. of the programmer, and is compiled into the program.
  189. </p>
  190. </descr>
  191. <errors>
  192. If either <var>TableIndex</var> or <var>StringIndex</var> are out of range, then
  193. a empty string is returned.
  194. </errors>
  195. <seealso>
  196. <link id="SetResourceStrings"/>,
  197. <link id="GetResourceStringCurrentValue"/>,
  198. <link id="GetResourceStringHash"/>,
  199. <link id="GetResourceStringName"/>,
  200. <link id="ResourceStringTableCount"/>,
  201. <link id="ResourceStringCount"/>
  202. </seealso>
  203. <example file="refex/ex91"/>
  204. </element>
  205. <element name="GetResourceStringHash">
  206. <short>Return hash value of resource string</short>
  207. <descr>
  208. <p>
  209. <var>GetResourceStringHash</var> returns the hash value associated with the
  210. resource string in table <var>TableIndex</var>, with index <var>StringIndex</var>.
  211. </p>
  212. <p>
  213. The hash value is calculated from the default value of the resource string
  214. in a manner that gives the same result as the GNU <file>gettext</file> mechanism.
  215. It is stored in the resourcestring tables, so retrieval is faster than
  216. actually calculating the hash for each string.
  217. </p>
  218. <p>
  219. For an example, see <link id="Hash"/>.
  220. </p>
  221. </descr>
  222. <errors>
  223. If either <var>TableIndex</var> or <var>StringIndex</var> is zero, 0 is returned.
  224. </errors>
  225. <seealso>
  226. <link id="Hash"/>
  227. <link id="SetResourceStrings"/>,
  228. <link id="GetResourceStringDefaultValue"/>,
  229. <link id="GetResourceStringHash"/>,
  230. <link id="GetResourceStringName"/>,
  231. <link id="ResourceStringTableCount"/>,
  232. <link id="ResourceStringCount"/>
  233. </seealso>
  234. </element>
  235. <element name="GetResourceStringName">
  236. <short>Return name of resource string.</short>
  237. <descr>
  238. <p>
  239. <var>GetResourceStringName</var> returns the name of the resourcestring in table
  240. <var>TableIndex</var> with index <var>StringIndex</var>. The name of the string is
  241. always the unit name in which the string was declared, followed by a period
  242. and the name of the constant, all in lowercase.
  243. </p>
  244. <p>
  245. If a unit <file>MyUnit</file> declares a resourcestring <var>MyTitle</var> then the
  246. name returned will be <var>myunit.mytitle</var>. A resourcestring in the program file
  247. will have the name of the program prepended.
  248. </p>
  249. <p>
  250. The name returned by this function is also the name that is stored in the
  251. resourcestring file generated by the compiler.
  252. </p>
  253. <p>
  254. Strictly speaking, this information isn't necessary for the functioning
  255. of the program, it is provided only as a means to easier translation of
  256. strings.
  257. </p>
  258. </descr>
  259. <errors>
  260. If either <var>TableIndex</var> or <var>StringIndex</var> is zero, an empty string
  261. is returned.
  262. </errors>
  263. <seealso>
  264. <link id="SetResourceStrings"/>,
  265. <link id="GetResourceStringDefaultValue"/>,
  266. <link id="GetResourceStringHash"/>,
  267. <link id="GetResourceStringName"/>,
  268. <link id="ResourceStringTableCount"/>,
  269. <link id="ResourceStringCount"/>
  270. </seealso>
  271. <example file="refex/ex92"/>
  272. </element>
  273. <element name="Hash">
  274. <short>Create GNU Gettext hash value for a string</short>
  275. <descr>
  276. <var>Hash</var> calculates the hash value of the string <var>S</var> in a manner that
  277. is compatible with the GNU gettext hash value for the string. It is the same
  278. value that is stored in the Resource string tables, and which can be
  279. retrieved with the <link id="GetResourceStringHash"/> function call.
  280. </descr>
  281. <errors>
  282. None. In case the calculated hash value should be 0, the returned result
  283. will be -1.
  284. </errors>
  285. <seealso>
  286. <link id="GetResourceStringHash"/>,
  287. </seealso>
  288. <example file="refex/ex93"/>
  289. </element>
  290. <element name="Paramstr">
  291. <short>Return command-line parameter</short>
  292. <descr>
  293. <p>
  294. <var>ParamStr</var> returns the <var>Param</var>-th command-line parameter as an
  295. AnsiString. The system unit <link id="Paramstr"/> function limits the result to
  296. 255 characters, and is overridden with this function.
  297. </p>
  298. <p>
  299. The zeroeth command-line parameter contains the path of the executable.
  300. On some operating systems (BSD) it may be simply the command as typed
  301. on the command-line, because the OS does not offer a method to retrieve
  302. the full binary name.
  303. </p>
  304. <p>
  305. For an example, see <link id="#rtl.system.Paramstr"/>.
  306. </p>
  307. </descr>
  308. <errors>
  309. In case <var>Param</var> is an invalid value, an empty string is returned.
  310. </errors>
  311. <seealso>
  312. <link id="Paramstr"/>
  313. </seealso>
  314. </element>
  315. <element name="ReAllocMem">
  316. <short>Re-allocate memory</short>
  317. <descr>
  318. <p>
  319. <var>ReAllocMem</var> resizes the memory pointed to by <var>P</var> so it has size
  320. <var>Size</var>. The value of <var>P</var> may change during this operation.
  321. The contents of the memory pointed to by <var>P</var> (if any) will be copied to
  322. the new location, but may be truncated if the newly allocated memory block
  323. is smaller in size. If a larger block is allocated, only the used memory is
  324. initialized, extra memory will not be zeroed out.
  325. </p>
  326. <p>
  327. Note that <var>P</var> may be nil, in that case the behaviour of <var>ReAllocMem</var>
  328. is equivalent to <link id="Getmem"/>.
  329. </p>
  330. </descr>
  331. <errors>
  332. If no memory is available then a run-time error will occur.
  333. </errors>
  334. <seealso>
  335. <link id="Getmem"/>
  336. <link id="Freemem"/>
  337. </seealso>
  338. </element>
  339. <element name="ResetResourceTables">
  340. <short>Restore all resource strings to their declared values</short>
  341. <descr>
  342. <p>
  343. <var>ResetResourceTables</var> resets all resource strings to their default
  344. (i.e. as in the source code) values.
  345. </p>
  346. <p>
  347. Normally, this should never be called from a user's program. It is called
  348. in the initialization code of the <file>objpas</file> unit. However, if the
  349. resourcetables get messed up for some reason, this procedure will fix them
  350. again.
  351. </p>
  352. </descr>
  353. <errors>
  354. None.
  355. </errors>
  356. <seealso>
  357. <link id="SetResourceStrings"/>,
  358. <link id="GetResourceStringDefaultValue"/>,
  359. <link id="GetResourceStringHash"/>,
  360. <link id="GetResourceStringName"/>,
  361. <link id="ResourceStringTableCount"/>,
  362. <link id="ResourceStringCount"/>
  363. </seealso>
  364. </element>
  365. <element name="ResourceStringCount">
  366. <short>Return number of resource strins in table</short>
  367. <descr>
  368. <p>
  369. <var>ResourceStringCount</var> returns the number of resourcestrings in
  370. the table with index <var>TableIndex</var>. The strings in a particular table
  371. are numbered from <var>0</var> to <var>ResourceStringCount-1</var>, i.e. they're zero
  372. based.
  373. </p>
  374. <p>
  375. For an example, see <link id="GetResourceStringDefaultValue"/>
  376. </p>
  377. </descr>
  378. <errors>
  379. If an invalid <var>TableIndex</var> is given, <var>-1</var> is returned.
  380. </errors>
  381. <seealso>
  382. <link id="SetResourceStrings"/>,
  383. <link id="GetResourceStringCurrentValue"/>,
  384. <link id="GetResourceStringDefaultValue"/>,
  385. <link id="GetResourceStringHash"/>,
  386. <link id="GetResourceStringName"/>,
  387. <link id="ResourceStringTableCount"/>,
  388. </seealso>
  389. </element>
  390. <element name="ResourceStringTableCount">
  391. <short>Return number of resource string tables</short>
  392. <descr>
  393. <p>
  394. <var>ResourceStringTableCount</var> returns the number of resource string tables;
  395. this may be zero if no resource strings are used in a program.
  396. </p>
  397. <p>
  398. The tables are numbered from 0 to <var>ResourceStringTableCount-1</var>, i.e.
  399. they're zero based.
  400. </p>
  401. <p>
  402. For an example, see <link id="GetResourceStringDefaultValue"/>
  403. </p>
  404. </descr>
  405. <errors>
  406. </errors>
  407. <seealso>
  408. <link id="SetResourceStrings"/>,
  409. <link id="GetResourceStringDefaultValue"/>,
  410. <link id="GetResourceStringHash"/>,
  411. <link id="GetResourceStringName"/>,
  412. <link id="ResourceStringCount"/>
  413. </seealso>
  414. </element>
  415. <element name="SetResourceStrings">
  416. <short>Set values of all resource strings.</short>
  417. <descr>
  418. <p>
  419. <var>SetResourceStrings</var> calls <var>SetFunction</var> for all resourcestrings
  420. in the resourcestring tables and sets the resourcestring's current value
  421. to the value returned by <var>SetFunction</var>.
  422. </p>
  423. <p>
  424. The <var>Name</var>,<var>Value</var> and <var>Hash</var> parameters passed to the iterator
  425. function are the values stored in the tables.
  426. </p>
  427. </descr>
  428. <errors>
  429. None.
  430. </errors>
  431. <seealso>
  432. <link id="GetResourceStringCurrentValue"/>,
  433. <link id="GetResourceStringDefaultValue"/>,
  434. <link id="GetResourceStringHash"/>,
  435. <link id="GetResourceStringName"/>,
  436. <link id="ResourceStringTableCount"/>,
  437. <link id="ResourceStringCount"/>
  438. </seealso>
  439. <example file="refex/ex95"/>
  440. </element>
  441. <element name="SetResourceStringValue">
  442. <short>Set value of a resource string</short>
  443. <descr>
  444. <var>SetResourceStringValue</var> assigns <var>Value</var> to the resource string in
  445. table <var>TableIndex</var> with index <var>StringIndex</var>.
  446. </descr>
  447. <errors>
  448. </errors>
  449. <seealso>
  450. <link id="SetResourceStrings"/>,
  451. <link id="GetResourceStringCurrentValue"/>,
  452. <link id="GetResourceStringDefaultValue"/>,
  453. <link id="GetResourceStringHash"/>,
  454. <link id="GetResourceStringName"/>,
  455. <link id="ResourceStringTableCount"/>,
  456. <link id="ResourceStringCount"/>
  457. </seealso>
  458. <example file="refex/ex94"/>
  459. </element>
  460. <!-- constant Visibility: default -->
  461. <element name="MaxInt">
  462. <short>Maximum value for <link id="Integer"/> type.</short>
  463. </element>
  464. <!-- alias type Visibility: default -->
  465. <element name="integer">
  466. <short>Redefinition of integer as 32-bit type.</short>
  467. <descr>
  468. In <var>OBJPAS</var> mode and in <var>DELPHI</var> mode, an
  469. <var>Integer</var> has a size of 32 bit. In TP or regular FPC mode, an
  470. integer is 16 bit.
  471. </descr>
  472. </element>
  473. <!-- alias type Visibility: default -->
  474. <element name="PString">
  475. <short>Pointer to ansistring type.</short>
  476. </element>
  477. <!-- array type Visibility: default -->
  478. <element name="IntegerArray">
  479. <short>Generic array of <link id="#rtl.objpas.integer">integer</link></short>
  480. </element>
  481. <!-- alias type Visibility: default -->
  482. <element name="TIntegerArray">
  483. <short>Alias for <link id="#rtl.objpas.IntegerArray">IntegerArray</link></short>
  484. </element>
  485. <!-- pointer type Visibility: default -->
  486. <element name="PIntegerArray">
  487. <short>Pointer to <link id="#rtl.objpas.TIntegerArray">TIntegerArray</link> type.</short>
  488. <descr>
  489. </descr>
  490. <seealso>
  491. </seealso>
  492. </element>
  493. <!-- array type Visibility: default -->
  494. <element name="PointerArray">
  495. <short>Generic Array of pointers.</short>
  496. </element>
  497. <!-- alias type Visibility: default -->
  498. <element name="TPointerArray">
  499. <short>Alias for <link id="#rtl.objpas.PointerArray">PointerArray</link></short>
  500. </element>
  501. <!-- pointer type Visibility: default -->
  502. <element name="PPointerArray">
  503. <short>Pointer to <link id="#rtl.objpas.PointerArray">PointerArray</link></short>
  504. </element>
  505. <!-- array type Visibility: default -->
  506. <element name="TBoundArray">
  507. <short>Array of integer, used in interfaces.</short>
  508. </element>
  509. <!-- pointer type Visibility: default -->
  510. <element name="PResStringRec">
  511. <short>Pointer to ansistring (Delphi compatibility).</short>
  512. </element>
  513. <!-- alias type Visibility: default -->
  514. <element name="TResStringRec">
  515. <short>Ansistring record in resource table (Delphi compatibility).</short>
  516. </element>
  517. <!-- function Visibility: default -->
  518. <element name="LoadResString">
  519. <short>Load resource string</short>
  520. </element>
  521. </module>
  522. </package>
  523. </fpdoc-descriptions>