re28.html 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>&lt;GKeyFile&gt;: </title>
  6. <meta name="generator" content="DocBook XSL Stylesheets V1.79.2">
  7. <link rel="home" href="index.html" title="">
  8. <link rel="up" href="ch01.html" title="GLib">
  9. <link rel="prev" href="re27.html" title="&lt;%GLibIOStatus&gt;">
  10. <link rel="next" href="re29.html" title="&lt;%GLibKeyFileError&gt;">
  11. <meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
  12. <link rel="stylesheet" href="style.css" type="text/css">
  13. </head>
  14. <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
  15. <table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
  16. <td width="100%" align="left" class="shortcuts"></td>
  17. <td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
  18. <td><img src="up-insensitive.png" width="16" height="16" border="0"></td>
  19. <td><a accesskey="p" href="re27.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
  20. <td><a accesskey="n" href="re29.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
  21. </tr></table>
  22. <div class="refentry">
  23. <a name="id-1.1.29"></a><div class="titlepage"></div>
  24. <div class="refnamediv">
  25. <h2>&lt;GKeyFile&gt;</h2>
  26. <p>&lt;GKeyFile&gt;</p>
  27. </div>
  28. <div class="refsect1">
  29. <a name="id-1.1.29.2"></a><h2>Description</h2>
  30. <p>The GKeyFile struct contains only private data
  31. and should not be accessed directly.</p>
  32. </div>
  33. <div class="refsect1">
  34. <a name="id-1.1.29.3"></a><h2>Functions</h2>
  35. <div class="refsect2">
  36. <a name="id-1.1.29.3.2"></a><h3>get-boolean?</h3>
  37. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-boolean? self group-name key))
  38. </pre></div>
  39. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as a
  40. boolean.
  41. </p>
  42. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">FALSE</code> is returned and <em class="parameter"><code>error</code></em> is set
  43. to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the value
  44. associated with <em class="parameter"><code>key</code></em> cannot be interpreted as a boolean then <code class="constant">FALSE</code>
  45. is returned and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  46. <div class="refsect3">
  47. <a name="id-1.1.29.3.2.5"></a><h4>Parameters</h4>
  48. <div class="informaltable"><table>
  49. <tr>
  50. <td class="parameter_name"><p>key_file</p></td>
  51. <td class="parameter_description">
  52. <p>a <span class="type">GKeyFile</span></p>
  53. <p>Passed as <code class="code">self</code></p>
  54. </td>
  55. </tr>
  56. <tr>
  57. <td class="parameter_name"><p>group_name</p></td>
  58. <td class="parameter_description">
  59. <p>a group name</p>
  60. <p>Passed as <code class="code">group-name</code></p>
  61. </td>
  62. </tr>
  63. <tr>
  64. <td class="parameter_name"><p>key</p></td>
  65. <td class="parameter_description">
  66. <p>a key</p>
  67. <p>Passed as <code class="code">key</code></p>
  68. </td>
  69. </tr>
  70. </table></div>
  71. </div>
  72. </div>
  73. <div class="refsect2">
  74. <a name="id-1.1.29.3.3"></a><h3>get-boolean-list</h3>
  75. <div class="informalexample"><pre class="programlisting">(define-values
  76. (%return length)
  77. (key-file:get-boolean-list self group-name key))
  78. </pre></div>
  79. <p>Returns the values associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as
  80. booleans.
  81. </p>
  82. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set to
  83. <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the values associated
  84. with <em class="parameter"><code>key</code></em> cannot be interpreted as booleans then <code class="constant">NULL</code> is returned
  85. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  86. <div class="refsect3">
  87. <a name="id-1.1.29.3.3.5"></a><h4>Parameters</h4>
  88. <div class="informaltable"><table>
  89. <tr>
  90. <td class="parameter_name"><p>key_file</p></td>
  91. <td class="parameter_description">
  92. <p>a <span class="type">GKeyFile</span></p>
  93. <p>Passed as <code class="code">self</code></p>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td class="parameter_name"><p>group_name</p></td>
  98. <td class="parameter_description">
  99. <p>a group name</p>
  100. <p>Passed as <code class="code">group-name</code></p>
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class="parameter_name"><p>key</p></td>
  105. <td class="parameter_description">
  106. <p>a key</p>
  107. <p>Passed as <code class="code">key</code></p>
  108. </td>
  109. </tr>
  110. <tr>
  111. <td class="parameter_name"><p>length</p></td>
  112. <td class="parameter_description">
  113. <p>the number of booleans returned</p>
  114. <p>Inferred from <code class="code">%return</code></p>
  115. </td>
  116. </tr>
  117. </table></div>
  118. </div>
  119. </div>
  120. <div class="refsect2">
  121. <a name="id-1.1.29.3.4"></a><h3>get-comment</h3>
  122. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-comment self group-name key))
  123. </pre></div>
  124. <p>Retrieves a comment above <em class="parameter"><code>key</code></em> from <em class="parameter"><code>group_name</code></em>.
  125. If <em class="parameter"><code>key</code></em> is <code class="constant">NULL</code> then <em class="parameter"><code>comment</code></em> will be read from above
  126. <em class="parameter"><code>group_name</code></em>. If both <em class="parameter"><code>key</code></em> and <em class="parameter"><code>group_name</code></em> are <code class="constant">NULL</code>, then
  127. <em class="parameter"><code>comment</code></em> will be read from above the first group in the file.
  128. </p>
  129. <p>Note that the returned string does not include the '#' comment markers,
  130. but does include any whitespace after them (on each line). It includes
  131. the line breaks between lines, but does not include the final line break.</p>
  132. <div class="refsect3">
  133. <a name="id-1.1.29.3.4.5"></a><h4>Parameters</h4>
  134. <div class="informaltable"><table>
  135. <tr>
  136. <td class="parameter_name"><p>key_file</p></td>
  137. <td class="parameter_description">
  138. <p>a <span class="type">GKeyFile</span></p>
  139. <p>Passed as <code class="code">self</code></p>
  140. </td>
  141. </tr>
  142. <tr>
  143. <td class="parameter_name"><p>group_name</p></td>
  144. <td class="parameter_description">
  145. <p>a group name, or <code class="constant">NULL</code></p>
  146. <p>Passed as <code class="code">group-name</code></p>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td class="parameter_name"><p>key</p></td>
  151. <td class="parameter_description">
  152. <p>a key</p>
  153. <p>Passed as <code class="code">key</code></p>
  154. </td>
  155. </tr>
  156. </table></div>
  157. </div>
  158. </div>
  159. <div class="refsect2">
  160. <a name="id-1.1.29.3.5"></a><h3>get-double</h3>
  161. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-double self group-name key))
  162. </pre></div>
  163. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as a
  164. double. If <em class="parameter"><code>group_name</code></em> is <code class="constant">NULL</code>, the start_group is used.
  165. </p>
  166. <p>If <em class="parameter"><code>key</code></em> cannot be found then 0.0 is returned and <em class="parameter"><code>error</code></em> is set to
  167. <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the value associated
  168. with <em class="parameter"><code>key</code></em> cannot be interpreted as a double then 0.0 is returned
  169. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  170. <div class="refsect3">
  171. <a name="id-1.1.29.3.5.5"></a><h4>Parameters</h4>
  172. <div class="informaltable"><table>
  173. <tr>
  174. <td class="parameter_name"><p>key_file</p></td>
  175. <td class="parameter_description">
  176. <p>a <span class="type">GKeyFile</span></p>
  177. <p>Passed as <code class="code">self</code></p>
  178. </td>
  179. </tr>
  180. <tr>
  181. <td class="parameter_name"><p>group_name</p></td>
  182. <td class="parameter_description">
  183. <p>a group name</p>
  184. <p>Passed as <code class="code">group-name</code></p>
  185. </td>
  186. </tr>
  187. <tr>
  188. <td class="parameter_name"><p>key</p></td>
  189. <td class="parameter_description">
  190. <p>a key</p>
  191. <p>Passed as <code class="code">key</code></p>
  192. </td>
  193. </tr>
  194. </table></div>
  195. </div>
  196. </div>
  197. <div class="refsect2">
  198. <a name="id-1.1.29.3.6"></a><h3>get-double-list</h3>
  199. <div class="informalexample"><pre class="programlisting">(define-values
  200. (%return length)
  201. (key-file:get-double-list self group-name key))
  202. </pre></div>
  203. <p>Returns the values associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as
  204. doubles.
  205. </p>
  206. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set to
  207. <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the values associated
  208. with <em class="parameter"><code>key</code></em> cannot be interpreted as doubles then <code class="constant">NULL</code> is returned
  209. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  210. <div class="refsect3">
  211. <a name="id-1.1.29.3.6.5"></a><h4>Parameters</h4>
  212. <div class="informaltable"><table>
  213. <tr>
  214. <td class="parameter_name"><p>key_file</p></td>
  215. <td class="parameter_description">
  216. <p>a <span class="type">GKeyFile</span></p>
  217. <p>Passed as <code class="code">self</code></p>
  218. </td>
  219. </tr>
  220. <tr>
  221. <td class="parameter_name"><p>group_name</p></td>
  222. <td class="parameter_description">
  223. <p>a group name</p>
  224. <p>Passed as <code class="code">group-name</code></p>
  225. </td>
  226. </tr>
  227. <tr>
  228. <td class="parameter_name"><p>key</p></td>
  229. <td class="parameter_description">
  230. <p>a key</p>
  231. <p>Passed as <code class="code">key</code></p>
  232. </td>
  233. </tr>
  234. <tr>
  235. <td class="parameter_name"><p>length</p></td>
  236. <td class="parameter_description">
  237. <p>the number of doubles returned</p>
  238. <p>Inferred from <code class="code">%return</code></p>
  239. </td>
  240. </tr>
  241. </table></div>
  242. </div>
  243. </div>
  244. <div class="refsect2">
  245. <a name="id-1.1.29.3.7"></a><h3>get-groups</h3>
  246. <div class="informalexample"><pre class="programlisting">(define-values (%return length) (key-file:get-groups self))
  247. </pre></div>
  248. <p>Returns all groups in the key file loaded with <em class="parameter"><code>key_file</code></em>.
  249. The array of returned groups will be <code class="constant">NULL</code>-terminated, so
  250. <em class="parameter"><code>length</code></em> may optionally be <code class="constant">NULL</code>.</p>
  251. <div class="refsect3">
  252. <a name="id-1.1.29.3.7.4"></a><h4>Parameters</h4>
  253. <div class="informaltable"><table>
  254. <tr>
  255. <td class="parameter_name"><p>key_file</p></td>
  256. <td class="parameter_description">
  257. <p>a <span class="type">GKeyFile</span></p>
  258. <p>Passed as <code class="code">self</code></p>
  259. </td>
  260. </tr>
  261. <tr>
  262. <td class="parameter_name"><p>length</p></td>
  263. <td class="parameter_description">
  264. <p>return location for the number of returned groups, or <code class="constant">NULL</code></p>
  265. <p>Passed as <code class="code">length</code></p>
  266. </td>
  267. </tr>
  268. </table></div>
  269. </div>
  270. </div>
  271. <div class="refsect2">
  272. <a name="id-1.1.29.3.8"></a><h3>get-int64</h3>
  273. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-int64 self group-name key))
  274. </pre></div>
  275. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as a signed
  276. 64-bit integer. This is similar to <code class="function">g_key_file_get_integer()</code> but can return
  277. 64-bit results without truncation.</p>
  278. <div class="refsect3">
  279. <a name="id-1.1.29.3.8.4"></a><h4>Parameters</h4>
  280. <div class="informaltable"><table>
  281. <tr>
  282. <td class="parameter_name"><p>key_file</p></td>
  283. <td class="parameter_description">
  284. <p>a non-<code class="constant">NULL</code> <span class="type">GKeyFile</span></p>
  285. <p>Passed as <code class="code">self</code></p>
  286. </td>
  287. </tr>
  288. <tr>
  289. <td class="parameter_name"><p>group_name</p></td>
  290. <td class="parameter_description">
  291. <p>a non-<code class="constant">NULL</code> group name</p>
  292. <p>Passed as <code class="code">group-name</code></p>
  293. </td>
  294. </tr>
  295. <tr>
  296. <td class="parameter_name"><p>key</p></td>
  297. <td class="parameter_description">
  298. <p>a non-<code class="constant">NULL</code> key</p>
  299. <p>Passed as <code class="code">key</code></p>
  300. </td>
  301. </tr>
  302. </table></div>
  303. </div>
  304. </div>
  305. <div class="refsect2">
  306. <a name="id-1.1.29.3.9"></a><h3>get-integer</h3>
  307. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-integer self group-name key))
  308. </pre></div>
  309. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as an
  310. integer.
  311. </p>
  312. <p>If <em class="parameter"><code>key</code></em> cannot be found then 0 is returned and <em class="parameter"><code>error</code></em> is set to
  313. <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the value associated
  314. with <em class="parameter"><code>key</code></em> cannot be interpreted as an integer, or is out of range
  315. for a <span class="type">gint</span>, then 0 is returned
  316. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  317. <div class="refsect3">
  318. <a name="id-1.1.29.3.9.5"></a><h4>Parameters</h4>
  319. <div class="informaltable"><table>
  320. <tr>
  321. <td class="parameter_name"><p>key_file</p></td>
  322. <td class="parameter_description">
  323. <p>a <span class="type">GKeyFile</span></p>
  324. <p>Passed as <code class="code">self</code></p>
  325. </td>
  326. </tr>
  327. <tr>
  328. <td class="parameter_name"><p>group_name</p></td>
  329. <td class="parameter_description">
  330. <p>a group name</p>
  331. <p>Passed as <code class="code">group-name</code></p>
  332. </td>
  333. </tr>
  334. <tr>
  335. <td class="parameter_name"><p>key</p></td>
  336. <td class="parameter_description">
  337. <p>a key</p>
  338. <p>Passed as <code class="code">key</code></p>
  339. </td>
  340. </tr>
  341. </table></div>
  342. </div>
  343. </div>
  344. <div class="refsect2">
  345. <a name="id-1.1.29.3.10"></a><h3>get-integer-list</h3>
  346. <div class="informalexample"><pre class="programlisting">(define-values
  347. (%return length)
  348. (key-file:get-integer-list self group-name key))
  349. </pre></div>
  350. <p>Returns the values associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as
  351. integers.
  352. </p>
  353. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set to
  354. <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. Likewise, if the values associated
  355. with <em class="parameter"><code>key</code></em> cannot be interpreted as integers, or are out of range for
  356. <span class="type">gint</span>, then <code class="constant">NULL</code> is returned
  357. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_INVALID_VALUE</span>.</p>
  358. <div class="refsect3">
  359. <a name="id-1.1.29.3.10.5"></a><h4>Parameters</h4>
  360. <div class="informaltable"><table>
  361. <tr>
  362. <td class="parameter_name"><p>key_file</p></td>
  363. <td class="parameter_description">
  364. <p>a <span class="type">GKeyFile</span></p>
  365. <p>Passed as <code class="code">self</code></p>
  366. </td>
  367. </tr>
  368. <tr>
  369. <td class="parameter_name"><p>group_name</p></td>
  370. <td class="parameter_description">
  371. <p>a group name</p>
  372. <p>Passed as <code class="code">group-name</code></p>
  373. </td>
  374. </tr>
  375. <tr>
  376. <td class="parameter_name"><p>key</p></td>
  377. <td class="parameter_description">
  378. <p>a key</p>
  379. <p>Passed as <code class="code">key</code></p>
  380. </td>
  381. </tr>
  382. <tr>
  383. <td class="parameter_name"><p>length</p></td>
  384. <td class="parameter_description">
  385. <p>the number of integers returned</p>
  386. <p>Inferred from <code class="code">%return</code></p>
  387. </td>
  388. </tr>
  389. </table></div>
  390. </div>
  391. </div>
  392. <div class="refsect2">
  393. <a name="id-1.1.29.3.11"></a><h3>get-keys</h3>
  394. <div class="informalexample"><pre class="programlisting">(define-values (%return length) (key-file:get-keys self group-name))
  395. </pre></div>
  396. <p>Returns all keys for the group name <em class="parameter"><code>group_name</code></em>. The array of
  397. returned keys will be <code class="constant">NULL</code>-terminated, so <em class="parameter"><code>length</code></em> may
  398. optionally be <code class="constant">NULL</code>. In the event that the <em class="parameter"><code>group_name</code></em> cannot
  399. be found, <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set to
  400. <span class="type">G_KEY_FILE_ERROR_GROUP_NOT_FOUND</span>.</p>
  401. <div class="refsect3">
  402. <a name="id-1.1.29.3.11.4"></a><h4>Parameters</h4>
  403. <div class="informaltable"><table>
  404. <tr>
  405. <td class="parameter_name"><p>key_file</p></td>
  406. <td class="parameter_description">
  407. <p>a <span class="type">GKeyFile</span></p>
  408. <p>Passed as <code class="code">self</code></p>
  409. </td>
  410. </tr>
  411. <tr>
  412. <td class="parameter_name"><p>group_name</p></td>
  413. <td class="parameter_description">
  414. <p>a group name</p>
  415. <p>Passed as <code class="code">group-name</code></p>
  416. </td>
  417. </tr>
  418. <tr>
  419. <td class="parameter_name"><p>length</p></td>
  420. <td class="parameter_description">
  421. <p>return location for the number of keys returned, or <code class="constant">NULL</code></p>
  422. <p>Passed as <code class="code">length</code></p>
  423. </td>
  424. </tr>
  425. </table></div>
  426. </div>
  427. </div>
  428. <div class="refsect2">
  429. <a name="id-1.1.29.3.12"></a><h3>get-locale-for-key</h3>
  430. <div class="informalexample"><pre class="programlisting">(define-values
  431. (%return)
  432. (key-file:get-locale-for-key self group-name key locale))
  433. </pre></div>
  434. <p>Returns the actual locale which the result of
  435. <code class="function">g_key_file_get_locale_string()</code> or <code class="function">g_key_file_get_locale_string_list()</code>
  436. came from.
  437. </p>
  438. <p>If calling <code class="function">g_key_file_get_locale_string()</code> or
  439. <code class="function">g_key_file_get_locale_string_list()</code> with exactly the same <em class="parameter"><code>key_file</code></em>,
  440. <em class="parameter"><code>group_name</code></em>, <em class="parameter"><code>key</code></em> and <em class="parameter"><code>locale</code></em>, the result of those functions will
  441. have originally been tagged with the locale that is the result of
  442. this function.</p>
  443. <div class="refsect3">
  444. <a name="id-1.1.29.3.12.5"></a><h4>Parameters</h4>
  445. <div class="informaltable"><table>
  446. <tr>
  447. <td class="parameter_name"><p>key_file</p></td>
  448. <td class="parameter_description">
  449. <p>a <span class="type">GKeyFile</span></p>
  450. <p>Passed as <code class="code">self</code></p>
  451. </td>
  452. </tr>
  453. <tr>
  454. <td class="parameter_name"><p>group_name</p></td>
  455. <td class="parameter_description">
  456. <p>a group name</p>
  457. <p>Passed as <code class="code">group-name</code></p>
  458. </td>
  459. </tr>
  460. <tr>
  461. <td class="parameter_name"><p>key</p></td>
  462. <td class="parameter_description">
  463. <p>a key</p>
  464. <p>Passed as <code class="code">key</code></p>
  465. </td>
  466. </tr>
  467. <tr>
  468. <td class="parameter_name"><p>locale</p></td>
  469. <td class="parameter_description">
  470. <p>a locale identifier or <code class="constant">NULL</code></p>
  471. <p>Passed as <code class="code">locale</code></p>
  472. </td>
  473. </tr>
  474. </table></div>
  475. </div>
  476. </div>
  477. <div class="refsect2">
  478. <a name="id-1.1.29.3.13"></a><h3>get-locale-string</h3>
  479. <div class="informalexample"><pre class="programlisting">(define-values
  480. (%return)
  481. (key-file:get-locale-string self group-name key locale))
  482. </pre></div>
  483. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>
  484. translated in the given <em class="parameter"><code>locale</code></em> if available. If <em class="parameter"><code>locale</code></em> is
  485. <code class="constant">NULL</code> then the current locale is assumed.
  486. </p>
  487. <p>If <em class="parameter"><code>locale</code></em> is to be non-<code class="constant">NULL</code>, or if the current locale will change over
  488. the lifetime of the <span class="type">GKeyFile</span>, it must be loaded with
  489. <code class="constant">G_KEY_FILE_KEEP_TRANSLATIONS</code> in order to load strings for all locales.
  490. </p>
  491. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set
  492. to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. If the value associated
  493. with <em class="parameter"><code>key</code></em> cannot be interpreted or no suitable translation can
  494. be found then the untranslated value is returned.</p>
  495. <div class="refsect3">
  496. <a name="id-1.1.29.3.13.6"></a><h4>Parameters</h4>
  497. <div class="informaltable"><table>
  498. <tr>
  499. <td class="parameter_name"><p>key_file</p></td>
  500. <td class="parameter_description">
  501. <p>a <span class="type">GKeyFile</span></p>
  502. <p>Passed as <code class="code">self</code></p>
  503. </td>
  504. </tr>
  505. <tr>
  506. <td class="parameter_name"><p>group_name</p></td>
  507. <td class="parameter_description">
  508. <p>a group name</p>
  509. <p>Passed as <code class="code">group-name</code></p>
  510. </td>
  511. </tr>
  512. <tr>
  513. <td class="parameter_name"><p>key</p></td>
  514. <td class="parameter_description">
  515. <p>a key</p>
  516. <p>Passed as <code class="code">key</code></p>
  517. </td>
  518. </tr>
  519. <tr>
  520. <td class="parameter_name"><p>locale</p></td>
  521. <td class="parameter_description">
  522. <p>a locale identifier or <code class="constant">NULL</code></p>
  523. <p>Passed as <code class="code">locale</code></p>
  524. </td>
  525. </tr>
  526. </table></div>
  527. </div>
  528. </div>
  529. <div class="refsect2">
  530. <a name="id-1.1.29.3.14"></a><h3>get-locale-string-list</h3>
  531. <div class="informalexample"><pre class="programlisting">(define-values
  532. (%return length)
  533. (key-file:get-locale-string-list self group-name key locale))
  534. </pre></div>
  535. <p>Returns the values associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>
  536. translated in the given <em class="parameter"><code>locale</code></em> if available. If <em class="parameter"><code>locale</code></em> is
  537. <code class="constant">NULL</code> then the current locale is assumed.
  538. </p>
  539. <p>If <em class="parameter"><code>locale</code></em> is to be non-<code class="constant">NULL</code>, or if the current locale will change over
  540. the lifetime of the <span class="type">GKeyFile</span>, it must be loaded with
  541. <code class="constant">G_KEY_FILE_KEEP_TRANSLATIONS</code> in order to load strings for all locales.
  542. </p>
  543. <p>If <em class="parameter"><code>key</code></em> cannot be found then <code class="constant">NULL</code> is returned and <em class="parameter"><code>error</code></em> is set
  544. to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. If the values associated
  545. with <em class="parameter"><code>key</code></em> cannot be interpreted or no suitable translations
  546. can be found then the untranslated values are returned. The
  547. returned array is <code class="constant">NULL</code>-terminated, so <em class="parameter"><code>length</code></em> may optionally
  548. be <code class="constant">NULL</code>.</p>
  549. <div class="refsect3">
  550. <a name="id-1.1.29.3.14.6"></a><h4>Parameters</h4>
  551. <div class="informaltable"><table>
  552. <tr>
  553. <td class="parameter_name"><p>key_file</p></td>
  554. <td class="parameter_description">
  555. <p>a <span class="type">GKeyFile</span></p>
  556. <p>Passed as <code class="code">self</code></p>
  557. </td>
  558. </tr>
  559. <tr>
  560. <td class="parameter_name"><p>group_name</p></td>
  561. <td class="parameter_description">
  562. <p>a group name</p>
  563. <p>Passed as <code class="code">group-name</code></p>
  564. </td>
  565. </tr>
  566. <tr>
  567. <td class="parameter_name"><p>key</p></td>
  568. <td class="parameter_description">
  569. <p>a key</p>
  570. <p>Passed as <code class="code">key</code></p>
  571. </td>
  572. </tr>
  573. <tr>
  574. <td class="parameter_name"><p>locale</p></td>
  575. <td class="parameter_description">
  576. <p>a locale identifier or <code class="constant">NULL</code></p>
  577. <p>Passed as <code class="code">locale</code></p>
  578. </td>
  579. </tr>
  580. <tr>
  581. <td class="parameter_name"><p>length</p></td>
  582. <td class="parameter_description">
  583. <p>return location for the number of returned strings or <code class="constant">NULL</code></p>
  584. <p>Inferred from <code class="code">%return</code></p>
  585. </td>
  586. </tr>
  587. </table></div>
  588. </div>
  589. </div>
  590. <div class="refsect2">
  591. <a name="id-1.1.29.3.15"></a><h3>get-start-group</h3>
  592. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-start-group self))
  593. </pre></div>
  594. <p>Returns the name of the start group of the file.</p>
  595. <div class="refsect3">
  596. <a name="id-1.1.29.3.15.4"></a><h4>Parameters</h4>
  597. <div class="informaltable"><table><tr>
  598. <td class="parameter_name"><p>key_file</p></td>
  599. <td class="parameter_description">
  600. <p>a <span class="type">GKeyFile</span></p>
  601. <p>Passed as <code class="code">self</code></p>
  602. </td>
  603. </tr></table></div>
  604. </div>
  605. </div>
  606. <div class="refsect2">
  607. <a name="id-1.1.29.3.16"></a><h3>get-string</h3>
  608. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-string self group-name key))
  609. </pre></div>
  610. <p>Returns the string value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  611. Unlike <code class="function">g_key_file_get_value()</code>, this function handles escape sequences
  612. like \s.
  613. </p>
  614. <p>In the event the key cannot be found, <code class="constant">NULL</code> is returned and
  615. <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. In the
  616. event that the <em class="parameter"><code>group_name</code></em> cannot be found, <code class="constant">NULL</code> is returned
  617. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_GROUP_NOT_FOUND</span>.</p>
  618. <div class="refsect3">
  619. <a name="id-1.1.29.3.16.5"></a><h4>Parameters</h4>
  620. <div class="informaltable"><table>
  621. <tr>
  622. <td class="parameter_name"><p>key_file</p></td>
  623. <td class="parameter_description">
  624. <p>a <span class="type">GKeyFile</span></p>
  625. <p>Passed as <code class="code">self</code></p>
  626. </td>
  627. </tr>
  628. <tr>
  629. <td class="parameter_name"><p>group_name</p></td>
  630. <td class="parameter_description">
  631. <p>a group name</p>
  632. <p>Passed as <code class="code">group-name</code></p>
  633. </td>
  634. </tr>
  635. <tr>
  636. <td class="parameter_name"><p>key</p></td>
  637. <td class="parameter_description">
  638. <p>a key</p>
  639. <p>Passed as <code class="code">key</code></p>
  640. </td>
  641. </tr>
  642. </table></div>
  643. </div>
  644. </div>
  645. <div class="refsect2">
  646. <a name="id-1.1.29.3.17"></a><h3>get-string-list</h3>
  647. <div class="informalexample"><pre class="programlisting">(define-values
  648. (%return length)
  649. (key-file:get-string-list self group-name key))
  650. </pre></div>
  651. <p>Returns the values associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  652. </p>
  653. <p>In the event the key cannot be found, <code class="constant">NULL</code> is returned and
  654. <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. In the
  655. event that the <em class="parameter"><code>group_name</code></em> cannot be found, <code class="constant">NULL</code> is returned
  656. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_GROUP_NOT_FOUND</span>.</p>
  657. <div class="refsect3">
  658. <a name="id-1.1.29.3.17.5"></a><h4>Parameters</h4>
  659. <div class="informaltable"><table>
  660. <tr>
  661. <td class="parameter_name"><p>key_file</p></td>
  662. <td class="parameter_description">
  663. <p>a <span class="type">GKeyFile</span></p>
  664. <p>Passed as <code class="code">self</code></p>
  665. </td>
  666. </tr>
  667. <tr>
  668. <td class="parameter_name"><p>group_name</p></td>
  669. <td class="parameter_description">
  670. <p>a group name</p>
  671. <p>Passed as <code class="code">group-name</code></p>
  672. </td>
  673. </tr>
  674. <tr>
  675. <td class="parameter_name"><p>key</p></td>
  676. <td class="parameter_description">
  677. <p>a key</p>
  678. <p>Passed as <code class="code">key</code></p>
  679. </td>
  680. </tr>
  681. <tr>
  682. <td class="parameter_name"><p>length</p></td>
  683. <td class="parameter_description">
  684. <p>return location for the number of returned strings, or <code class="constant">NULL</code></p>
  685. <p>Inferred from <code class="code">%return</code></p>
  686. </td>
  687. </tr>
  688. </table></div>
  689. </div>
  690. </div>
  691. <div class="refsect2">
  692. <a name="id-1.1.29.3.18"></a><h3>get-uint64</h3>
  693. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-uint64 self group-name key))
  694. </pre></div>
  695. <p>Returns the value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em> as an unsigned
  696. 64-bit integer. This is similar to <code class="function">g_key_file_get_integer()</code> but can return
  697. large positive results without truncation.</p>
  698. <div class="refsect3">
  699. <a name="id-1.1.29.3.18.4"></a><h4>Parameters</h4>
  700. <div class="informaltable"><table>
  701. <tr>
  702. <td class="parameter_name"><p>key_file</p></td>
  703. <td class="parameter_description">
  704. <p>a non-<code class="constant">NULL</code> <span class="type">GKeyFile</span></p>
  705. <p>Passed as <code class="code">self</code></p>
  706. </td>
  707. </tr>
  708. <tr>
  709. <td class="parameter_name"><p>group_name</p></td>
  710. <td class="parameter_description">
  711. <p>a non-<code class="constant">NULL</code> group name</p>
  712. <p>Passed as <code class="code">group-name</code></p>
  713. </td>
  714. </tr>
  715. <tr>
  716. <td class="parameter_name"><p>key</p></td>
  717. <td class="parameter_description">
  718. <p>a non-<code class="constant">NULL</code> key</p>
  719. <p>Passed as <code class="code">key</code></p>
  720. </td>
  721. </tr>
  722. </table></div>
  723. </div>
  724. </div>
  725. <div class="refsect2">
  726. <a name="id-1.1.29.3.19"></a><h3>get-value</h3>
  727. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:get-value self group-name key))
  728. </pre></div>
  729. <p>Returns the raw value associated with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  730. Use <code class="function">g_key_file_get_string()</code> to retrieve an unescaped UTF-8 string.
  731. </p>
  732. <p>In the event the key cannot be found, <code class="constant">NULL</code> is returned and
  733. <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_KEY_NOT_FOUND</span>. In the
  734. event that the <em class="parameter"><code>group_name</code></em> cannot be found, <code class="constant">NULL</code> is returned
  735. and <em class="parameter"><code>error</code></em> is set to <span class="type">G_KEY_FILE_ERROR_GROUP_NOT_FOUND</span>.</p>
  736. <div class="refsect3">
  737. <a name="id-1.1.29.3.19.5"></a><h4>Parameters</h4>
  738. <div class="informaltable"><table>
  739. <tr>
  740. <td class="parameter_name"><p>key_file</p></td>
  741. <td class="parameter_description">
  742. <p>a <span class="type">GKeyFile</span></p>
  743. <p>Passed as <code class="code">self</code></p>
  744. </td>
  745. </tr>
  746. <tr>
  747. <td class="parameter_name"><p>group_name</p></td>
  748. <td class="parameter_description">
  749. <p>a group name</p>
  750. <p>Passed as <code class="code">group-name</code></p>
  751. </td>
  752. </tr>
  753. <tr>
  754. <td class="parameter_name"><p>key</p></td>
  755. <td class="parameter_description">
  756. <p>a key</p>
  757. <p>Passed as <code class="code">key</code></p>
  758. </td>
  759. </tr>
  760. </table></div>
  761. </div>
  762. </div>
  763. <div class="refsect2">
  764. <a name="id-1.1.29.3.20"></a><h3>has-group?</h3>
  765. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:has-group? self group-name))
  766. </pre></div>
  767. <p>Looks whether the key file has the group <em class="parameter"><code>group_name</code></em>.</p>
  768. <div class="refsect3">
  769. <a name="id-1.1.29.3.20.4"></a><h4>Parameters</h4>
  770. <div class="informaltable"><table>
  771. <tr>
  772. <td class="parameter_name"><p>key_file</p></td>
  773. <td class="parameter_description">
  774. <p>a <span class="type">GKeyFile</span></p>
  775. <p>Passed as <code class="code">self</code></p>
  776. </td>
  777. </tr>
  778. <tr>
  779. <td class="parameter_name"><p>group_name</p></td>
  780. <td class="parameter_description">
  781. <p>a group name</p>
  782. <p>Passed as <code class="code">group-name</code></p>
  783. </td>
  784. </tr>
  785. </table></div>
  786. </div>
  787. </div>
  788. <div class="refsect2">
  789. <a name="id-1.1.29.3.21"></a><h3>load-from-bytes?</h3>
  790. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:load-from-bytes? self bytes flags))
  791. </pre></div>
  792. <p>Loads a key file from the data in <em class="parameter"><code>bytes</code></em> into an empty <span class="type">GKeyFile</span> structure.
  793. If the object cannot be created then <code class="constant">error</code> is set to a <span class="type">GKeyFileError</span>.</p>
  794. <div class="refsect3">
  795. <a name="id-1.1.29.3.21.4"></a><h4>Parameters</h4>
  796. <div class="informaltable"><table>
  797. <tr>
  798. <td class="parameter_name"><p>key_file</p></td>
  799. <td class="parameter_description">
  800. <p>an empty <span class="type">GKeyFile</span> struct</p>
  801. <p>Passed as <code class="code">self</code></p>
  802. </td>
  803. </tr>
  804. <tr>
  805. <td class="parameter_name"><p>bytes</p></td>
  806. <td class="parameter_description">
  807. <p>a <span class="type">GBytes</span></p>
  808. <p>Passed as <code class="code">bytes</code></p>
  809. </td>
  810. </tr>
  811. <tr>
  812. <td class="parameter_name"><p>flags</p></td>
  813. <td class="parameter_description">
  814. <p>flags from <span class="type">GKeyFileFlags</span></p>
  815. <p>Passed as <code class="code">flags</code></p>
  816. </td>
  817. </tr>
  818. </table></div>
  819. </div>
  820. </div>
  821. <div class="refsect2">
  822. <a name="id-1.1.29.3.22"></a><h3>load-from-data?</h3>
  823. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:load-from-data? self data length flags))
  824. </pre></div>
  825. <p>Loads a key file from memory into an empty <span class="type">GKeyFile</span> structure.
  826. If the object cannot be created then <code class="constant">error</code> is set to a <span class="type">GKeyFileError</span>.</p>
  827. <div class="refsect3">
  828. <a name="id-1.1.29.3.22.4"></a><h4>Parameters</h4>
  829. <div class="informaltable"><table>
  830. <tr>
  831. <td class="parameter_name"><p>key_file</p></td>
  832. <td class="parameter_description">
  833. <p>an empty <span class="type">GKeyFile</span> struct</p>
  834. <p>Passed as <code class="code">self</code></p>
  835. </td>
  836. </tr>
  837. <tr>
  838. <td class="parameter_name"><p>data</p></td>
  839. <td class="parameter_description">
  840. <p>key file loaded in memory</p>
  841. <p>Passed as <code class="code">data</code></p>
  842. </td>
  843. </tr>
  844. <tr>
  845. <td class="parameter_name"><p>length</p></td>
  846. <td class="parameter_description">
  847. <p>the length of <em class="parameter"><code>data</code></em> in bytes (or (gsize)-1 if data is nul-terminated)</p>
  848. <p>Passed as <code class="code">length</code></p>
  849. </td>
  850. </tr>
  851. <tr>
  852. <td class="parameter_name"><p>flags</p></td>
  853. <td class="parameter_description">
  854. <p>flags from <span class="type">GKeyFileFlags</span></p>
  855. <p>Passed as <code class="code">flags</code></p>
  856. </td>
  857. </tr>
  858. </table></div>
  859. </div>
  860. </div>
  861. <div class="refsect2">
  862. <a name="id-1.1.29.3.23"></a><h3>load-from-data-dirs</h3>
  863. <div class="informalexample"><pre class="programlisting">(define-values
  864. (%return full-path)
  865. (key-file:load-from-data-dirs self file flags))
  866. </pre></div>
  867. <p>This function looks for a key file named <em class="parameter"><code>file</code></em> in the paths
  868. returned from <code class="function">g_get_user_data_dir()</code> and <code class="function">g_get_system_data_dirs()</code>,
  869. loads the file into <em class="parameter"><code>key_file</code></em> and returns the file's full path in
  870. <em class="parameter"><code>full_path</code></em>. If the file could not be loaded then an <code class="constant">error</code> is
  871. set to either a <span class="type">GFileError</span> or <span class="type">GKeyFileError</span>.</p>
  872. <div class="refsect3">
  873. <a name="id-1.1.29.3.23.4"></a><h4>Parameters</h4>
  874. <div class="informaltable"><table>
  875. <tr>
  876. <td class="parameter_name"><p>key_file</p></td>
  877. <td class="parameter_description">
  878. <p>an empty <span class="type">GKeyFile</span> struct</p>
  879. <p>Passed as <code class="code">self</code></p>
  880. </td>
  881. </tr>
  882. <tr>
  883. <td class="parameter_name"><p>file</p></td>
  884. <td class="parameter_description">
  885. <p>a relative path to a filename to open and parse</p>
  886. <p>Passed as <code class="code">file</code></p>
  887. </td>
  888. </tr>
  889. <tr>
  890. <td class="parameter_name"><p>full_path</p></td>
  891. <td class="parameter_description">
  892. <p>return location for a string containing the full path
  893. of the file, or <code class="constant">NULL</code></p>
  894. <p>Passed as <code class="code">full-path</code></p>
  895. </td>
  896. </tr>
  897. <tr>
  898. <td class="parameter_name"><p>flags</p></td>
  899. <td class="parameter_description">
  900. <p>flags from <span class="type">GKeyFileFlags</span></p>
  901. <p>Passed as <code class="code">flags</code></p>
  902. </td>
  903. </tr>
  904. </table></div>
  905. </div>
  906. </div>
  907. <div class="refsect2">
  908. <a name="id-1.1.29.3.24"></a><h3>load-from-dirs</h3>
  909. <div class="informalexample"><pre class="programlisting">(define-values
  910. (%return full-path)
  911. (key-file:load-from-dirs self file search-dirs flags))
  912. </pre></div>
  913. <p>This function looks for a key file named <em class="parameter"><code>file</code></em> in the paths
  914. specified in <em class="parameter"><code>search_dirs</code></em>, loads the file into <em class="parameter"><code>key_file</code></em> and
  915. returns the file's full path in <em class="parameter"><code>full_path</code></em>.
  916. </p>
  917. <p>If the file could not be found in any of the <em class="parameter"><code>search_dirs</code></em>,
  918. <code class="constant">G_KEY_FILE_ERROR_NOT_FOUND</code> is returned. If
  919. the file is found but the OS returns an error when opening or reading the
  920. file, a <code class="constant">G_FILE_ERROR</code> is returned. If there is a problem parsing the file, a
  921. <code class="constant">G_KEY_FILE_ERROR</code> is returned.</p>
  922. <div class="refsect3">
  923. <a name="id-1.1.29.3.24.5"></a><h4>Parameters</h4>
  924. <div class="informaltable"><table>
  925. <tr>
  926. <td class="parameter_name"><p>key_file</p></td>
  927. <td class="parameter_description">
  928. <p>an empty <span class="type">GKeyFile</span> struct</p>
  929. <p>Passed as <code class="code">self</code></p>
  930. </td>
  931. </tr>
  932. <tr>
  933. <td class="parameter_name"><p>file</p></td>
  934. <td class="parameter_description">
  935. <p>a relative path to a filename to open and parse</p>
  936. <p>Passed as <code class="code">file</code></p>
  937. </td>
  938. </tr>
  939. <tr>
  940. <td class="parameter_name"><p>search_dirs</p></td>
  941. <td class="parameter_description">
  942. <p><code class="constant">NULL</code>-terminated array of directories to search</p>
  943. <p>Passed as <code class="code">search-dirs</code></p>
  944. </td>
  945. </tr>
  946. <tr>
  947. <td class="parameter_name"><p>full_path</p></td>
  948. <td class="parameter_description">
  949. <p>return location for a string containing the full path
  950. of the file, or <code class="constant">NULL</code></p>
  951. <p>Passed as <code class="code">full-path</code></p>
  952. </td>
  953. </tr>
  954. <tr>
  955. <td class="parameter_name"><p>flags</p></td>
  956. <td class="parameter_description">
  957. <p>flags from <span class="type">GKeyFileFlags</span></p>
  958. <p>Passed as <code class="code">flags</code></p>
  959. </td>
  960. </tr>
  961. </table></div>
  962. </div>
  963. </div>
  964. <div class="refsect2">
  965. <a name="id-1.1.29.3.25"></a><h3>load-from-file?</h3>
  966. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:load-from-file? self file flags))
  967. </pre></div>
  968. <p>Loads a key file into an empty <span class="type">GKeyFile</span> structure.
  969. </p>
  970. <p>If the OS returns an error when opening or reading the file, a
  971. <code class="constant">G_FILE_ERROR</code> is returned. If there is a problem parsing the file, a
  972. <code class="constant">G_KEY_FILE_ERROR</code> is returned.
  973. </p>
  974. <p>This function will never return a <code class="constant">G_KEY_FILE_ERROR_NOT_FOUND</code> error. If the
  975. <em class="parameter"><code>file</code></em> is not found, <code class="constant">G_FILE_ERROR_NOENT</code> is returned.</p>
  976. <div class="refsect3">
  977. <a name="id-1.1.29.3.25.6"></a><h4>Parameters</h4>
  978. <div class="informaltable"><table>
  979. <tr>
  980. <td class="parameter_name"><p>key_file</p></td>
  981. <td class="parameter_description">
  982. <p>an empty <span class="type">GKeyFile</span> struct</p>
  983. <p>Passed as <code class="code">self</code></p>
  984. </td>
  985. </tr>
  986. <tr>
  987. <td class="parameter_name"><p>file</p></td>
  988. <td class="parameter_description">
  989. <p>the path of a filename to load, in the GLib filename encoding</p>
  990. <p>Passed as <code class="code">file</code></p>
  991. </td>
  992. </tr>
  993. <tr>
  994. <td class="parameter_name"><p>flags</p></td>
  995. <td class="parameter_description">
  996. <p>flags from <span class="type">GKeyFileFlags</span></p>
  997. <p>Passed as <code class="code">flags</code></p>
  998. </td>
  999. </tr>
  1000. </table></div>
  1001. </div>
  1002. </div>
  1003. <div class="refsect2">
  1004. <a name="id-1.1.29.3.26"></a><h3>remove-comment?</h3>
  1005. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:remove-comment? self group-name key))
  1006. </pre></div>
  1007. <p>Removes a comment above <em class="parameter"><code>key</code></em> from <em class="parameter"><code>group_name</code></em>.
  1008. If <em class="parameter"><code>key</code></em> is <code class="constant">NULL</code> then <em class="parameter"><code>comment</code></em> will be removed above <em class="parameter"><code>group_name</code></em>.
  1009. If both <em class="parameter"><code>key</code></em> and <em class="parameter"><code>group_name</code></em> are <code class="constant">NULL</code>, then <em class="parameter"><code>comment</code></em> will
  1010. be removed above the first group in the file.</p>
  1011. <div class="refsect3">
  1012. <a name="id-1.1.29.3.26.4"></a><h4>Parameters</h4>
  1013. <div class="informaltable"><table>
  1014. <tr>
  1015. <td class="parameter_name"><p>key_file</p></td>
  1016. <td class="parameter_description">
  1017. <p>a <span class="type">GKeyFile</span></p>
  1018. <p>Passed as <code class="code">self</code></p>
  1019. </td>
  1020. </tr>
  1021. <tr>
  1022. <td class="parameter_name"><p>group_name</p></td>
  1023. <td class="parameter_description">
  1024. <p>a group name, or <code class="constant">NULL</code></p>
  1025. <p>Passed as <code class="code">group-name</code></p>
  1026. </td>
  1027. </tr>
  1028. <tr>
  1029. <td class="parameter_name"><p>key</p></td>
  1030. <td class="parameter_description">
  1031. <p>a key</p>
  1032. <p>Passed as <code class="code">key</code></p>
  1033. </td>
  1034. </tr>
  1035. </table></div>
  1036. </div>
  1037. </div>
  1038. <div class="refsect2">
  1039. <a name="id-1.1.29.3.27"></a><h3>remove-group?</h3>
  1040. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:remove-group? self group-name))
  1041. </pre></div>
  1042. <p>Removes the specified group, <em class="parameter"><code>group_name</code></em>,
  1043. from the key file.</p>
  1044. <div class="refsect3">
  1045. <a name="id-1.1.29.3.27.4"></a><h4>Parameters</h4>
  1046. <div class="informaltable"><table>
  1047. <tr>
  1048. <td class="parameter_name"><p>key_file</p></td>
  1049. <td class="parameter_description">
  1050. <p>a <span class="type">GKeyFile</span></p>
  1051. <p>Passed as <code class="code">self</code></p>
  1052. </td>
  1053. </tr>
  1054. <tr>
  1055. <td class="parameter_name"><p>group_name</p></td>
  1056. <td class="parameter_description">
  1057. <p>a group name</p>
  1058. <p>Passed as <code class="code">group-name</code></p>
  1059. </td>
  1060. </tr>
  1061. </table></div>
  1062. </div>
  1063. </div>
  1064. <div class="refsect2">
  1065. <a name="id-1.1.29.3.28"></a><h3>remove-key?</h3>
  1066. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:remove-key? self group-name key))
  1067. </pre></div>
  1068. <p>Removes <em class="parameter"><code>key</code></em> in <em class="parameter"><code>group_name</code></em> from the key file.</p>
  1069. <div class="refsect3">
  1070. <a name="id-1.1.29.3.28.4"></a><h4>Parameters</h4>
  1071. <div class="informaltable"><table>
  1072. <tr>
  1073. <td class="parameter_name"><p>key_file</p></td>
  1074. <td class="parameter_description">
  1075. <p>a <span class="type">GKeyFile</span></p>
  1076. <p>Passed as <code class="code">self</code></p>
  1077. </td>
  1078. </tr>
  1079. <tr>
  1080. <td class="parameter_name"><p>group_name</p></td>
  1081. <td class="parameter_description">
  1082. <p>a group name</p>
  1083. <p>Passed as <code class="code">group-name</code></p>
  1084. </td>
  1085. </tr>
  1086. <tr>
  1087. <td class="parameter_name"><p>key</p></td>
  1088. <td class="parameter_description">
  1089. <p>a key name to remove</p>
  1090. <p>Passed as <code class="code">key</code></p>
  1091. </td>
  1092. </tr>
  1093. </table></div>
  1094. </div>
  1095. </div>
  1096. <div class="refsect2">
  1097. <a name="id-1.1.29.3.29"></a><h3>save-to-file?</h3>
  1098. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:save-to-file? self filename))
  1099. </pre></div>
  1100. <p>Writes the contents of <em class="parameter"><code>key_file</code></em> to <em class="parameter"><code>filename</code></em> using
  1101. <code class="function">g_file_set_contents()</code>. If you need stricter guarantees about durability of
  1102. the written file than are provided by <code class="function">g_file_set_contents()</code>, use
  1103. <code class="function">g_file_set_contents_full()</code> with the return value of <code class="function">g_key_file_to_data()</code>.
  1104. </p>
  1105. <p>This function can fail for any of the reasons that
  1106. <code class="function">g_file_set_contents()</code> may fail.</p>
  1107. <div class="refsect3">
  1108. <a name="id-1.1.29.3.29.5"></a><h4>Parameters</h4>
  1109. <div class="informaltable"><table>
  1110. <tr>
  1111. <td class="parameter_name"><p>key_file</p></td>
  1112. <td class="parameter_description">
  1113. <p>a <span class="type">GKeyFile</span></p>
  1114. <p>Passed as <code class="code">self</code></p>
  1115. </td>
  1116. </tr>
  1117. <tr>
  1118. <td class="parameter_name"><p>filename</p></td>
  1119. <td class="parameter_description">
  1120. <p>the name of the file to write to</p>
  1121. <p>Passed as <code class="code">filename</code></p>
  1122. </td>
  1123. </tr>
  1124. </table></div>
  1125. </div>
  1126. </div>
  1127. <div class="refsect2">
  1128. <a name="id-1.1.29.3.30"></a><h3>set-boolean</h3>
  1129. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-boolean self group-name key value))
  1130. </pre></div>
  1131. <p>Associates a new boolean value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1132. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1133. <div class="refsect3">
  1134. <a name="id-1.1.29.3.30.4"></a><h4>Parameters</h4>
  1135. <div class="informaltable"><table>
  1136. <tr>
  1137. <td class="parameter_name"><p>key_file</p></td>
  1138. <td class="parameter_description">
  1139. <p>a <span class="type">GKeyFile</span></p>
  1140. <p>Passed as <code class="code">self</code></p>
  1141. </td>
  1142. </tr>
  1143. <tr>
  1144. <td class="parameter_name"><p>group_name</p></td>
  1145. <td class="parameter_description">
  1146. <p>a group name</p>
  1147. <p>Passed as <code class="code">group-name</code></p>
  1148. </td>
  1149. </tr>
  1150. <tr>
  1151. <td class="parameter_name"><p>key</p></td>
  1152. <td class="parameter_description">
  1153. <p>a key</p>
  1154. <p>Passed as <code class="code">key</code></p>
  1155. </td>
  1156. </tr>
  1157. <tr>
  1158. <td class="parameter_name"><p>value</p></td>
  1159. <td class="parameter_description">
  1160. <p><code class="constant">TRUE</code> or <code class="constant">FALSE</code></p>
  1161. <p>Passed as <code class="code">value</code></p>
  1162. </td>
  1163. </tr>
  1164. </table></div>
  1165. </div>
  1166. </div>
  1167. <div class="refsect2">
  1168. <a name="id-1.1.29.3.31"></a><h3>set-boolean-list</h3>
  1169. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-boolean-list self group-name key list))
  1170. </pre></div>
  1171. <p>Associates a list of boolean values with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1172. If <em class="parameter"><code>key</code></em> cannot be found then it is created.
  1173. If <em class="parameter"><code>group_name</code></em> is <code class="constant">NULL</code>, the start_group is used.</p>
  1174. <div class="refsect3">
  1175. <a name="id-1.1.29.3.31.4"></a><h4>Parameters</h4>
  1176. <div class="informaltable"><table>
  1177. <tr>
  1178. <td class="parameter_name"><p>key_file</p></td>
  1179. <td class="parameter_description">
  1180. <p>a <span class="type">GKeyFile</span></p>
  1181. <p>Passed as <code class="code">self</code></p>
  1182. </td>
  1183. </tr>
  1184. <tr>
  1185. <td class="parameter_name"><p>group_name</p></td>
  1186. <td class="parameter_description">
  1187. <p>a group name</p>
  1188. <p>Passed as <code class="code">group-name</code></p>
  1189. </td>
  1190. </tr>
  1191. <tr>
  1192. <td class="parameter_name"><p>key</p></td>
  1193. <td class="parameter_description">
  1194. <p>a key</p>
  1195. <p>Passed as <code class="code">key</code></p>
  1196. </td>
  1197. </tr>
  1198. <tr>
  1199. <td class="parameter_name"><p>list</p></td>
  1200. <td class="parameter_description">
  1201. <p>an array of boolean values</p>
  1202. <p>Passed as <code class="code">list</code></p>
  1203. </td>
  1204. </tr>
  1205. <tr>
  1206. <td class="parameter_name"><p>length</p></td>
  1207. <td class="parameter_description">
  1208. <p>length of <em class="parameter"><code>list</code></em></p>
  1209. <p>Inferred from <code class="code">list</code></p>
  1210. </td>
  1211. </tr>
  1212. </table></div>
  1213. </div>
  1214. </div>
  1215. <div class="refsect2">
  1216. <a name="id-1.1.29.3.32"></a><h3>set-comment?</h3>
  1217. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:set-comment? self group-name key comment))
  1218. </pre></div>
  1219. <p>Places a comment above <em class="parameter"><code>key</code></em> from <em class="parameter"><code>group_name</code></em>.
  1220. </p>
  1221. <p>If <em class="parameter"><code>key</code></em> is <code class="constant">NULL</code> then <em class="parameter"><code>comment</code></em> will be written above <em class="parameter"><code>group_name</code></em>.
  1222. If both <em class="parameter"><code>key</code></em> and <em class="parameter"><code>group_name</code></em> are <code class="constant">NULL</code>, then <em class="parameter"><code>comment</code></em> will be
  1223. written above the first group in the file.
  1224. </p>
  1225. <p>Note that this function prepends a '#' comment marker to
  1226. each line of <em class="parameter"><code>comment</code></em>.</p>
  1227. <div class="refsect3">
  1228. <a name="id-1.1.29.3.32.6"></a><h4>Parameters</h4>
  1229. <div class="informaltable"><table>
  1230. <tr>
  1231. <td class="parameter_name"><p>key_file</p></td>
  1232. <td class="parameter_description">
  1233. <p>a <span class="type">GKeyFile</span></p>
  1234. <p>Passed as <code class="code">self</code></p>
  1235. </td>
  1236. </tr>
  1237. <tr>
  1238. <td class="parameter_name"><p>group_name</p></td>
  1239. <td class="parameter_description">
  1240. <p>a group name, or <code class="constant">NULL</code></p>
  1241. <p>Passed as <code class="code">group-name</code></p>
  1242. </td>
  1243. </tr>
  1244. <tr>
  1245. <td class="parameter_name"><p>key</p></td>
  1246. <td class="parameter_description">
  1247. <p>a key</p>
  1248. <p>Passed as <code class="code">key</code></p>
  1249. </td>
  1250. </tr>
  1251. <tr>
  1252. <td class="parameter_name"><p>comment</p></td>
  1253. <td class="parameter_description">
  1254. <p>a comment</p>
  1255. <p>Passed as <code class="code">comment</code></p>
  1256. </td>
  1257. </tr>
  1258. </table></div>
  1259. </div>
  1260. </div>
  1261. <div class="refsect2">
  1262. <a name="id-1.1.29.3.33"></a><h3>set-double</h3>
  1263. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-double self group-name key value))
  1264. </pre></div>
  1265. <p>Associates a new double value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1266. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1267. <div class="refsect3">
  1268. <a name="id-1.1.29.3.33.4"></a><h4>Parameters</h4>
  1269. <div class="informaltable"><table>
  1270. <tr>
  1271. <td class="parameter_name"><p>key_file</p></td>
  1272. <td class="parameter_description">
  1273. <p>a <span class="type">GKeyFile</span></p>
  1274. <p>Passed as <code class="code">self</code></p>
  1275. </td>
  1276. </tr>
  1277. <tr>
  1278. <td class="parameter_name"><p>group_name</p></td>
  1279. <td class="parameter_description">
  1280. <p>a group name</p>
  1281. <p>Passed as <code class="code">group-name</code></p>
  1282. </td>
  1283. </tr>
  1284. <tr>
  1285. <td class="parameter_name"><p>key</p></td>
  1286. <td class="parameter_description">
  1287. <p>a key</p>
  1288. <p>Passed as <code class="code">key</code></p>
  1289. </td>
  1290. </tr>
  1291. <tr>
  1292. <td class="parameter_name"><p>value</p></td>
  1293. <td class="parameter_description">
  1294. <p>a double value</p>
  1295. <p>Passed as <code class="code">value</code></p>
  1296. </td>
  1297. </tr>
  1298. </table></div>
  1299. </div>
  1300. </div>
  1301. <div class="refsect2">
  1302. <a name="id-1.1.29.3.34"></a><h3>set-double-list</h3>
  1303. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-double-list self group-name key list))
  1304. </pre></div>
  1305. <p>Associates a list of double values with <em class="parameter"><code>key</code></em> under
  1306. <em class="parameter"><code>group_name</code></em>. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1307. <div class="refsect3">
  1308. <a name="id-1.1.29.3.34.4"></a><h4>Parameters</h4>
  1309. <div class="informaltable"><table>
  1310. <tr>
  1311. <td class="parameter_name"><p>key_file</p></td>
  1312. <td class="parameter_description">
  1313. <p>a <span class="type">GKeyFile</span></p>
  1314. <p>Passed as <code class="code">self</code></p>
  1315. </td>
  1316. </tr>
  1317. <tr>
  1318. <td class="parameter_name"><p>group_name</p></td>
  1319. <td class="parameter_description">
  1320. <p>a group name</p>
  1321. <p>Passed as <code class="code">group-name</code></p>
  1322. </td>
  1323. </tr>
  1324. <tr>
  1325. <td class="parameter_name"><p>key</p></td>
  1326. <td class="parameter_description">
  1327. <p>a key</p>
  1328. <p>Passed as <code class="code">key</code></p>
  1329. </td>
  1330. </tr>
  1331. <tr>
  1332. <td class="parameter_name"><p>list</p></td>
  1333. <td class="parameter_description">
  1334. <p>an array of double values</p>
  1335. <p>Passed as <code class="code">list</code></p>
  1336. </td>
  1337. </tr>
  1338. <tr>
  1339. <td class="parameter_name"><p>length</p></td>
  1340. <td class="parameter_description">
  1341. <p>number of double values in <em class="parameter"><code>list</code></em></p>
  1342. <p>Inferred from <code class="code">list</code></p>
  1343. </td>
  1344. </tr>
  1345. </table></div>
  1346. </div>
  1347. </div>
  1348. <div class="refsect2">
  1349. <a name="id-1.1.29.3.35"></a><h3>set-int64</h3>
  1350. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-int64 self group-name key value))
  1351. </pre></div>
  1352. <p>Associates a new integer value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1353. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1354. <div class="refsect3">
  1355. <a name="id-1.1.29.3.35.4"></a><h4>Parameters</h4>
  1356. <div class="informaltable"><table>
  1357. <tr>
  1358. <td class="parameter_name"><p>key_file</p></td>
  1359. <td class="parameter_description">
  1360. <p>a <span class="type">GKeyFile</span></p>
  1361. <p>Passed as <code class="code">self</code></p>
  1362. </td>
  1363. </tr>
  1364. <tr>
  1365. <td class="parameter_name"><p>group_name</p></td>
  1366. <td class="parameter_description">
  1367. <p>a group name</p>
  1368. <p>Passed as <code class="code">group-name</code></p>
  1369. </td>
  1370. </tr>
  1371. <tr>
  1372. <td class="parameter_name"><p>key</p></td>
  1373. <td class="parameter_description">
  1374. <p>a key</p>
  1375. <p>Passed as <code class="code">key</code></p>
  1376. </td>
  1377. </tr>
  1378. <tr>
  1379. <td class="parameter_name"><p>value</p></td>
  1380. <td class="parameter_description">
  1381. <p>an integer value</p>
  1382. <p>Passed as <code class="code">value</code></p>
  1383. </td>
  1384. </tr>
  1385. </table></div>
  1386. </div>
  1387. </div>
  1388. <div class="refsect2">
  1389. <a name="id-1.1.29.3.36"></a><h3>set-integer</h3>
  1390. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-integer self group-name key value))
  1391. </pre></div>
  1392. <p>Associates a new integer value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1393. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1394. <div class="refsect3">
  1395. <a name="id-1.1.29.3.36.4"></a><h4>Parameters</h4>
  1396. <div class="informaltable"><table>
  1397. <tr>
  1398. <td class="parameter_name"><p>key_file</p></td>
  1399. <td class="parameter_description">
  1400. <p>a <span class="type">GKeyFile</span></p>
  1401. <p>Passed as <code class="code">self</code></p>
  1402. </td>
  1403. </tr>
  1404. <tr>
  1405. <td class="parameter_name"><p>group_name</p></td>
  1406. <td class="parameter_description">
  1407. <p>a group name</p>
  1408. <p>Passed as <code class="code">group-name</code></p>
  1409. </td>
  1410. </tr>
  1411. <tr>
  1412. <td class="parameter_name"><p>key</p></td>
  1413. <td class="parameter_description">
  1414. <p>a key</p>
  1415. <p>Passed as <code class="code">key</code></p>
  1416. </td>
  1417. </tr>
  1418. <tr>
  1419. <td class="parameter_name"><p>value</p></td>
  1420. <td class="parameter_description">
  1421. <p>an integer value</p>
  1422. <p>Passed as <code class="code">value</code></p>
  1423. </td>
  1424. </tr>
  1425. </table></div>
  1426. </div>
  1427. </div>
  1428. <div class="refsect2">
  1429. <a name="id-1.1.29.3.37"></a><h3>set-integer-list</h3>
  1430. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-integer-list self group-name key list))
  1431. </pre></div>
  1432. <p>Associates a list of integer values with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1433. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1434. <div class="refsect3">
  1435. <a name="id-1.1.29.3.37.4"></a><h4>Parameters</h4>
  1436. <div class="informaltable"><table>
  1437. <tr>
  1438. <td class="parameter_name"><p>key_file</p></td>
  1439. <td class="parameter_description">
  1440. <p>a <span class="type">GKeyFile</span></p>
  1441. <p>Passed as <code class="code">self</code></p>
  1442. </td>
  1443. </tr>
  1444. <tr>
  1445. <td class="parameter_name"><p>group_name</p></td>
  1446. <td class="parameter_description">
  1447. <p>a group name</p>
  1448. <p>Passed as <code class="code">group-name</code></p>
  1449. </td>
  1450. </tr>
  1451. <tr>
  1452. <td class="parameter_name"><p>key</p></td>
  1453. <td class="parameter_description">
  1454. <p>a key</p>
  1455. <p>Passed as <code class="code">key</code></p>
  1456. </td>
  1457. </tr>
  1458. <tr>
  1459. <td class="parameter_name"><p>list</p></td>
  1460. <td class="parameter_description">
  1461. <p>an array of integer values</p>
  1462. <p>Passed as <code class="code">list</code></p>
  1463. </td>
  1464. </tr>
  1465. <tr>
  1466. <td class="parameter_name"><p>length</p></td>
  1467. <td class="parameter_description">
  1468. <p>number of integer values in <em class="parameter"><code>list</code></em></p>
  1469. <p>Inferred from <code class="code">list</code></p>
  1470. </td>
  1471. </tr>
  1472. </table></div>
  1473. </div>
  1474. </div>
  1475. <div class="refsect2">
  1476. <a name="id-1.1.29.3.38"></a><h3>set-list-separator</h3>
  1477. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-list-separator self separator))
  1478. </pre></div>
  1479. <p>Sets the character which is used to separate
  1480. values in lists. Typically ';' or ',' are used
  1481. as separators. The default list separator is ';'.</p>
  1482. <div class="refsect3">
  1483. <a name="id-1.1.29.3.38.4"></a><h4>Parameters</h4>
  1484. <div class="informaltable"><table>
  1485. <tr>
  1486. <td class="parameter_name"><p>key_file</p></td>
  1487. <td class="parameter_description">
  1488. <p>a <span class="type">GKeyFile</span></p>
  1489. <p>Passed as <code class="code">self</code></p>
  1490. </td>
  1491. </tr>
  1492. <tr>
  1493. <td class="parameter_name"><p>separator</p></td>
  1494. <td class="parameter_description">
  1495. <p>the separator</p>
  1496. <p>Passed as <code class="code">separator</code></p>
  1497. </td>
  1498. </tr>
  1499. </table></div>
  1500. </div>
  1501. </div>
  1502. <div class="refsect2">
  1503. <a name="id-1.1.29.3.39"></a><h3>set-locale-string</h3>
  1504. <div class="informalexample"><pre class="programlisting">(define-values
  1505. ()
  1506. (key-file:set-locale-string self group-name key locale string))
  1507. </pre></div>
  1508. <p>Associates a string value for <em class="parameter"><code>key</code></em> and <em class="parameter"><code>locale</code></em> under <em class="parameter"><code>group_name</code></em>.
  1509. If the translation for <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1510. <div class="refsect3">
  1511. <a name="id-1.1.29.3.39.4"></a><h4>Parameters</h4>
  1512. <div class="informaltable"><table>
  1513. <tr>
  1514. <td class="parameter_name"><p>key_file</p></td>
  1515. <td class="parameter_description">
  1516. <p>a <span class="type">GKeyFile</span></p>
  1517. <p>Passed as <code class="code">self</code></p>
  1518. </td>
  1519. </tr>
  1520. <tr>
  1521. <td class="parameter_name"><p>group_name</p></td>
  1522. <td class="parameter_description">
  1523. <p>a group name</p>
  1524. <p>Passed as <code class="code">group-name</code></p>
  1525. </td>
  1526. </tr>
  1527. <tr>
  1528. <td class="parameter_name"><p>key</p></td>
  1529. <td class="parameter_description">
  1530. <p>a key</p>
  1531. <p>Passed as <code class="code">key</code></p>
  1532. </td>
  1533. </tr>
  1534. <tr>
  1535. <td class="parameter_name"><p>locale</p></td>
  1536. <td class="parameter_description">
  1537. <p>a locale identifier</p>
  1538. <p>Passed as <code class="code">locale</code></p>
  1539. </td>
  1540. </tr>
  1541. <tr>
  1542. <td class="parameter_name"><p>string</p></td>
  1543. <td class="parameter_description">
  1544. <p>a string</p>
  1545. <p>Passed as <code class="code">string</code></p>
  1546. </td>
  1547. </tr>
  1548. </table></div>
  1549. </div>
  1550. </div>
  1551. <div class="refsect2">
  1552. <a name="id-1.1.29.3.40"></a><h3>set-locale-string-list</h3>
  1553. <div class="informalexample"><pre class="programlisting">(define-values
  1554. ()
  1555. (key-file:set-locale-string-list self group-name key locale list))
  1556. </pre></div>
  1557. <p>Associates a list of string values for <em class="parameter"><code>key</code></em> and <em class="parameter"><code>locale</code></em> under
  1558. <em class="parameter"><code>group_name</code></em>. If the translation for <em class="parameter"><code>key</code></em> cannot be found then
  1559. it is created.</p>
  1560. <div class="refsect3">
  1561. <a name="id-1.1.29.3.40.4"></a><h4>Parameters</h4>
  1562. <div class="informaltable"><table>
  1563. <tr>
  1564. <td class="parameter_name"><p>key_file</p></td>
  1565. <td class="parameter_description">
  1566. <p>a <span class="type">GKeyFile</span></p>
  1567. <p>Passed as <code class="code">self</code></p>
  1568. </td>
  1569. </tr>
  1570. <tr>
  1571. <td class="parameter_name"><p>group_name</p></td>
  1572. <td class="parameter_description">
  1573. <p>a group name</p>
  1574. <p>Passed as <code class="code">group-name</code></p>
  1575. </td>
  1576. </tr>
  1577. <tr>
  1578. <td class="parameter_name"><p>key</p></td>
  1579. <td class="parameter_description">
  1580. <p>a key</p>
  1581. <p>Passed as <code class="code">key</code></p>
  1582. </td>
  1583. </tr>
  1584. <tr>
  1585. <td class="parameter_name"><p>locale</p></td>
  1586. <td class="parameter_description">
  1587. <p>a locale identifier</p>
  1588. <p>Passed as <code class="code">locale</code></p>
  1589. </td>
  1590. </tr>
  1591. <tr>
  1592. <td class="parameter_name"><p>list</p></td>
  1593. <td class="parameter_description">
  1594. <p>a <code class="constant">NULL</code>-terminated array of locale string values</p>
  1595. <p>Passed as <code class="code">list</code></p>
  1596. </td>
  1597. </tr>
  1598. <tr>
  1599. <td class="parameter_name"><p>length</p></td>
  1600. <td class="parameter_description">
  1601. <p>the length of <em class="parameter"><code>list</code></em></p>
  1602. <p>Inferred from <code class="code">list</code></p>
  1603. </td>
  1604. </tr>
  1605. </table></div>
  1606. </div>
  1607. </div>
  1608. <div class="refsect2">
  1609. <a name="id-1.1.29.3.41"></a><h3>set-string</h3>
  1610. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-string self group-name key string))
  1611. </pre></div>
  1612. <p>Associates a new string value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1613. If <em class="parameter"><code>key</code></em> cannot be found then it is created.
  1614. If <em class="parameter"><code>group_name</code></em> cannot be found then it is created.
  1615. Unlike <code class="function">g_key_file_set_value()</code>, this function handles characters
  1616. that need escaping, such as newlines.</p>
  1617. <div class="refsect3">
  1618. <a name="id-1.1.29.3.41.4"></a><h4>Parameters</h4>
  1619. <div class="informaltable"><table>
  1620. <tr>
  1621. <td class="parameter_name"><p>key_file</p></td>
  1622. <td class="parameter_description">
  1623. <p>a <span class="type">GKeyFile</span></p>
  1624. <p>Passed as <code class="code">self</code></p>
  1625. </td>
  1626. </tr>
  1627. <tr>
  1628. <td class="parameter_name"><p>group_name</p></td>
  1629. <td class="parameter_description">
  1630. <p>a group name</p>
  1631. <p>Passed as <code class="code">group-name</code></p>
  1632. </td>
  1633. </tr>
  1634. <tr>
  1635. <td class="parameter_name"><p>key</p></td>
  1636. <td class="parameter_description">
  1637. <p>a key</p>
  1638. <p>Passed as <code class="code">key</code></p>
  1639. </td>
  1640. </tr>
  1641. <tr>
  1642. <td class="parameter_name"><p>string</p></td>
  1643. <td class="parameter_description">
  1644. <p>a string</p>
  1645. <p>Passed as <code class="code">string</code></p>
  1646. </td>
  1647. </tr>
  1648. </table></div>
  1649. </div>
  1650. </div>
  1651. <div class="refsect2">
  1652. <a name="id-1.1.29.3.42"></a><h3>set-string-list</h3>
  1653. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-string-list self group-name key list))
  1654. </pre></div>
  1655. <p>Associates a list of string values for <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1656. If <em class="parameter"><code>key</code></em> cannot be found then it is created.
  1657. If <em class="parameter"><code>group_name</code></em> cannot be found then it is created.</p>
  1658. <div class="refsect3">
  1659. <a name="id-1.1.29.3.42.4"></a><h4>Parameters</h4>
  1660. <div class="informaltable"><table>
  1661. <tr>
  1662. <td class="parameter_name"><p>key_file</p></td>
  1663. <td class="parameter_description">
  1664. <p>a <span class="type">GKeyFile</span></p>
  1665. <p>Passed as <code class="code">self</code></p>
  1666. </td>
  1667. </tr>
  1668. <tr>
  1669. <td class="parameter_name"><p>group_name</p></td>
  1670. <td class="parameter_description">
  1671. <p>a group name</p>
  1672. <p>Passed as <code class="code">group-name</code></p>
  1673. </td>
  1674. </tr>
  1675. <tr>
  1676. <td class="parameter_name"><p>key</p></td>
  1677. <td class="parameter_description">
  1678. <p>a key</p>
  1679. <p>Passed as <code class="code">key</code></p>
  1680. </td>
  1681. </tr>
  1682. <tr>
  1683. <td class="parameter_name"><p>list</p></td>
  1684. <td class="parameter_description">
  1685. <p>an array of string values</p>
  1686. <p>Passed as <code class="code">list</code></p>
  1687. </td>
  1688. </tr>
  1689. <tr>
  1690. <td class="parameter_name"><p>length</p></td>
  1691. <td class="parameter_description">
  1692. <p>number of string values in <em class="parameter"><code>list</code></em></p>
  1693. <p>Inferred from <code class="code">list</code></p>
  1694. </td>
  1695. </tr>
  1696. </table></div>
  1697. </div>
  1698. </div>
  1699. <div class="refsect2">
  1700. <a name="id-1.1.29.3.43"></a><h3>set-uint64</h3>
  1701. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-uint64 self group-name key value))
  1702. </pre></div>
  1703. <p>Associates a new integer value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1704. If <em class="parameter"><code>key</code></em> cannot be found then it is created.</p>
  1705. <div class="refsect3">
  1706. <a name="id-1.1.29.3.43.4"></a><h4>Parameters</h4>
  1707. <div class="informaltable"><table>
  1708. <tr>
  1709. <td class="parameter_name"><p>key_file</p></td>
  1710. <td class="parameter_description">
  1711. <p>a <span class="type">GKeyFile</span></p>
  1712. <p>Passed as <code class="code">self</code></p>
  1713. </td>
  1714. </tr>
  1715. <tr>
  1716. <td class="parameter_name"><p>group_name</p></td>
  1717. <td class="parameter_description">
  1718. <p>a group name</p>
  1719. <p>Passed as <code class="code">group-name</code></p>
  1720. </td>
  1721. </tr>
  1722. <tr>
  1723. <td class="parameter_name"><p>key</p></td>
  1724. <td class="parameter_description">
  1725. <p>a key</p>
  1726. <p>Passed as <code class="code">key</code></p>
  1727. </td>
  1728. </tr>
  1729. <tr>
  1730. <td class="parameter_name"><p>value</p></td>
  1731. <td class="parameter_description">
  1732. <p>an integer value</p>
  1733. <p>Passed as <code class="code">value</code></p>
  1734. </td>
  1735. </tr>
  1736. </table></div>
  1737. </div>
  1738. </div>
  1739. <div class="refsect2">
  1740. <a name="id-1.1.29.3.44"></a><h3>set-value</h3>
  1741. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:set-value self group-name key value))
  1742. </pre></div>
  1743. <p>Associates a new value with <em class="parameter"><code>key</code></em> under <em class="parameter"><code>group_name</code></em>.
  1744. </p>
  1745. <p>If <em class="parameter"><code>key</code></em> cannot be found then it is created. If <em class="parameter"><code>group_name</code></em> cannot
  1746. be found then it is created. To set an UTF-8 string which may contain
  1747. characters that need escaping (such as newlines or spaces), use
  1748. <code class="function">g_key_file_set_string()</code>.</p>
  1749. <div class="refsect3">
  1750. <a name="id-1.1.29.3.44.5"></a><h4>Parameters</h4>
  1751. <div class="informaltable"><table>
  1752. <tr>
  1753. <td class="parameter_name"><p>key_file</p></td>
  1754. <td class="parameter_description">
  1755. <p>a <span class="type">GKeyFile</span></p>
  1756. <p>Passed as <code class="code">self</code></p>
  1757. </td>
  1758. </tr>
  1759. <tr>
  1760. <td class="parameter_name"><p>group_name</p></td>
  1761. <td class="parameter_description">
  1762. <p>a group name</p>
  1763. <p>Passed as <code class="code">group-name</code></p>
  1764. </td>
  1765. </tr>
  1766. <tr>
  1767. <td class="parameter_name"><p>key</p></td>
  1768. <td class="parameter_description">
  1769. <p>a key</p>
  1770. <p>Passed as <code class="code">key</code></p>
  1771. </td>
  1772. </tr>
  1773. <tr>
  1774. <td class="parameter_name"><p>value</p></td>
  1775. <td class="parameter_description">
  1776. <p>a string</p>
  1777. <p>Passed as <code class="code">value</code></p>
  1778. </td>
  1779. </tr>
  1780. </table></div>
  1781. </div>
  1782. </div>
  1783. <div class="refsect2">
  1784. <a name="id-1.1.29.3.45"></a><h3>to-data</h3>
  1785. <div class="informalexample"><pre class="programlisting">(define-values (%return length) (key-file:to-data self))
  1786. </pre></div>
  1787. <p>This function outputs <em class="parameter"><code>key_file</code></em> as a string.
  1788. </p>
  1789. <p>Note that this function never reports an error,
  1790. so it is safe to pass <code class="constant">NULL</code> as <em class="parameter"><code>error</code></em>.</p>
  1791. <div class="refsect3">
  1792. <a name="id-1.1.29.3.45.5"></a><h4>Parameters</h4>
  1793. <div class="informaltable"><table>
  1794. <tr>
  1795. <td class="parameter_name"><p>key_file</p></td>
  1796. <td class="parameter_description">
  1797. <p>a <span class="type">GKeyFile</span></p>
  1798. <p>Passed as <code class="code">self</code></p>
  1799. </td>
  1800. </tr>
  1801. <tr>
  1802. <td class="parameter_name"><p>length</p></td>
  1803. <td class="parameter_description">
  1804. <p>return location for the length of the
  1805. returned string, or <code class="constant">NULL</code></p>
  1806. <p>Passed as <code class="code">length</code></p>
  1807. </td>
  1808. </tr>
  1809. </table></div>
  1810. </div>
  1811. </div>
  1812. <div class="refsect2">
  1813. <a name="id-1.1.29.3.46"></a><h3>unref</h3>
  1814. <div class="informalexample"><pre class="programlisting">(define-values () (key-file:unref self))
  1815. </pre></div>
  1816. <p>Decreases the reference count of <em class="parameter"><code>key_file</code></em> by 1. If the reference count
  1817. reaches zero, frees the key file and all its allocated memory.</p>
  1818. <div class="refsect3">
  1819. <a name="id-1.1.29.3.46.4"></a><h4>Parameters</h4>
  1820. <div class="informaltable"><table><tr>
  1821. <td class="parameter_name"><p>key_file</p></td>
  1822. <td class="parameter_description">
  1823. <p>a <span class="type">GKeyFile</span></p>
  1824. <p>Passed as <code class="code">self</code></p>
  1825. </td>
  1826. </tr></table></div>
  1827. </div>
  1828. </div>
  1829. <div class="refsect2">
  1830. <a name="id-1.1.29.3.47"></a><h3>key-file:new</h3>
  1831. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:new))
  1832. </pre></div>
  1833. <p>Undocumented</p>
  1834. </div>
  1835. <div class="refsect2">
  1836. <a name="id-1.1.29.3.48"></a><h3>key-file:error-quark</h3>
  1837. <div class="informalexample"><pre class="programlisting">(define-values (%return) (key-file:error-quark))
  1838. </pre></div>
  1839. <p>Undocumented</p>
  1840. </div>
  1841. </div>
  1842. </div>
  1843. <div class="footer">
  1844. <hr>Generated by GTK-Doc V1.33.1</div>
  1845. </body>
  1846. </html>