• Main Page
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

lib/include/vmware/tools/utils.h

Go to the documentation of this file.
00001 /*********************************************************
00002  * Copyright (C) 2008 VMware, Inc. All rights reserved.
00003  *
00004  * This program is free software; you can redistribute it and/or modify it
00005  * under the terms of the GNU Lesser General Public License as published
00006  * by the Free Software Foundation version 2.1 and no later version.
00007  *
00008  * This program is distributed in the hope that it will be useful, but
00009  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
00010  * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
00011  * License for more details.
00012  *
00013  * You should have received a copy of the GNU Lesser General Public License
00014  * along with this program; if not, write to the Free Software Foundation, Inc.,
00015  * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
00016  *
00017  *********************************************************/
00018 
00019 #ifndef _VMWARE_TOOLS_UTILS_H_
00020 #define _VMWARE_TOOLS_UTILS_H_
00021 
00031 #define  VMTOOLS_GUEST_SERVICE   "vmsvc"
00032 #define  VMTOOLS_USER_SERVICE    "vmusr"
00033 
00034 #if defined(__cplusplus)
00035 #  define VMTOOLS_EXTERN_C extern "C"
00036 #else
00037 #  define VMTOOLS_EXTERN_C
00038 #endif
00039 
00040 #include <glib.h>
00041 #if defined(G_PLATFORM_WIN32)
00042 #  include <windows.h>
00043 #else
00044 #  include <signal.h>
00045 #  include <sys/time.h>
00046 #endif
00047 
00048 
00049 /* Work around a glib limitation: it doesn't set G_INLINE_FUNC on Win32. */
00050 #if defined(G_PLATFORM_WIN32)
00051 #  if defined(G_INLINE_FUNC)
00052 #     undef G_INLINE_FUNC
00053 #  endif
00054 #  define G_INLINE_FUNC static __inline
00055 #endif
00056 
00057 
00070 #if defined(G_PLATFORM_WIN32)
00071 #  define VMTOOLS_GET_FILENAME_LOCAL(path, err) (gchar *) (path)
00072 #else
00073 #  define VMTOOLS_GET_FILENAME_LOCAL(path, err) g_filename_from_utf8((path),  \
00074                                                                      -1,      \
00075                                                                      NULL,    \
00076                                                                      NULL,    \
00077                                                                      (err))
00078 #endif
00079 
00086 #if defined(G_PLATFORM_WIN32)
00087 #  define VMTOOLS_RELEASE_FILENAME_LOCAL(path)   (void) (path)
00088 #else
00089 #  define VMTOOLS_RELEASE_FILENAME_LOCAL(path)   g_free(path)
00090 #endif
00091 
00092 G_BEGIN_DECLS
00093 
00094 void
00095 vm_free(void *ptr);
00096 
00097 void
00098 VMTools_ConfigLogging(const gchar *defaultDomain,
00099                       GKeyFile *cfg,
00100                       gboolean force,
00101                       gboolean reset);
00102 
00103 gboolean
00104 VMTools_LoadConfig(const gchar *path,
00105                    GKeyFileFlags flags,
00106                    GKeyFile **config,
00107                    time_t *mtime);
00108 
00109 gboolean
00110 VMTools_WriteConfig(const gchar *path,
00111                     GKeyFile *config,
00112                     GError **err);
00113 
00114 #if defined(G_PLATFORM_WIN32)
00115 
00116 gboolean
00117 VMTools_AttachConsole(void);
00118 
00119 GSource *
00120 VMTools_NewHandleSource(HANDLE h);
00121 
00122 #else
00123 
00125 typedef gboolean (*SignalSourceCb)(const siginfo_t *, gpointer);
00126 
00127 GSource *
00128 VMTools_NewSignalSource(int signum);
00129 
00130 #endif
00131 
00132 GArray *
00133 VMTools_WrapArray(gconstpointer data,
00134                   guint elemSize,
00135                   guint count);
00136 
00137 G_END_DECLS
00138 
00141 #endif /* _VMWARE_TOOLS_UTILS_H_ */
00142 

Generated on Wed Sep 8 2010 13:41:10 for open-vm-tools 2010.06.16 by  doxygen 1.7.1