📄 group__etc__fns.htm
字号:
</tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pKey</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>pValue</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iLen</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"><code> [inline, static]</code></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Gets value from MiniGUI configuration etc object. <p>This fuctions gets the value from MiniGUi configuration etc object, somewhat similiar to GetValueFromEtcFile and GetValueFromEtc <dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__etc__fns.htm#ga5">GetValueFromEtcFile</a> <p><a class="el" href="group__etc__fns.htm#ga12">GetValueFromEtc</a>. </dd></dl><p>Definition at line <a class="el" href="minigui_8h-source.htm#l02065">2065</a> of file <a class="el" href="minigui_8h-source.htm">minigui.h</a>.<p>References <a class="el" href="group__etc__fns.htm#ga12">GetValueFromEtc()</a>, and <a class="el" href="group__etc__fns.htm#ga5">GetValueFromEtcFile()</a>. </td> </tr></table><a class="anchor" name="ga12" doxytag="minigui.h::GetValueFromEtc"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">GUIAPI GetValueFromEtc </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga0">GHANDLE</a> </td> <td class="mdname" nowrap> <em>hEtc</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pSection</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pKey</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>pValue</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iLen</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Gets value from a configuration etc object. <p>This function gets value from an etc object, similar to GetValueFromEtcFile. This function gets the value of the key <em>pKey</em> in the section <em>pSection</em> of the etc object <em>hEtc</em>, and saves the value to the buffer pointed to by <em>pValue</em>.<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>hEtc</em> </td><td>Handle to the etc object. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pSection</em> </td><td>The section name in which the value located. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pKey</em> </td><td>The key name of the value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pValue</em> </td><td>The value will be saved in this buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>iLen</em> </td><td>The length in bytes of the buffer. This function will set value if the iLen is less than 1.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>ETC_OK on success, < 0 on error.</dd></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ETC_OK</em> </td><td>Gets value successfullly. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_INVALIDOBJ</em> </td><td>Invalid etc object. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_SECTIONNOTFOUND</em> </td><td>Can not find the specified section in the configuration file. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_KEYNOTFOUND</em> </td><td>Can not find the specified key in the section. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_READONLYOBJ</em> </td><td>The etc object is read-only.</td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__etc__fns.htm#ga5">GetValueFromEtcFile</a>, <a class="el" href="group__etc__fns.htm#ga9">LoadEtcFile</a>, <a class="el" href="group__etc__fns.htm#ga11">UnloadEtcFile</a> </dd></dl><p>Referenced by <a class="el" href="minigui_8h-source.htm#l02065">GetMgEtcValue()</a>. </td> </tr></table><a class="anchor" name="ga5" doxytag="minigui.h::GetValueFromEtcFile"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int GUIAPI GetValueFromEtcFile </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>pEtcFile</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pSection</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pKey</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>pValue</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iLen</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Gets value from a configuration file. <p>This function gets the value of the key <em>pKey</em> in the section <em>pSection</em> of the configuration file <em>pEtcFile</em>, and saves the value to the buffer pointed to by <em>pValue</em>.<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>pEtcFile</em> </td><td>The path name of the configuration file. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pSection</em> </td><td>The section name in which the value located. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pKey</em> </td><td>The key name of the value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pValue</em> </td><td>The value will be saved in this buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>iLen</em> </td><td>The length in bytes of the buffer.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>ETC_OK on success, < 0 on error.</dd></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ETC_OK</em> </td><td>Gets value successfullly. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_FILENOTFOUND</em> </td><td>Can not find the specified configuration file. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_SECTIONNOTFOUND</em> </td><td>Can not find the specified section in the configuration file. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_KEYNOTFOUND</em> </td><td>Can not find the specified key in the section. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_FILEIOFAILED</em> </td><td>File I/O operation error occurred.</td></tr> </table></dl><dl compact><dt><b>Note:</b></dt><dd>MiniGUI use <em>strncpy</em> to copy actual value to <em>pValue</em>. Thus, if the length of the actual value is larger than <em>iLen</em>, the result copied to <em>pValue</em> will <em>NOT</em> be null-terminated.</dd></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__etc__fns.htm#ga6">GetIntValueFromEtcFile</a>, <a class="el" href="group__etc__fns.htm#ga7">SetValueToEtcFile</a>, strncpy(3) </dd></dl><p>Referenced by <a class="el" href="minigui_8h-source.htm#l02065">GetMgEtcValue()</a>. </td> </tr></table><a class="anchor" name="ga15" doxytag="minigui.h::GetValueFromEtcSec"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top">int GUIAPI GetValueFromEtcSec </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="group__handles.htm#ga0">GHANDLE</a> </td> <td class="mdname" nowrap> <em>hSect</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>const char * </td> <td class="mdname" nowrap> <em>pKey</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>char * </td> <td class="mdname" nowrap> <em>pValue</em>, </td> </tr> <tr> <td class="md" nowrap align="right"></td> <td class="md"></td> <td class="md" nowrap>int </td> <td class="mdname" nowrap> <em>iLen</em></td> </tr> <tr> <td class="md"></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing="5" cellpadding="0" border="0"> <tr> <td> </td> <td><p>Gets value from an etc section object. <p>This function gets value from an etc section object, similar to GetValueFromEtc. It gets the value of the key <em>pKey</em> in the section <em>hSect</em>, and saves the value to the buffer pointed to by <em>pValue</em>.<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>hSect</em> </td><td>The handle to the section. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pKey</em> </td><td>The key name of the value. </td></tr> <tr><td valign="top"></td><td valign="top"><em>pValue</em> </td><td>The value will be saved in this buffer. </td></tr> <tr><td valign="top"></td><td valign="top"><em>iLen</em> </td><td>The length in bytes of the buffer. This function will set value if the iLen is less than 1.</td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>ETC_OK on success, < 0 on error.</dd></dl><dl compact><dt><b>Return values:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>ETC_OK</em> </td><td>Gets value successfullly. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_INVALIDOBJ</em> </td><td>Invalid etc object. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_KEYNOTFOUND</em> </td><td>Can not find the specified key in the section. </td></tr> <tr><td valign="top"></td><td valign="top"><em>ETC_READONLYOBJ</em> </td><td>The section object is read-only.</td></tr> </table></dl><dl compact><dt><b>See also:</b></dt><dd><a class="el" href="group__etc__fns.htm#ga5">GetValueFromEtcFile</a>, <a class="el" href="group__etc__fns.htm#ga12">GetValueFromEtc</a>, <a class="el" href="group__etc__fns.htm#ga14">FindSectionInEtc</a> </dd></dl> </td> </tr></table><a class="anchor" name="ga9" doxytag="minigui.h::LoadEtcFile"></a><p><table class="mdTable" cellpadding="2" cellspacing="0"> <tr> <td class="mdRow"> <table cellpadding="0" cellspacing="0" border="0">
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -