Create  Edit  Diff  FrontPage  Index  Search  Changes  Login

cstruct

cstruct is an utility that convert C struct for Ruby.

inspired by aamine's dbf

http://arton.no-ip.info/data/cstruct/cstruct-0.1.1.zip

abstract

  • ANSI compatible member alignment.
  • Win32 PCSTR and PWCSTR auto conversion.

example

require 'cstruct'

class Foo
  include C
  HTTP_VERSION = Struct.define {
    USHORT :MajorVersion;
    USHORT :MinorVersion;
  }
  HTTP_KNOWN_HEADER = Struct.define {
    USHORT :RawValueLength;
    PCSTR :pRawValue;
  }
  ...
end
Last modified:2006/12/31 13:35:03
Keyword(s):
References: