📄 glib-windows-compatability-functions.html
字号:
<p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>package</code></em> :</span></td><td> An identifier for a software package, or <code class="literal">NULL</code>, in UTF-8</td></tr><tr><td><span class="term"><em class="parameter"><code>dll_name</code></em> :</span></td><td> The name of a DLL that a package provides, or <code class="literal">NULL</code>, in UTF-8</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a string containing the installation directory for<em class="parameter"><code>package</code></em>. The string is in the GLib file name encoding, i.e. UTF-8on Windows. The return value should be freed with <a href="glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> when notneeded any longer.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098768"></a><h3><a name="g-win32-get-package-installation-subdirectory"></a>g_win32_get_package_installation_subdirectory ()</h3><a class="indexterm" name="id3098780"></a><pre class="programlisting"><a href="glib-Basic-Types.html#gchar">gchar</a>* g_win32_get_package_installation_subdirectory (<a href="glib-Basic-Types.html#gchar">gchar</a> *package, <a href="glib-Basic-Types.html#gchar">gchar</a> *dll_name, <a href="glib-Basic-Types.html#gchar">gchar</a> *subdir);</pre><p>Returns a newly-allocated string containing the path of thesubdirectory <em class="parameter"><code>subdir</code></em> in the return value from calling<a href="glib-Windows-Compatability-Functions.html#g-win32-get-package-installation-directory"><code class="function">g_win32_get_package_installation_directory()</code></a> with the <em class="parameter"><code>package</code></em> and<em class="parameter"><code>dll_name</code></em> parameters.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>package</code></em> :</span></td><td> An identifier for a software package, in UTF-8, or <code class="literal">NULL</code></td></tr><tr><td><span class="term"><em class="parameter"><code>dll_name</code></em> :</span></td><td> The name of a DLL that a package provides, in UTF-8, or <code class="literal">NULL</code></td></tr><tr><td><span class="term"><em class="parameter"><code>subdir</code></em> :</span></td><td> A subdirectory of the package installation directory, also in UTF-8</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> a string containing the complete path to <em class="parameter"><code>subdir</code></em> insidethe installation directory of <em class="parameter"><code>package</code></em>. The returned string is inthe GLib file name encoding, i.e. UTF-8 on Windows. The returnvalue should be freed with <a href="glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a> when no longer needed.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3098955"></a><h3><a name="g-win32-get-windows-version"></a>g_win32_get_windows_version ()</h3><a class="indexterm" name="id3098966"></a><pre class="programlisting"><a href="glib-Basic-Types.html#guint">guint</a> g_win32_get_windows_version (void);</pre><p>Returns version information for the Windows operating system thecode is running on. See MSDN documentation for the <code class="function">GetVersion()</code>function. To summarize, the most significant bit is one on Win9x,and zero on NT-based systems. The least significant byte is 4 onWindows NT 4, 5 on Windows XP. Software that needs really detailledversion and feature information should use Win32 API like<code class="function">GetVersionEx()</code> and <code class="function">VerifyVersionInfo()</code>.</p><p>If there is an environment variable <code class="envar">G_WIN32_PRETEND_WIN9X</code> defined (with any value), this function always returns a version code for Windows 9x. This is mainly an internal debugging aid for GTK+ and GLib developers, to be able to check the code paths for Windows 9x.</p><p></p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td><td> The version information.</td></tr></tbody></table></div><p>Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3099062"></a><h3><a name="G-WIN32-DLLMAIN-FOR-DLL-NAME:CAPS"></a>G_WIN32_DLLMAIN_FOR_DLL_NAME()</h3><a class="indexterm" name="id3099073"></a><pre class="programlisting">#define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)</pre><p>On Windows, this macro defines a <code class="function"><code class="function">DllMain()</code></code> function that stores the actual DLL name that the code being compiled will be included in.</p><p>On non-Windows platforms, expands to nothing.</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>static</code></em> :</span></td><td>empty or "static".</td></tr><tr><td><span class="term"><em class="parameter"><code>dll_name</code></em> :</span></td><td>the name of the (pointer to the) char array where the DLL name will be stored. If this is used, you must also include <code class="filename">windows.h</code>. If you need a more complex DLL entry point function, you cannot use this.</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id3099151"></a><h3><a name="G-WIN32-HAVE-WIDECHAR-API:CAPS"></a>G_WIN32_HAVE_WIDECHAR_API()</h3><a class="indexterm" name="id3099163"></a><pre class="programlisting">#define G_WIN32_HAVE_WIDECHAR_API() (G_WIN32_IS_NT_BASED ())</pre><p>On Windows, this macro defines an expression which evaluates to <code class="literal">TRUE</code>if the code is running on a version of Windows where the widecharacter versions of the Win32 API functions, and the wide chaacterversions of the C library functions work. (They are always present inthe DLLs, but don't work on Windows 9x and Me.)</p><p>On non-Windows platforms, it is not defined.</p><p>Since 2.6</p></div><hr><div class="refsect2" lang="en"><a name="id3099198"></a><h3><a name="G-WIN32-IS-NT-BASED:CAPS"></a>G_WIN32_IS_NT_BASED()</h3><a class="indexterm" name="id3099209"></a><pre class="programlisting">#define G_WIN32_IS_NT_BASED() (g_win32_get_windows_version () < 0x80000000)</pre><p>On Windows, this macro defines an expression which evaluates to <code class="literal">TRUE</code> if the code is running on an NT-based Windows operating system.</p><p>On non-Windows platforms, it is not defined.</p><p>Since 2.6</p></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="glib-Key-value-file-parser.html"><b><< Key-value file parser</b></a></td><td align="right"><a accesskey="n" href="glib-data-types.html"><b>GLib Data Types >></b></a></td></tr></table></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -