ruby-dl2/doc/struct.txt
ruby-dl2
dl/struct.rb
dl/struct.rb provides methods so that we can easily deal with a memory.
dl.so, dl/import.rb, dl/func.rb
struct.txt
NAME
dl/struct.rb
SYNOPSIS
module LIBC extend DL::Importer # create a class which provides methods for accessing structure # members or union members. Timeval = struct [ "long tv_sec", "long tv_usec", ] end # create a proxy object to deal with a memory block addressed by 'addr'. struct1 = LIBC::Timeval.new(addr) # allocate a memory and create a proxy object to deal with it. struct2 = LIBC::Timeval.malloc() # access members. struct1.tv_sec() struct1.tv_usec() # obtain a pointer as a CPtr object. ptr = struct1.to_ptr() # obtain a pointer as an address. addr = struct1.to_i() # allocate a memory for an int value, create a proxy object for the memory # and returns the proxy object. struct3 = LIBC.value("int", 0) val = struct3.value()
DESCRIPTION
dl/struct.rb provides methods so that we can easily deal with a memory.
BUGS
SEE ALSO
dl.so, dl/import.rb, dl/func.rb
2006年09月20日(水) 17:24:20 Modified by aqualung