~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to lib/guestRpc/ghiGetBinaryHandlers.x

  • Committer: Bazaar Package Importer
  • Author(s): Devid Antonio Filoni
  • Date: 2008-08-15 21:21:40 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20080815212140-05fhxj8wroosysmj
Tags: 2008.08.08-109361-1ubuntu1
* Merge from Debian unstable (LP: #258393), remaining Ubuntu change:
  - add ubuntu_toolchain_FTBFS.dpatch patch, fix FTBFS
* Update ubuntu_toolchain_FTBFS.dpatch patch for the new version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*********************************************************
 
2
 * Copyright (C) 2008 VMware, Inc. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License as published
 
6
 * by the Free Software Foundation version 2.1 and no later version.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
10
 * or FITNESS FOR A PARTICULAR PURPOSE.  See the Lesser GNU General Public
 
11
 * License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU Lesser General Public License
 
14
 * along with this program; if not, write to the Free Software Foundation, Inc.,
 
15
 * 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA.
 
16
 *
 
17
 *********************************************************/
 
18
 
 
19
/*
 
20
 * ghiGetBinaryHandlers.x --
 
21
 *
 
22
 *    Definition of the data structures used in the GuestRpc commands to
 
23
 *    provide information about the types of files a given binary supports.
 
24
 */
 
25
 
 
26
 
 
27
/*
 
28
 * Enumerates the different versions of the messages.
 
29
 */
 
30
enum GHIBinaryHandlersVersion {
 
31
    GHI_BINARY_HANDLERS_V1 = 1
 
32
};
 
33
 
 
34
const GHI_HANDLERS_SUFFIX_MAX_LEN = 32;
 
35
const GHI_HANDLERS_MIMETYPE_MAX_LEN = 256;
 
36
const GHI_HANDLERS_UTI_MAX_LEN = 256;
 
37
const GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN = 256;
 
38
const GHI_HANDLERS_MAX_NUM_ICONS = 8;
 
39
const GHI_HANDLERS_VERB_MAX_LEN = 64;
 
40
const GHI_MAX_NUM_ACTION_URI_PAIRS = 16;
 
41
 
 
42
/*
 
43
 * The Windows MAX_PATH define specifies that paths may be up to 260 character
 
44
 * units in length. To allow for expansion when going to UTF8 we multiply that
 
45
 * value by 4 here.
 
46
 */
 
47
const GHI_HANDLERS_ACTIONURI_MAX_PATH = 1040;
 
48
 
 
49
/*
 
50
 * Maximum number of filetypes that may be encoded in a single
 
51
 * XDR array.
 
52
 */
 
53
const GHI_MAX_NUM_BINARY_HANDLERS = 32;
 
54
 
 
55
struct GHIBinaryHandlersIconDetails {
 
56
   /*
 
57
    * The icon dimensions in pixels
 
58
    */
 
59
   int width;
 
60
   int height;
 
61
 
 
62
   /*
 
63
    * A string identifier for this icon that can be used to retrieve
 
64
    * the specific pixel data using GHI_GET_ICON_DATA
 
65
    */
 
66
   string identifier<GHI_HANDLERS_ACTIONURI_MAX_PATH>;
 
67
};
 
68
 
 
69
struct GHIBinaryHandlersActionURIPair {
 
70
   /*
 
71
    * The verb for the action URI (typically something like run or print).
 
72
    */
 
73
   string verb<GHI_HANDLERS_VERB_MAX_LEN>;
 
74
 
 
75
   /*
 
76
    * The executable path to use when launching the binary with this particular
 
77
    * filetype and verb. Some filetypes may require additional or different command line
 
78
    * arguments for a given verb that can be encoded here.
 
79
    */
 
80
   string actionURI<GHI_HANDLERS_ACTIONURI_MAX_PATH>;
 
81
};
 
82
 
 
83
struct GHIBinaryHandlersDetails {
 
84
   /*
 
85
    * The file suffix (including leading period character).
 
86
    */
 
87
   string suffix<GHI_HANDLERS_SUFFIX_MAX_LEN>;
 
88
 
 
89
   /*
 
90
    * A mimetype - if available.
 
91
    */
 
92
   string mimetype<GHI_HANDLERS_MIMETYPE_MAX_LEN>;
 
93
 
 
94
   /*
 
95
    * A UTI (universal type identifier) - if available.
 
96
    */
 
97
   string UTI<GHI_HANDLERS_UTI_MAX_LEN>;
 
98
 
 
99
   /*
 
100
    * A list of the verbs (run, print etc.) and their matching
 
101
    * action URIs.
 
102
    */
 
103
   struct GHIBinaryHandlersActionURIPair actionURIs<GHI_MAX_NUM_ACTION_URI_PAIRS>;
 
104
 
 
105
   /*
 
106
    * A friendly name displayed for this document/filetype.
 
107
    */
 
108
   string friendlyName<GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN>;
 
109
 
 
110
   /*
 
111
    * A list of the different sized icons for this filetype.
 
112
    */
 
113
   struct GHIBinaryHandlersIconDetails icons<GHI_HANDLERS_MAX_NUM_ICONS>;
 
114
};
 
115
 
 
116
struct GHIBinaryHandlersList {
 
117
   struct GHIBinaryHandlersDetails handlers<GHI_MAX_NUM_BINARY_HANDLERS>;
 
118
};
 
119
 
 
120
/*
 
121
 * This defines the protocol for a 'get.binary.handlers' message. The union allows
 
122
 * us to create new versions of the protocol later by creating new values
 
123
 * in the GHIBinaryHandlersVersion enumeration, without having to change much of
 
124
 * the code calling the (de)serialization functions.
 
125
 *
 
126
 * Since the union doesn't have a default case, de-serialization will fail
 
127
 * if an unknown version is provided on the wire.
 
128
 */
 
129
union GHIBinaryHandlers switch (GHIBinaryHandlersVersion ver) {
 
130
case GHI_BINARY_HANDLERS_V1:
 
131
   struct GHIBinaryHandlersList *handlersV1;
 
132
};
 
133