y_ini.inc 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. /**
  2. * <library name="y_ini">
  3. * <section>
  4. * Description
  5. * </section>
  6. * Reads the INI and also exports a number of functions to other "classes" for
  7. * easy reading of data files there.
  8. * <section>
  9. * Version
  10. * </section>
  11. * 1.5
  12. * <section>
  13. * Functions
  14. * </section>
  15. * <subsection>
  16. * Stock
  17. * </subsection><ul>
  18. * <symbol name="INI_Load">Loads an INI file using standard features.</symbol>
  19. * <symbol name="INI_ParseFile">Loads a file as an ini and distributes data.</symbol>
  20. * <symbol name="INI_GetEntryName">Gets the name of an INI item.</symbol>
  21. * <symbol name="INI_GetEntryText">Gets the value of an INI item.</symbol>
  22. * <symbol name="INI_Open">Opens an INI for writing.</symbol>
  23. * <symbol name="INI_Close">Closes an INI being written to.</symbol>
  24. * <symbol name="INI_SetTag">Sets a subheading in an INI fo subsequent writes.</symbol>
  25. * <symbol name="INI_WriteString">Writes a string to an INI.</symbol>
  26. * <symbol name="INI_WriteInt">Writes an int to an INI.</symbol>
  27. * <symbol name="INI_WriteFloat">Writes a float to an INI.</symbol>
  28. * <symbol name="INI_WriteHex">Writes a hex to an INI.</symbol>
  29. * <symbol name="INI_WriteBin">Writes a binary to an INI.</symbol>
  30. * <symbol name="INI_WriteBool">Writes a boolean to an INI.</symbol>
  31. * <symbol name="INI_RemoveEntry">Remove an entry from a file.</symbol>
  32. * </ul><subsection>
  33. * Static
  34. * </subsection><ul>
  35. * <symbol name="INI_WriteBuffer">Writes an INI's buffer to the file.</symbol>
  36. * <symbol name="INI_AddToBuffer">Adds a string to an INI buffer.</symbol>
  37. * </ul><subsection>
  38. * Inline
  39. * </subsection><ul>
  40. * <symbol name="INI_Int">Parse an integer INI entry.</symbol>
  41. * <symbol name="INI_Float">Parse a float INI entry.</symbol>
  42. * <symbol name="INI_Hex">Parse a hex INI entry.</symbol>
  43. * <symbol name="INI_Bin">Parse a binary INI entry.</symbol>
  44. * <symbol name="INI_Bool">Parse a binary INI entry.</symbol>
  45. * <symbol name="INI_String">Parse a string INI entry.</symbol>
  46. * </ul><section>
  47. * Definitions
  48. * </section><ul>
  49. * <symbol name="MAX_INI_TAG">Maximum length of an INI tagname.</symbol>
  50. * <symbol name="MAX_INI_ENTRY_NAME">Maximum length of an INI entry name.</symbol>
  51. * <symbol name="MAX_INI_ENTRY_TEXT">Maximum length of an INI's entries' value.</symbol>
  52. * <symbol name="MAX_INI_LINE">Maximum length of a line in a file.</symbol>
  53. * <symbol name="INI_NEW_LINE">String for new lines.</symbol>
  54. * <symbol name="INI_MAX_WRITES">Maximum concurrent files open for writing.</symbol>
  55. * <symbol name="MAX_INI_TAGS">Number of tags the buffer can hold data for at once.</symbol>
  56. * </ul><section>
  57. * Enums
  58. * </section><ul>
  59. * <symbol name="E_INI_WRITE">Storage for entries to be written.</symbol>
  60. * <symbol name="E_INI_TAGS">Data for tags with data.</symbol>
  61. * </ul><section>
  62. * Macros
  63. * </section><ul>
  64. * <symbol name="INI_Parse">Header for ini parsing functions.</symbol>
  65. * </ul><section>
  66. * Tags
  67. * </section><ul>
  68. * <symbol name="INI">Handle to an INI file being written to.</symbol>
  69. * </ul><section>
  70. * Variables
  71. * </section>
  72. * <subsection>
  73. * Static
  74. * </subsection><ul>
  75. * <symbol name="YSI_g_sINIWriteBuffer">Basic data to be written.</symbol>
  76. * <symbol name="YSI_g_sINIWritePos">Next slot to write to.</symbol>
  77. * <symbol name="YSI_g_sINITagPos">Next slot to add a tag to.</symbol>
  78. * <symbol name="YSI_g_sINICurrentTag">Pointer to the tag been writen to.</symbol>
  79. * <symbol name="YSI_g_sINIWriteTag">Data for tags,</symbol>
  80. * <symbol name="YSI_g_sINIWriteFile">Current files been written to.</symbol>
  81. * </ul>
  82. * </library>
  83. *//** *//*
  84. Legal:
  85. Version: MPL 1.1
  86. The contents of this file are subject to the Mozilla Public License Version
  87. 1.1 the "License"; you may not use this file except in compliance with
  88. the License. You may obtain a copy of the License at
  89. http://www.mozilla.org/MPL/
  90. Software distributed under the License is distributed on an "AS IS" basis,
  91. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  92. for the specific language governing rights and limitations under the
  93. License.
  94. The Original Code is the YSI framework.
  95. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  96. Portions created by the Initial Developer are Copyright C 2011
  97. the Initial Developer. All Rights Reserved.
  98. Contributors:
  99. Y_Less
  100. koolk
  101. JoeBullet/Google63
  102. g_aSlice/Slice
  103. Misiur
  104. samphunter
  105. tianmeta
  106. maddinat0r
  107. spacemud
  108. Crayder
  109. Dayvison
  110. Ahmad45123
  111. Zeex
  112. irinel1996
  113. Yiin-
  114. Chaprnks
  115. Konstantinos
  116. Masterchen09
  117. Southclaws
  118. PatchwerkQWER
  119. m0k1
  120. paulommu
  121. udan111
  122. Thanks:
  123. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  124. ZeeX - Very productive conversations.
  125. koolk - IsPlayerinAreaEx code.
  126. TheAlpha - Danish translation.
  127. breadfish - German translation.
  128. Fireburn - Dutch translation.
  129. yom - French translation.
  130. 50p - Polish translation.
  131. Zamaroht - Spanish translation.
  132. Los - Portuguese translation.
  133. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  134. me to strive to better.
  135. Pixels^ - Running XScripters where the idea was born.
  136. Matite - Pestering me to release it and using it.
  137. Very special thanks to:
  138. Thiadmer - PAWN, whose limits continue to amaze me!
  139. Kye/Kalcor - SA:MP.
  140. SA:MP Team past, present and future - SA:MP.
  141. Optional plugins:
  142. Gamer_Z - GPS.
  143. Incognito - Streamer.
  144. Me - sscanf2, fixes2, Whirlpool.
  145. */
  146. #if !defined _INC_y_ini
  147. #tryinclude "y_ini\y_ini_entry"
  148. #endif
  149. #if !defined _INC_y_ini
  150. #tryinclude "YSI_Storage\y_ini\y_ini_entry"
  151. #endif
  152. #if !defined _INC_y_ini
  153. #tryinclude "YSI\YSI_Storage\y_ini\y_ini_entry"
  154. #endif
  155. #if !defined _INC_y_ini
  156. #tryinclude <YSI_Storage\y_ini\y_ini_entry>
  157. #endif
  158. #if !defined _INC_y_ini
  159. #tryinclude <YSI\YSI_Storage\y_ini\y_ini_entry>
  160. #endif
  161. #if !defined _INC_y_ini
  162. #error Could not find y_ini
  163. #endif