version 1.3, 2015/04/20 18:10:10
|
version 1.4, 2015/04/20 18:19:50
|
|
|
#define _common_h | #define _common_h |
| |
#include "config.h" | #include "config.h" |
|
#include <pal/memory.h> |
| |
#if defined(CONFIG_OS_LINUX) | #if defined(CONFIG_OS_LINUX) |
#ifndef _GNU_SOURCE | #ifndef _GNU_SOURCE |
|
|
#endif | #endif |
#endif | #endif |
| |
|
/* Define version for omigen:gen.cpp */ |
|
#define _MIAPIVERSION 2 |
|
|
#include <MI.h> | #include <MI.h> |
#include <stdio.h> | #include <stdio.h> |
#include <assert.h> | #include <assert.h> |
#include <stdarg.h> | #include <stdarg.h> |
#include <string.h> | #include <string.h> |
#include <stdlib.h> | #include <stdlib.h> |
|
#include <stdio.h> |
#include <errno.h> | #include <errno.h> |
| |
#if defined(_MSC_VER) | #if defined(_MSC_VER) |
# define GetPath __GetPath__ |
|
# include <winsock2.h> | # include <winsock2.h> |
# include <windows.h> | # include <windows.h> |
# include <io.h> | # include <io.h> |
# include <sal.h> | # include <sal.h> |
# include <direct.h> | # include <direct.h> |
# undef GetPath |
# include <ntassert.h> |
#else | #else |
# include <sys/types.h> | # include <sys/types.h> |
# include <sys/stat.h> | # include <sys/stat.h> |
# include <unistd.h> | # include <unistd.h> |
# include <wchar.h> | # include <wchar.h> |
|
# include <linux/sal.h> |
#endif | #endif |
| |
|
#include "localizestr.h" |
|
|
|
|
|
// Following will be used to limit the buffere size server can accept from provider host. |
|
// This is also used to limit the max size on http transport |
|
#define MAX_ENVELOPE_SIZE (250*1024) |
|
|
|
|
/* | /* |
**============================================================================== | **============================================================================== |
** | ** |
|
|
**============================================================================== | **============================================================================== |
*/ | */ |
| |
#define TRACE printf("TRACE: %s(%u)\n", __FILE__, __LINE__) |
#if defined(CONFIG_ENABLE_WCHAR) |
|
# define TRACE Wprintf(L"TRACE: %s(%u)\n", __FILE__, __LINE__) |
|
#else |
|
# define TRACE Printf("TRACE: %s(%u)\n", __FILE__, __LINE__) |
|
#endif |
| |
/* | /* |
**============================================================================== | **============================================================================== |
|
|
#define __nameSpace ((const MI_Char*)0) | #define __nameSpace ((const MI_Char*)0) |
#define __className ((const MI_Char*)0) | #define __className ((const MI_Char*)0) |
#define __methodName ((const MI_Char*)0) | #define __methodName ((const MI_Char*)0) |
#define __bookmark ((const MI_Char*)0) |
|
#define __subscriptionIDCount ((MI_Uint32)0) |
|
#define __subscriptionSelfPtr ((void**)0) |
|
#define __subscriptionSelf ((void*)0) |
|
#define __postIndication NULL |
|
| |
/* | /* |
**============================================================================== | **============================================================================== |
|
|
| |
typedef MI_Char* MI_String; | typedef MI_Char* MI_String; |
typedef const MI_Char* MI_ConstString; | typedef const MI_Char* MI_ConstString; |
|
typedef MI_Char ZChar; |
|
|
|
#define ZT MI_T |
| |
/* | /* |
**============================================================================== | **============================================================================== |
|
|
# define INLINE static __inline | # define INLINE static __inline |
#elif defined(sun) | #elif defined(sun) |
# define INLINE static inline | # define INLINE static inline |
#elif defined(aix) |
#elif defined(__PPC) |
# define INLINE static inline |
# define INLINE __inline__ |
#else | #else |
# define INLINE static __inline | # define INLINE static __inline |
#endif | #endif |
|
|
**============================================================================== | **============================================================================== |
*/ | */ |
| |
#if defined(__GNUC__) && (__GNUC__ >= 4) |
#if defined(__GNUC__) && (__GNUC__ >= 4) && !defined(CONFIG_ENABLE_WCHAR) |
# define PRINTF_FORMAT(N,M) __attribute__((format(printf, N, M))) | # define PRINTF_FORMAT(N,M) __attribute__((format(printf, N, M))) |
#else | #else |
# define PRINTF_FORMAT(N,M) /* empty */ | # define PRINTF_FORMAT(N,M) /* empty */ |
|
|
/* | /* |
**============================================================================== | **============================================================================== |
** | ** |
|
** TIMEOUT FOR CALLS TO select() |
|
** |
|
** Value, in msec, that different platforms need to fill or empty a |
|
** communications socket. |
|
** |
|
**============================================================================== |
|
*/ |
|
|
|
#if defined(CONFIG_PLATFORM_SUNOS_I86PC_SUNPRO) |
|
# define SELECT_BASE_TIMEOUT_MSEC 10 |
|
#elif defined(CONFIG_PLATFORM_SUNOS_SPARC_SUNPRO) |
|
# define SELECT_BASE_TIMEOUT_MSEC 10 |
|
#elif defined(CONFIG_PLATFORM_HPUX_IA64_HP) |
|
# define SELECT_BASE_TIMEOUT_MSEC 30 |
|
#elif defined(CONFIG_PLATFORM_HPUX_PARISC_HP) |
|
# define SELECT_BASE_TIMEOUT_MSEC 30 |
|
#elif defined(CONFIG_PLATFORM_AIX_PPC_IBM) |
|
# define SELECT_BASE_TIMEOUT_MSEC 20 |
|
#elif defined(LINUX_IX86_GNU) || defined (LINUX_X86_64_GNU) |
|
# define SELECT_BASE_TIMEOUT_MSEC 2 |
|
#else |
|
# define SELECT_BASE_TIMEOUT_MSEC 1 |
|
#endif |
|
|
|
/* |
|
**============================================================================== |
|
** |
** DEBUG_ASSERT() | ** DEBUG_ASSERT() |
** | ** |
**============================================================================== | **============================================================================== |
*/ | */ |
| |
|
#if defined(CONFIG_OS_WINDOWS) |
|
#if defined(CONFIG_ENABLE_DEBUG) |
|
#define DEBUG_ASSERT(x) NT_ASSERT(x) |
|
#else |
|
#ifdef _PREFAST_ |
|
// Copy same thing as a NT_ASSERT debug assert for a CHK build here, |
|
// to make PREFast happy (actual FRE build will not enter here) |
|
#define DEBUG_ASSERT(_exp) \ |
|
((!(_exp)) ? \ |
|
(__annotation(L"Debug", L"AssertFail", L#_exp), \ |
|
DbgRaiseAssertionFailure(), FALSE) : \ |
|
TRUE) |
|
#else |
|
#define DEBUG_ASSERT(x) |
|
#endif |
|
#endif |
|
#else |
#if defined(CONFIG_ENABLE_DEBUG) | #if defined(CONFIG_ENABLE_DEBUG) |
# define DEBUG_ASSERT(COND) assert(COND) | # define DEBUG_ASSERT(COND) assert(COND) |
#else | #else |
# define DEBUG_ASSERT(COND) /* empty */ | # define DEBUG_ASSERT(COND) /* empty */ |
#endif | #endif |
|
#endif |
| |
/* | /* |
**============================================================================== | **============================================================================== |
|
|
| |
#endif /* !defined(CONFIG_ENABLE_DEBUG) */ | #endif /* !defined(CONFIG_ENABLE_DEBUG) */ |
| |
|
/* |
|
**============================================================================== |
|
** |
|
** NAMESPACE_SEPARATOR |
|
** |
|
** The separator character for namespace names used on disk (note that |
|
** '/' cannot be used since it is the file system path separator). |
|
** |
|
**============================================================================== |
|
*/ |
|
|
|
#define NAMESPACE_SEPARATOR '-' |
|
|
|
typedef _Null_terminated_ const char* ConstCharPtr; |
|
typedef _Null_terminated_ char* CharPtr; |
|
typedef _Null_terminated_ CharPtr* CharPtrPtr; |
|
|
|
typedef _Null_terminated_ const wchar_t* ConstWcharPtr; |
|
typedef _Null_terminated_ wchar_t* WcharPtr; |
|
typedef _Null_terminated_ WcharPtr* WcharPtrPtr; |
|
|
|
|
|
#define MI_VERSION_GET_MAJOR(VERSION) ((VERSION & 0xFFFF0000) >> 16) |
|
#define MI_VERSION_GET_MINOR(VERSION) ((VERSION & 0x0000FF00) >> 8) |
|
#define MI_VERSION_GET_REVISION(VERSION) (VERSION & 0x000000FF) |
|
|
|
/* |
|
**============================================================================== |
|
** |
|
** union MI_ValuePtr |
|
** |
|
** A union that reflects the types of things that are pointed to by the |
|
** class, attribute and qualifier _value_ fields present in the structures |
|
** passed in the callbacks from the MOF compiler. |
|
** |
|
**============================================================================== |
|
*/ |
|
|
|
typedef union _MI_ValuePtr |
|
{ |
|
MI_Boolean* boolean; |
|
MI_Uint8* uint8; |
|
MI_Sint8* sint8; |
|
MI_Uint16* uint16; |
|
MI_Sint16* sint16; |
|
MI_Uint32* uint32; |
|
MI_Sint32* sint32; |
|
MI_Uint64* uint64; |
|
MI_Sint64* sint64; |
|
MI_Real32* real32; |
|
MI_Real64* real64; |
|
MI_Char16* char16; |
|
MI_Datetime* datetime; |
|
MI_Char* string; |
|
MI_Instance* instance; |
|
MI_Instance* reference; |
|
|
|
MI_BooleanA* booleana; |
|
MI_Uint8A* uint8a; |
|
MI_Sint8A* sint8a; |
|
MI_Uint16A* uint16a; |
|
MI_Sint16A* sint16a; |
|
MI_Uint32A* uint32a; |
|
MI_Sint32A* sint32a; |
|
MI_Uint64A* uint64a; |
|
MI_Sint64A* sint64a; |
|
MI_Real32A* real32a; |
|
MI_Real64A* real64a; |
|
MI_Char16A* char16a; |
|
MI_DatetimeA* datetimea; |
|
MI_StringA* stringa; |
|
MI_ReferenceA* referencea; |
|
MI_InstanceA* instancea; |
|
MI_Array* array; |
|
|
|
void* generic; |
|
|
|
} MI_ValuePtr; |
|
|
#endif /* _common_h */ | #endif /* _common_h */ |