1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
|
/*********************************************************
* Copyright (C) 2006 VMware, Inc. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation version 2.1 and no later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
*********************************************************/
/*
* productState.h --
*
* ProductState is a runtime encapsulation of the identity of a product
* and product dependent characteristics.
*/
#ifndef _PRODUCT_STATE_H_
#define _PRODUCT_STATE_H_
#include "vm_basic_types.h"
/*
* Public types.
*/
typedef enum {
PRODUCT_GENERIC = 0,
PRODUCT_WORKSTATION = 1 << 0,
PRODUCT_SERVER = 1 << 1,
PRODUCT_ESX = 1 << 2,
PRODUCT_PLAYER = 1 << 3,
PRODUCT_TOOLS = 1 << 4,
PRODUCT_VDM_CLIENT = 1 << 5,
PRODUCT_CVP = 1 << 6,
/* etc */
} Product;
typedef uint64 ProductMask;
typedef uint64 ProductCaps;
/*
* Define as needed.
*
* #define PRODUCT_CAP_FOO (1 << 0)
*/
typedef enum {
PRODUCTSTATE_FLAG_NONE = 0,
PRODUCTSTATE_FLAG_PRODUCT = 1 << 0,
PRODUCTSTATE_FLAG_NAME = 1 << 1,
PRODUCTSTATE_FLAG_VERSION = 1 << 2,
PRODUCTSTATE_FLAG_BUILDNUMBER = 1 << 3,
PRODUCTSTATE_FLAG_CAPABILITIES = 1 << 4,
PRODUCTSTATE_FLAG_LICENSENAME = 1 << 5,
PRODUCTSTATE_FLAG_LICENSEVERSION = 1 << 6,
} ProductStateSerializationFlags;
/*
* Public functions.
*
* It is not generally safe to cache returned const pointers; if a caller
* wants to cache a value, they should copy it.
*/
void ProductState_Set(Product product, const char *name, const char *version,
unsigned int buildNumber, ProductCaps capabilities,
const char *licenseName, const char *licenseVersion);
void ProductState_Reset(void);
Product ProductState_GetProduct(void);
Bool ProductState_IsProduct(ProductMask product);
const char *ProductState_GetName(void);
const char *ProductState_GetVersion(void);
unsigned int ProductState_GetBuildNumber(void);
ProductCaps ProductState_GetCapabilities(void);
const char *ProductState_GetLicenseName(void);
const char *ProductState_GetLicenseVersion(void);
/* etc */
const char *ProductState_GetFullVersion(void);
const char *ProductState_GetBuildNumberString(void);
const char *ProductState_GetRegistryPath(void);
char *ProductState_GetRegistryPathForProduct(const char *productName);
void ProductState_GetVersionNumber(unsigned int *major, unsigned int *minor,
unsigned int *patchLevel);
char *ProductState_Serialize(ProductStateSerializationFlags flags);
ProductStateSerializationFlags ProductState_Deserialize(const char *state);
#endif /* _PRODUCT_STATE_H_ */
|