Ruby  2.5.0dev(2017-10-22revision60238)
win32ole_variant_m.c
Go to the documentation of this file.
1 #include "win32ole.h"
2 
4 {
5  /*
6  * Document-module: WIN32OLE::VARIANT
7  *
8  * The WIN32OLE::VARIANT module includes constants of VARIANT type constants.
9  * The constants is used when creating WIN32OLE_VARIANT object.
10  *
11  * obj = WIN32OLE_VARIANT.new("2e3", WIN32OLE::VARIANT::VT_R4)
12  * obj.value # => 2000.0
13  *
14  */
16 
17  /*
18  * represents VT_EMPTY type constant.
19  */
20  rb_define_const(mWIN32OLE_VARIANT, "VT_EMPTY", RB_INT2FIX(VT_EMPTY));
21 
22  /*
23  * represents VT_NULL type constant.
24  */
25  rb_define_const(mWIN32OLE_VARIANT, "VT_NULL", RB_INT2FIX(VT_NULL));
26 
27  /*
28  * represents VT_I2 type constant.
29  */
31 
32  /*
33  * represents VT_I4 type constant.
34  */
36 
37  /*
38  * represents VT_R4 type constant.
39  */
41 
42  /*
43  * represents VT_R8 type constant.
44  */
46 
47  /*
48  * represents VT_CY type constant.
49  */
51 
52  /*
53  * represents VT_DATE type constant.
54  */
55  rb_define_const(mWIN32OLE_VARIANT, "VT_DATE", RB_INT2FIX(VT_DATE));
56 
57  /*
58  * represents VT_BSTR type constant.
59  */
60  rb_define_const(mWIN32OLE_VARIANT, "VT_BSTR", RB_INT2FIX(VT_BSTR));
61 
62  /*
63  * represents VT_USERDEFINED type constant.
64  */
65  rb_define_const(mWIN32OLE_VARIANT, "VT_USERDEFINED", RB_INT2FIX(VT_USERDEFINED));
66 
67  /*
68  * represents VT_PTR type constant.
69  */
70  rb_define_const(mWIN32OLE_VARIANT, "VT_PTR", RB_INT2FIX(VT_PTR));
71 
72  /*
73  * represents VT_DISPATCH type constant.
74  */
75  rb_define_const(mWIN32OLE_VARIANT, "VT_DISPATCH", RB_INT2FIX(VT_DISPATCH));
76 
77  /*
78  * represents VT_ERROR type constant.
79  */
80  rb_define_const(mWIN32OLE_VARIANT, "VT_ERROR", RB_INT2FIX(VT_ERROR));
81 
82  /*
83  * represents VT_BOOL type constant.
84  */
85  rb_define_const(mWIN32OLE_VARIANT, "VT_BOOL", RB_INT2FIX(VT_BOOL));
86 
87  /*
88  * represents VT_VARIANT type constant.
89  */
90  rb_define_const(mWIN32OLE_VARIANT, "VT_VARIANT", RB_INT2FIX(VT_VARIANT));
91 
92  /*
93  * represents VT_UNKNOWN type constant.
94  */
95  rb_define_const(mWIN32OLE_VARIANT, "VT_UNKNOWN", RB_INT2FIX(VT_UNKNOWN));
96 
97  /*
98  * represents VT_I1 type constant.
99  */
100  rb_define_const(mWIN32OLE_VARIANT, "VT_I1", RB_INT2FIX(VT_I1));
101 
102  /*
103  * represents VT_UI1 type constant.
104  */
105  rb_define_const(mWIN32OLE_VARIANT, "VT_UI1", RB_INT2FIX(VT_UI1));
106 
107  /*
108  * represents VT_UI2 type constant.
109  */
110  rb_define_const(mWIN32OLE_VARIANT, "VT_UI2", RB_INT2FIX(VT_UI2));
111 
112  /*
113  * represents VT_UI4 type constant.
114  */
115  rb_define_const(mWIN32OLE_VARIANT, "VT_UI4", RB_INT2FIX(VT_UI4));
116 
117 #if (_MSC_VER >= 1300) || defined(__CYGWIN__) || defined(__MINGW32__)
118  /*
119  * represents VT_I8 type constant.
120  */
121  rb_define_const(mWIN32OLE_VARIANT, "VT_I8", RB_INT2FIX(VT_I8));
122 
123  /*
124  * represents VT_UI8 type constant.
125  */
126  rb_define_const(mWIN32OLE_VARIANT, "VT_UI8", RB_INT2FIX(VT_UI8));
127 #endif
128 
129  /*
130  * represents VT_INT type constant.
131  */
132  rb_define_const(mWIN32OLE_VARIANT, "VT_INT", RB_INT2FIX(VT_INT));
133 
134  /*
135  * represents VT_UINT type constant.
136  */
137  rb_define_const(mWIN32OLE_VARIANT, "VT_UINT", RB_INT2FIX(VT_UINT));
138 
139  /*
140  * represents VT_ARRAY type constant.
141  */
142  rb_define_const(mWIN32OLE_VARIANT, "VT_ARRAY", RB_INT2FIX(VT_ARRAY));
143 
144  /*
145  * represents VT_BYREF type constant.
146  */
147  rb_define_const(mWIN32OLE_VARIANT, "VT_BYREF", RB_INT2FIX(VT_BYREF));
148 
149 }
VALUE cWIN32OLE
Definition: win32ole.c:37
void Init_win32ole_variant_m(void)
void rb_define_const(VALUE, const char *, VALUE)
Definition: variable.c:2691
VALUE rb_define_module_under(VALUE outer, const char *name)
Definition: class.c:790
#define RB_INT2FIX(i)
Definition: ruby.h:231
VALUE mWIN32OLE_VARIANT