Ruby: ext/win32ole/win32ole_variant_m.c Source File

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

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