summaryrefslogtreecommitdiff
path: root/ext/win32ole/win32ole_variant.c
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-25 22:46:15 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-25 22:46:15 +0000
commit5d2ce2fb40fecc7ad8431886d2bc3ab2aa0a69ec (patch)
tree5dd041e781038b14ace319df575d081bdd797dfb /ext/win32ole/win32ole_variant.c
parent1fe90db5380117580ae41be4f3d01686aaa73697 (diff)
downloadruby-5d2ce2fb40fecc7ad8431886d2bc3ab2aa0a69ec.tar.gz
ext/win32ole/win32ole.c (ole_val2variant, ole_invoke): refactoring.
use ole_variant2variant to convert WIN32OLE_VARIANT object to VARIANT object. ext/win32ole/win32ole_variant.c: refactoring. add ole_variant2variant. ext/win32ole/win32ole_variant.h: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48139 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole/win32ole_variant.c')
-rw-r--r--ext/win32ole/win32ole_variant.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/win32ole/win32ole_variant.c b/ext/win32ole/win32ole_variant.c
index ef5227b5c9..308e555e4e 100644
--- a/ext/win32ole/win32ole_variant.c
+++ b/ext/win32ole/win32ole_variant.c
@@ -1,5 +1,10 @@
#include "win32ole.h"
+struct olevariantdata {
+ VARIANT realvar;
+ VARIANT var;
+};
+
static void olevariant_free(struct olevariantdata *pvar);
static void ole_val2olevariantdata(VALUE val, VARTYPE vt, struct olevariantdata *pvar);
static void ole_val2variant_err(VALUE val, VARIANT *var);
@@ -665,6 +670,14 @@ folevariant_set_value(VALUE self, VALUE val)
}
void
+ole_variant2variant(VALUE val, VARIANT *var)
+{
+ struct olevariantdata *pvar;
+ Data_Get_Struct(val, struct olevariantdata, pvar);
+ VariantCopy(var, &(pvar->var));
+}
+
+void
Init_win32ole_variant(void)
{
cWIN32OLE_VARIANT = rb_define_class("WIN32OLE_VARIANT", rb_cObject);