ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

variant.h
Go to the documentation of this file.
00001 /*
00002  * Variant Inlines
00003  *
00004  * Copyright 2003 Jon Griffiths
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
00019  */
00020 #define NONAMELESSUNION
00021 #define NONAMELESSSTRUCT
00022 #include "windef.h"
00023 #include "winerror.h"
00024 #include "objbase.h"
00025 #include "oleauto.h"
00026 #include <math.h>
00027 
00028 /* Get just the type from a variant pointer */
00029 #define V_TYPE(v)  (V_VT((v)) & VT_TYPEMASK)
00030 
00031 /* Flags set in V_VT, other than the actual type value */
00032 #define VT_EXTRA_TYPE (VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED)
00033 
00034 /* Get the extra flags from a variant pointer */
00035 #define V_EXTRA_TYPE(v) (V_VT((v)) & VT_EXTRA_TYPE)
00036 
00037 /* Missing in Windows but useful VTBIT_* defines */
00038 #define VTBIT_BOOL      (1 << VT_BSTR)
00039 #define VTBIT_BSTR      (1 << VT_BSTR)
00040 #define VTBIT_DATE      (1 << VT_DATE)
00041 #define VTBIT_DISPATCH  (1 << VT_DISPATCH)
00042 #define VTBIT_EMPTY     (1 << VT_EMPTY)
00043 #define VTBIT_ERROR     (1 << VT_ERROR)
00044 #define VTBIT_INT       (1 << VT_INT)
00045 #define VTBIT_NULL      (1 << VT_NULL)
00046 #define VTBIT_UINT      (1 << VT_UINT)
00047 #define VTBIT_UNKNOWN   (1 << VT_UNKNOWN)
00048 #define VTBIT_VARIANT   (1 << VT_VARIANT)
00049 #define VTBIT_15        (1 << 15)        /* no variant type with this number */
00050 
00051 extern const char * const wine_vtypes[];
00052 #define debugstr_vt(v) (((v)&VT_TYPEMASK) <= VT_CLSID ? wine_vtypes[((v)&VT_TYPEMASK)] : \
00053   ((v)&VT_TYPEMASK) == VT_BSTR_BLOB ? "VT_BSTR_BLOB": "Invalid")
00054 #define debugstr_VT(v) (!(v) ? "(null)" : debugstr_vt(V_TYPE((v))))
00055 
00056 extern const char * const wine_vflags[];
00057 #define debugstr_vf(v) (wine_vflags[((v)&VT_EXTRA_TYPE)>>12])
00058 #define debugstr_VF(v) (!(v) ? "(null)" : debugstr_vf(V_EXTRA_TYPE(v)))
00059 
00060 /* Size constraints */
00061 #define I1_MAX   0x7f
00062 #define I1_MIN   ((-I1_MAX)-1)
00063 #define UI1_MAX  0xff
00064 #define UI1_MIN  0
00065 #define I2_MAX   0x7fff
00066 #define I2_MIN   ((-I2_MAX)-1)
00067 #define UI2_MAX  0xffff
00068 #define UI2_MIN  0
00069 #define I4_MAX   0x7fffffff
00070 #define I4_MIN   ((-I4_MAX)-1)
00071 #define UI4_MAX  0xffffffff
00072 #define UI4_MIN  0
00073 #define I8_MAX   (((LONGLONG)I4_MAX << 32) | UI4_MAX)
00074 #define I8_MIN   ((-I8_MAX)-1)
00075 #define UI8_MAX  (((ULONGLONG)UI4_MAX << 32) | UI4_MAX)
00076 #define UI8_MIN  0
00077 #define DATE_MAX 2958465
00078 #define DATE_MIN -657434
00079 #define R4_MAX 3.402823567797336e38
00080 #define R4_MIN 1.40129846432481707e-45
00081 #define R8_MAX 1.79769313486231470e+308
00082 #define R8_MIN 4.94065645841246544e-324
00083 
00084 /* Value of sign for a positive decimal number */
00085 #define DECIMAL_POS 0
00086 
00087 /* Native headers don't change the union ordering for DECIMAL sign/scale (duh).
00088  * This means that the signscale member is only useful for setting both members to 0.
00089  * SIGNSCALE creates endian-correct values so that we can properly set both at once
00090  * to values other than 0.
00091  */
00092 #ifdef WORDS_BIGENDIAN
00093 #define SIGNSCALE(sign,scale) (((scale) << 8) | sign)
00094 #else
00095 #define SIGNSCALE(sign,scale) (((sign) << 8) | scale)
00096 #endif
00097 
00098 /* Macros for getting at a DECIMAL's parts */
00099 #define DEC_SIGN(d)      ((d)->u.s.sign)
00100 #define DEC_SCALE(d)     ((d)->u.s.scale)
00101 #define DEC_SIGNSCALE(d) ((d)->u.signscale)
00102 #define DEC_HI32(d)      ((d)->Hi32)
00103 #define DEC_MID32(d)     ((d)->u1.s1.Mid32)
00104 #define DEC_LO32(d)      ((d)->u1.s1.Lo32)
00105 #define DEC_LO64(d)      ((d)->u1.Lo64)
00106 
00107 #define DEC_MAX_SCALE    28 /* Maximum scale for a decimal */
00108 
00109 /* Internal flags for low level conversion functions */
00110 #define  VAR_BOOLONOFF 0x0400 /* Convert bool to "On"/"Off" */
00111 #define  VAR_BOOLYESNO 0x0800 /* Convert bool to "Yes"/"No" */
00112 #define  VAR_NEGATIVE  0x1000 /* Number is negative */
00113 
00114 /* The localised characters that make up a valid number */
00115 typedef struct tagVARIANT_NUMBER_CHARS
00116 {
00117   WCHAR cNegativeSymbol;
00118   WCHAR cPositiveSymbol;
00119   WCHAR cDecimalPoint;
00120   WCHAR cDigitSeparator;
00121   WCHAR cCurrencyLocal;
00122   WCHAR cCurrencyLocal2;
00123   WCHAR cCurrencyDecimalPoint;
00124   WCHAR cCurrencyDigitSeparator;
00125 } VARIANT_NUMBER_CHARS;
00126 
00127 
00128 BOOL VARIANT_GetLocalisedText(LANGID, DWORD, WCHAR *);
00129 HRESULT VARIANT_ClearInd(VARIANTARG *);

Generated on Sat May 26 2012 04:24:25 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.