~ubuntu-branches/ubuntu/quantal/open-vm-tools/quantal-201210021442

« back to all changes in this revision

Viewing changes to lib/include/rpcin.h

  • Committer: Bazaar Package Importer
  • Author(s): Serge Hallyn
  • Date: 2011-03-31 14:20:05 UTC
  • mfrom: (1.4.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20110331142005-3n9red91p7ogkweo
Tags: 2011.03.28-387002-0ubuntu1
* Merge latest upstream git tag.  This has the unlocked_ioctl change
  needed to fix dkms build failures (LP: #727342)
* Changes in debian/rules:
  - work around a bug in toolbox/Makefile, where install-exec-hook is
    not happening.  This needs to get fixed the right way.
  - don't install 'vmware-user' which seems to no longer exist
  - move /etc/xdg into open-vm-toolbox (which should be done using .install)
* debian/open-vm-tools.init: add 'modprobe [-r] vmblock'. (LP: #332323)
* debian/rules and debian/open-vm-toolbox.lintian-overrides:
  - Make vmware-user-suid-wrapper suid-root (LP: #332323)

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
extern "C" {
32
32
#endif
33
33
 
34
 
#if defined(VMTOOLS_USE_GLIB)
35
 
#  include <glib.h>
36
 
   typedef gboolean RpcInRet;
37
 
#else
38
 
#  include "dbllnklst.h"
39
 
   typedef Bool RpcInRet;
40
 
#endif
41
 
 
42
34
typedef void RpcIn_ErrorFunc(void *clientData, char const *status);
43
35
 
44
36
typedef struct RpcIn RpcIn;
45
37
 
46
 
#if defined(VMTOOLS_USE_GLIB)
 
38
#if defined(VMTOOLS_USE_GLIB) /* { */
 
39
 
 
40
#include "vmware/tools/guestrpc.h"
47
41
 
48
42
RpcIn *RpcIn_Construct(GMainContext *mainCtx,
49
43
                       RpcIn_Callback dispatch,
52
46
Bool RpcIn_start(RpcIn *in, unsigned int delay,
53
47
                 RpcIn_ErrorFunc *errorFunc, void *errorData);
54
48
 
55
 
#else
56
 
 
57
 
/* Data passed to new-style RpcIn callbacks. */
58
 
typedef struct RpcInData {
59
 
   /* Data from the host's RPC request. */
60
 
   const char *name;
61
 
   const char *args;
62
 
   size_t argsSize;
63
 
   /* Data to be returned to the host. */
64
 
   char *result;
65
 
   size_t resultLen;
66
 
   Bool freeResult;
67
 
   /* Client data. */
68
 
   void *appCtx;
69
 
   void *clientData;
70
 
} RpcInData;
71
 
 
72
 
 
73
 
/*
74
 
 * Type for RpcIn callbacks. The callback function is responsible for
75
 
 * allocating memory for the result string.
76
 
 */
77
 
typedef RpcInRet (*RpcIn_Callback)(RpcInData *data);
78
 
 
 
49
#else /* } { */
 
50
 
 
51
#include "dbllnklst.h"
79
52
 
80
53
/*
81
54
 * Type for old RpcIn callbacks. Don't use this anymore - this is here
82
55
 * for backwards compatibility.
83
56
 */
84
57
typedef Bool
85
 
(*RpcIn_CallbackOld)(char const **result,     // OUT
86
 
                     size_t *resultLen,       // OUT
87
 
                     const char *name,        // IN
88
 
                     const char *args,        // IN
89
 
                     size_t argsSize,         // IN
90
 
                     void *clientData);       // IN
 
58
(*RpcIn_Callback)(char const **result,     // OUT
 
59
                  size_t *resultLen,       // OUT
 
60
                  const char *name,        // IN
 
61
                  const char *args,        // IN
 
62
                  size_t argsSize,         // IN
 
63
                  void *clientData);       // IN
91
64
 
92
65
RpcIn *RpcIn_Construct(DblLnkLst_Links *eventQueue);
93
66
 
100
73
 * Use RpcIn_RegisterCallbackEx() instead.
101
74
 */
102
75
void RpcIn_RegisterCallback(RpcIn *in, const char *name,
103
 
                            RpcIn_CallbackOld callback, void *clientData);
 
76
                            RpcIn_Callback callback, void *clientData);
104
77
 
105
 
void RpcIn_RegisterCallbackEx(RpcIn *in, const char *name,
106
 
                              RpcIn_Callback callback, void *clientData);
107
78
void RpcIn_UnregisterCallback(RpcIn *in, const char *name);
108
79
 
109
 
/* Helper macro for porting old callbacks that currently use RpcIn_SetRetVals. */
110
 
#define RPCIN_SETRETVALS(data, val, retVal)                                \
111
 
   RpcIn_SetRetVals((char const **) &(data)->result, &(data)->resultLen,   \
112
 
                    (val), (retVal))
113
 
 
114
80
unsigned int RpcIn_SetRetVals(char const **result, size_t *resultLen,
115
81
                              const char *resultVal, Bool retVal);
116
82
 
117
 
#endif
 
83
#endif /* } */
118
84
 
119
85
void RpcIn_Destruct(RpcIn *in);
120
 
Bool RpcIn_restart(RpcIn *in);
121
 
Bool RpcIn_stop(RpcIn *in);
122
 
 
 
86
void RpcIn_stop(RpcIn *in);
123
87
 
124
88
#ifdef __cplusplus
125
89
} // extern "C"