summaryrefslogtreecommitdiff
path: root/ext/dl/lib/dl/import.rb
diff options
context:
space:
mode:
authordrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-30 22:48:42 +0000
committerdrbrain <drbrain@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-05-30 22:48:42 +0000
commit2e87e2150e04c37595c02095c410decadfb9977e (patch)
tree476c33a5015665a9bf66aace605ddca10d411ba0 /ext/dl/lib/dl/import.rb
parentd3a349bbc3d0cd61322b86b500032d75d25a6ec3 (diff)
* ext/dl: Added documentation. Patch by Vincent Batts.
[ruby-trunk - Bug #6496] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dl/lib/dl/import.rb')
-rw-r--r--ext/dl/lib/dl/import.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/dl/lib/dl/import.rb b/ext/dl/lib/dl/import.rb
index eec65cdfd6..a318430b73 100644
--- a/ext/dl/lib/dl/import.rb
+++ b/ext/dl/lib/dl/import.rb
@@ -179,11 +179,17 @@ module DL
f
end
+ # Creates a class to wrap the C struct described by +signature+.
+ #
+ # MyStruct = struct ['int i', 'char c']
def struct(signature)
tys, mems = parse_struct_signature(signature, @type_alias)
DL::CStructBuilder.create(CStruct, tys, mems)
end
+ # Creates a class to wrap the C union described by +signature+.
+ #
+ # MyUnion = union ['int i', 'char c']
def union(signature)
tys, mems = parse_struct_signature(signature, @type_alias)
DL::CStructBuilder.create(CUnion, tys, mems)