<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/test/fiddle/test_c_struct_builder.rb, branch v3_3_11</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>[ruby/fiddle] Improve "offsetof" calculations (https://github.com/ruby/fiddle/pull/90)</title>
<updated>2021-08-24T07:18:22+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2021-08-19T23:43:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0f1e8f38c9cd008eb24e6c957388a183eac910ca'/>
<id>0f1e8f38c9cd008eb24e6c957388a183eac910ca</id>
<content type='text'>
I need to get the offset of members inside sub structures.  This patch
adds sub-structure offset support for structs.

https://github.com/ruby/fiddle/commit/cf78eddbb6
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
I need to get the offset of members inside sub structures.  This patch
adds sub-structure offset support for structs.

https://github.com/ruby/fiddle/commit/cf78eddbb6
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/fiddle] Add "offsetof" to Struct classes (https://github.com/ruby/fiddle/pull/83)</title>
<updated>2021-07-13T10:37:46+00:00</updated>
<author>
<name>Aaron Patterson</name>
<email>tenderlove@ruby-lang.org</email>
</author>
<published>2021-07-01T00:35:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=5c0d8c6369f92915bf99924f58f0763abe4f493e'/>
<id>5c0d8c6369f92915bf99924f58f0763abe4f493e</id>
<content type='text'>
* Add "offsetof" to Struct classes

I need to get the offset of a member inside a struct without allocating
the struct.  This patch adds an "offsetof" class method to structs that
are generated.

The usage is like this:

```ruby
MyStruct = struct [
  "int64_t i",
  "char c",
]

MyStruct.offsetof("i") # =&gt; 0
MyStruct.offsetof("c") # =&gt; 8
```

* Update test/fiddle/test_c_struct_builder.rb

Co-authored-by: Sutou Kouhei &lt;kou@cozmixng.org&gt;

https://github.com/ruby/fiddle/commit/4e3b60c5b6

Co-authored-by: Sutou Kouhei &lt;kou@cozmixng.org&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add "offsetof" to Struct classes

I need to get the offset of a member inside a struct without allocating
the struct.  This patch adds an "offsetof" class method to structs that
are generated.

The usage is like this:

```ruby
MyStruct = struct [
  "int64_t i",
  "char c",
]

MyStruct.offsetof("i") # =&gt; 0
MyStruct.offsetof("c") # =&gt; 8
```

* Update test/fiddle/test_c_struct_builder.rb

Co-authored-by: Sutou Kouhei &lt;kou@cozmixng.org&gt;

https://github.com/ruby/fiddle/commit/4e3b60c5b6

Co-authored-by: Sutou Kouhei &lt;kou@cozmixng.org&gt;</pre>
</div>
</content>
</entry>
</feed>
