⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gutils.h

📁 windows平台下开发gtk程序所需要的库和头文件等
💻 H
📖 第 1 页 / 共 2 页
字号:
#define g_getenv g_getenv_utf8#define g_setenv g_setenv_utf8#define g_unsetenv g_unsetenv_utf8#define g_find_program_in_path g_find_program_in_path_utf8#endifG_CONST_RETURN gchar* g_getenv             (const gchar *variable);gboolean              g_setenv             (const gchar *variable,					    const gchar *value,					    gboolean     overwrite);void                  g_unsetenv           (const gchar *variable);gchar**               g_listenv            (void);/* private */const gchar*	     _g_getenv_nomalloc	   (const gchar	*variable,					    gchar        buffer[1024]);/* we try to provide a useful equivalent for ATEXIT if it is * not defined, but use is actually abandoned. people should * use g_atexit() instead. */typedef	void		(*GVoidFunc)		(void);#ifndef ATEXIT# define ATEXIT(proc)	g_ATEXIT(proc)#else# define G_NATIVE_ATEXIT#endif /* ATEXIT *//* we use a GLib function as a replacement for ATEXIT, so * the programmer is not required to check the return value * (if there is any in the implementation) and doesn't encounter * missing include files. */void	g_atexit		(GVoidFunc    func);#ifdef G_OS_WIN32/* It's a bad idea to wrap atexit() on Windows. If the GLib DLL calls * atexit(), the function will be called when the GLib DLL is detached * from the program, which is not what the caller wants. The caller * wants the function to be called when it *itself* exits (or is * detached, in case the caller, too, is a DLL). */int atexit (void (*)(void));#define g_atexit(func) atexit(func)#endif/* Look for an executable in PATH, following execvp() rules */gchar*  g_find_program_in_path  (const gchar *program);/* Bit tests */G_INLINE_FUNC gint	g_bit_nth_lsf (gulong  mask,				       gint    nth_bit) G_GNUC_CONST;G_INLINE_FUNC gint	g_bit_nth_msf (gulong  mask,				       gint    nth_bit) G_GNUC_CONST;G_INLINE_FUNC guint	g_bit_storage (gulong  number) G_GNUC_CONST;/* Trash Stacks * elements need to be >= sizeof (gpointer) */typedef struct _GTrashStack     GTrashStack;struct _GTrashStack{  GTrashStack *next;};G_INLINE_FUNC void	g_trash_stack_push	(GTrashStack **stack_p,						 gpointer      data_p);G_INLINE_FUNC gpointer	g_trash_stack_pop	(GTrashStack **stack_p);G_INLINE_FUNC gpointer	g_trash_stack_peek	(GTrashStack **stack_p);G_INLINE_FUNC guint	g_trash_stack_height	(GTrashStack **stack_p);/* inline function implementations */#if defined (G_CAN_INLINE) || defined (__G_UTILS_C__)G_INLINE_FUNC gintg_bit_nth_lsf (gulong mask,	       gint   nth_bit){  if (G_UNLIKELY (nth_bit < -1))    nth_bit = -1;  while (nth_bit < ((GLIB_SIZEOF_LONG * 8) - 1))    {      nth_bit++;      if (mask & (1UL << nth_bit))	return nth_bit;    }  return -1;}G_INLINE_FUNC gintg_bit_nth_msf (gulong mask,	       gint   nth_bit){  if (nth_bit < 0 || G_UNLIKELY (nth_bit > GLIB_SIZEOF_LONG * 8))    nth_bit = GLIB_SIZEOF_LONG * 8;  while (nth_bit > 0)    {      nth_bit--;      if (mask & (1UL << nth_bit))	return nth_bit;    }  return -1;}G_INLINE_FUNC guintg_bit_storage (gulong number){#if defined(__GNUC__) && (__GNUC__ >= 4) && defined(__OPTIMIZE__)  return G_LIKELY (number) ?	   ((GLIB_SIZEOF_LONG * 8 - 1) ^ __builtin_clzl(number)) + 1 : 1;#else  register guint n_bits = 0;    do    {      n_bits++;      number >>= 1;    }  while (number);  return n_bits;#endif}G_INLINE_FUNC voidg_trash_stack_push (GTrashStack **stack_p,		    gpointer      data_p){  GTrashStack *data = (GTrashStack *) data_p;  data->next = *stack_p;  *stack_p = data;}G_INLINE_FUNC gpointerg_trash_stack_pop (GTrashStack **stack_p){  GTrashStack *data;  data = *stack_p;  if (data)    {      *stack_p = data->next;      /* NULLify private pointer here, most platforms store NULL as       * subsequent 0 bytes       */      data->next = NULL;    }  return data;}G_INLINE_FUNC gpointerg_trash_stack_peek (GTrashStack **stack_p){  GTrashStack *data;  data = *stack_p;  return data;}G_INLINE_FUNC guintg_trash_stack_height (GTrashStack **stack_p){  GTrashStack *data;  guint i = 0;  for (data = *stack_p; data; data = data->next)    i++;  return i;}#endif  /* G_CAN_INLINE || __G_UTILS_C__ *//* Glib version. * we prefix variable declarations so they can * properly get exported in windows dlls. */GLIB_VAR const guint glib_major_version;GLIB_VAR const guint glib_minor_version;GLIB_VAR const guint glib_micro_version;GLIB_VAR const guint glib_interface_age;GLIB_VAR const guint glib_binary_age;const gchar * glib_check_version (guint required_major,                                  guint required_minor,                                  guint required_micro);#define GLIB_CHECK_VERSION(major,minor,micro)    \    (GLIB_MAJOR_VERSION > (major) || \     (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION > (minor)) || \     (GLIB_MAJOR_VERSION == (major) && GLIB_MINOR_VERSION == (minor) && \      GLIB_MICRO_VERSION >= (micro)))G_END_DECLS#ifndef G_DISABLE_DEPRECATED/* * This macro is deprecated. This DllMain() is too complex. It is * recommended to write an explicit minimal DLlMain() that just saves * the handle to the DLL and then use that handle instead, for * instance passing it to * g_win32_get_package_installation_directory_of_module(). * * On Windows, this macro defines a DllMain function that stores the * actual DLL name that the code being compiled will be included in. * STATIC should be empty or 'static'. DLL_NAME is the name of the * (pointer to the) char array where the DLL name will be stored. If * this is used, you must also include <windows.h>. If you need a more complex * DLL entry point function, you cannot use this. * * On non-Windows platforms, expands to nothing. */#ifndef G_PLATFORM_WIN32# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)#else# define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name)			\static char *dll_name;							\									\BOOL WINAPI								\DllMain (HINSTANCE hinstDLL,						\	 DWORD     fdwReason,						\	 LPVOID    lpvReserved)						\{									\  wchar_t wcbfr[1000];							\  char *tem;								\  switch (fdwReason)							\    {									\    case DLL_PROCESS_ATTACH:						\      GetModuleFileNameW ((HMODULE) hinstDLL, wcbfr, G_N_ELEMENTS (wcbfr)); \      tem = g_utf16_to_utf8 (wcbfr, -1, NULL, NULL, NULL);		\      dll_name = g_path_get_basename (tem);				\      g_free (tem);							\      break;								\    }									\									\  return TRUE;								\}#endif	/* !G_DISABLE_DEPRECATED */#endif /* G_PLATFORM_WIN32 */#endif /* __G_UTILS_H__ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -