📄 iniparser_8h.html
字号:
<table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td>Dictionary to examine </td></tr> <tr><td valign="top"></td><td valign="top"><em>n</em> </td><td>Section number (from 0 to nsec-1). </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Pointer to char string</dd></dl>This function locates the n-th section in a dictionary and returns its name as a pointer to a string statically allocated inside the dictionary. Do not free or modify the returned string!<p>This function returns NULL in case of error. </div></div><p><a class="anchor" name="587eafb48937fdee8ae414ad7a666db8"></a><!-- doxytag: member="iniparser.h::iniparser_getstr" ref="587eafb48937fdee8ae414ad7a666db8" args="(dictionary *d, const char *key)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">char* iniparser_getstr </td> <td>(</td> <td class="paramtype">dictionary * </td> <td class="paramname"> <em>d</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>key</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Get the string associated to a key, return NULL if not found. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td>Dictionary to search </td></tr> <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>Key string to look for </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string, or NULL.</dd></dl>This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, NULL is returned. The returned char pointer is pointing to a string allocated in the dictionary, do not free or modify it.<p>This function is only provided for backwards compatibility with previous versions of iniparser. It is recommended to use <a class="el" href="iniparser_8h.html#7894f8480e1f254d4a1b4a31bdc51b46">iniparser_getstring()</a> instead. </div></div><p><a class="anchor" name="7894f8480e1f254d4a1b4a31bdc51b46"></a><!-- doxytag: member="iniparser.h::iniparser_getstring" ref="7894f8480e1f254d4a1b4a31bdc51b46" args="(dictionary *d, const char *key, char *def)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">char* iniparser_getstring </td> <td>(</td> <td class="paramtype">dictionary * </td> <td class="paramname"> <em>d</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">const char * </td> <td class="paramname"> <em>key</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>def</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Get the string associated to a key. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>d</em> </td><td>Dictionary to search </td></tr> <tr><td valign="top"></td><td valign="top"><em>key</em> </td><td>Key string to look for </td></tr> <tr><td valign="top"></td><td valign="top"><em>def</em> </td><td>Default value to return if key not found. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>pointer to statically allocated character string</dd></dl>This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the pointer passed as 'def' is returned. The returned char pointer is pointing to a string allocated in the dictionary, do not free or modify it. </div></div><p><a class="anchor" name="b0be559bfb769224b3f1b75e26242a67"></a><!-- doxytag: member="iniparser.h::iniparser_load" ref="b0be559bfb769224b3f1b75e26242a67" args="(const char *ininame)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">dictionary* iniparser_load </td> <td>(</td> <td class="paramtype">const char * </td> <td class="paramname"> <em>ininame</em> </td> <td> ) </td> <td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Parse an ini file and return an allocated dictionary object. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ininame</em> </td><td>Name of the ini file to read. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>Pointer to newly allocated dictionary</dd></dl>This is the parser for ini files. This function is called, providing the name of the file to be read. It returns a dictionary object that should not be accessed directly, but through accessor functions instead.<p>The returned dictionary must be freed using <a class="el" href="iniparser_8h.html#90549ee518523921886b74454ff872eb">iniparser_freedict()</a>. </div></div><p><a class="anchor" name="605a88057bac4c3249513fc588421c32"></a><!-- doxytag: member="iniparser.h::iniparser_setstr" ref="605a88057bac4c3249513fc588421c32" args="(dictionary *ini, char *entry, char *val)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">int iniparser_setstr </td> <td>(</td> <td class="paramtype">dictionary * </td> <td class="paramname"> <em>ini</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>entry</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>val</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Set an entry in a dictionary. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ini</em> </td><td>Dictionary to modify. </td></tr> <tr><td valign="top"></td><td valign="top"><em>entry</em> </td><td>Entry to modify (entry name) </td></tr> <tr><td valign="top"></td><td valign="top"><em>val</em> </td><td>New value to associate to the entry. </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>int 0 if Ok, -1 otherwise.</dd></dl>If the given entry can be found in the dictionary, it is modified to contain the provided value. If it cannot be found, -1 is returned. It is Ok to set val to NULL. </div></div><p><a class="anchor" name="7b1a7f2492a35043867fa801b8f21e52"></a><!-- doxytag: member="iniparser.h::iniparser_unset" ref="7b1a7f2492a35043867fa801b8f21e52" args="(dictionary *ini, char *entry)" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void iniparser_unset </td> <td>(</td> <td class="paramtype">dictionary * </td> <td class="paramname"> <em>ini</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">char * </td> <td class="paramname"> <em>entry</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td width="100%"></td> </tr> </table></div><div class="memdoc"><p>Delete an entry in a dictionary. <p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ini</em> </td><td>Dictionary to modify </td></tr> <tr><td valign="top"></td><td valign="top"><em>entry</em> </td><td>Entry to delete (entry name) </td></tr> </table></dl><dl class="return" compact><dt><b>Returns:</b></dt><dd>void</dd></dl>If the given entry can be found, it is deleted from the dictionary. </div></div><p></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -