ffi 1.0.7 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of ffi might be problematic. Click here for more details.

Files changed (37) hide show
  1. data/Rakefile +3 -3
  2. data/ext/ffi_c/AbstractMemory.c +40 -3
  3. data/ext/ffi_c/AbstractMemory.h +2 -2
  4. data/ext/ffi_c/Buffer.c +28 -0
  5. data/ext/ffi_c/DynamicLibrary.c +17 -6
  6. data/ext/ffi_c/Function.c +20 -10
  7. data/ext/ffi_c/MemoryPointer.c +17 -27
  8. data/ext/ffi_c/Platform.c +17 -7
  9. data/ext/ffi_c/Pointer.c +103 -12
  10. data/ext/ffi_c/Pointer.h +9 -0
  11. data/ext/ffi_c/Struct.c +43 -1
  12. data/ext/ffi_c/StructLayout.c +2 -1
  13. data/lib/ffi/enum.rb +1 -3
  14. data/lib/ffi/platform.rb +1 -1
  15. data/lib/ffi/platform/i386-darwin/types.conf +100 -0
  16. data/lib/ffi/platform/i386-linux/types.conf +100 -0
  17. data/lib/ffi/platform/i386-openbsd/types.conf +126 -0
  18. data/lib/ffi/platform/i386-solaris/types.conf +122 -0
  19. data/lib/ffi/platform/i386-windows/types.conf +105 -0
  20. data/lib/ffi/platform/powerpc-aix/types.conf +180 -0
  21. data/lib/ffi/platform/powerpc-darwin/types.conf +100 -0
  22. data/lib/ffi/platform/sparc-solaris/types.conf +128 -0
  23. data/lib/ffi/platform/sparcv9-solaris/types.conf +128 -0
  24. data/lib/ffi/platform/x86_64-darwin/types.conf +100 -0
  25. data/lib/ffi/platform/x86_64-linux/types.conf +100 -0
  26. data/lib/ffi/platform/x86_64-openbsd/types.conf +126 -0
  27. data/lib/ffi/platform/x86_64-solaris/types.conf +122 -0
  28. data/lib/ffi/struct.rb +1 -1
  29. data/lib/ffi/tools/generator.rb +1 -1
  30. data/lib/ffi/types.rb +2 -1
  31. data/spec/ffi/dup_spec.rb +65 -0
  32. data/spec/ffi/enum_spec.rb +28 -0
  33. data/spec/ffi/strptr_spec.rb +11 -2
  34. data/spec/ffi/struct_spec.rb +2 -2
  35. data/tasks/extension.rake +1 -1
  36. metadata +33 -24
  37. data/lib/ffi_c.bundle +0 -0
@@ -27,16 +27,12 @@
27
27
  #include "AbstractMemory.h"
28
28
  #include "Pointer.h"
29
29
 
30
- typedef struct Pointer {
31
- AbstractMemory memory;
32
- VALUE parent;
33
- } Pointer;
34
-
35
30
  #define POINTER(obj) rbffi_AbstractMemory_Cast((obj), rbffi_PointerClass)
36
31
 
37
32
  VALUE rbffi_PointerClass = Qnil;
38
33
  VALUE rbffi_NullPointerSingleton = Qnil;
39
34
 
35
+ static void ptr_release(Pointer* ptr);
40
36
  static void ptr_mark(Pointer* ptr);
41
37
 
42
38
  VALUE
@@ -54,7 +50,7 @@ rbffi_Pointer_NewInstance(void* addr)
54
50
  p->memory.size = LONG_MAX;
55
51
  p->memory.flags = (addr == NULL) ? 0 : (MEM_RD | MEM_WR);
56
52
  p->memory.typeSize = 1;
57
- p->parent = Qnil;
53
+ p->rbParent = Qnil;
58
54
 
59
55
  return obj;
60
56
  }
@@ -65,8 +61,8 @@ ptr_allocate(VALUE klass)
65
61
  Pointer* p;
66
62
  VALUE obj;
67
63
 
68
- obj = Data_Make_Struct(klass, Pointer, ptr_mark, -1, p);
69
- p->parent = Qnil;
64
+ obj = Data_Make_Struct(klass, Pointer, ptr_mark, ptr_release, p);
65
+ p->rbParent = Qnil;
70
66
  p->memory.flags = MEM_RD | MEM_WR;
71
67
 
72
68
  return obj;
@@ -107,7 +103,7 @@ ptr_initialize(int argc, VALUE* argv, VALUE self)
107
103
  if (rb_obj_is_kind_of(rbAddress, rbffi_PointerClass)) {
108
104
  Pointer* orig;
109
105
 
110
- p->parent = rbAddress;
106
+ p->rbParent = rbAddress;
111
107
  Data_Get_Struct(rbAddress, Pointer, orig);
112
108
  p->memory = orig->memory;
113
109
  } else {
@@ -121,6 +117,46 @@ ptr_initialize(int argc, VALUE* argv, VALUE self)
121
117
  return self;
122
118
  }
123
119
 
120
+ static VALUE
121
+ ptr_initialize_copy(VALUE self, VALUE other)
122
+ {
123
+ AbstractMemory* src;
124
+ Pointer* dst;
125
+
126
+ Data_Get_Struct(self, Pointer, dst);
127
+ src = POINTER(other);
128
+ if (src->size == LONG_MAX) {
129
+ rb_raise(rb_eRuntimeError, "cannot duplicate unbounded memory area");
130
+ return Qnil;
131
+ }
132
+
133
+ if ((dst->memory.flags & (MEM_RD | MEM_WR)) != (MEM_RD | MEM_WR)) {
134
+ rb_raise(rb_eRuntimeError, "cannot duplicate unreadable/unwritable memory area");
135
+ return Qnil;
136
+ }
137
+
138
+ if (dst->storage != NULL) {
139
+ xfree(dst->storage);
140
+ dst->storage = NULL;
141
+ }
142
+
143
+ dst->storage = xmalloc(src->size + 7);
144
+ if (dst->storage == NULL) {
145
+ rb_raise(rb_eNoMemError, "failed to allocate memory size=%lu bytes", src->size);
146
+ return Qnil;
147
+ }
148
+
149
+ dst->allocated = true;
150
+ dst->autorelease = true;
151
+ dst->memory.address = (void *) (((uintptr_t) dst->storage + 0x7) & (uintptr_t) ~0x7UL);
152
+ dst->memory.size = src->size;
153
+ dst->memory.typeSize = src->typeSize;
154
+
155
+ // finally, copy the actual memory contents
156
+ memcpy(dst->memory.address, src->address, src->size);
157
+
158
+ return self;
159
+ }
124
160
 
125
161
  static VALUE
126
162
  slice(VALUE self, long offset, long size)
@@ -130,7 +166,7 @@ slice(VALUE self, long offset, long size)
130
166
  VALUE retval;
131
167
 
132
168
  Data_Get_Struct(self, AbstractMemory, ptr);
133
- checkBounds(ptr, offset, 1);
169
+ checkBounds(ptr, offset, size == LONG_MAX ? 1 : size);
134
170
 
135
171
  retval = Data_Make_Struct(rbffi_PointerClass, Pointer, ptr_mark, -1, p);
136
172
 
@@ -138,7 +174,7 @@ slice(VALUE self, long offset, long size)
138
174
  p->memory.size = size;
139
175
  p->memory.flags = ptr->flags;
140
176
  p->memory.typeSize = ptr->typeSize;
141
- p->parent = self;
177
+ p->rbParent = self;
142
178
 
143
179
  return retval;
144
180
  }
@@ -252,10 +288,61 @@ ptr_order(int argc, VALUE* argv, VALUE self)
252
288
  }
253
289
  }
254
290
 
291
+
292
+ static VALUE
293
+ ptr_free(VALUE self)
294
+ {
295
+ Pointer* ptr;
296
+
297
+ Data_Get_Struct(self, Pointer, ptr);
298
+
299
+ if (ptr->allocated) {
300
+ if (ptr->storage != NULL) {
301
+ xfree(ptr->storage);
302
+ ptr->storage = NULL;
303
+ }
304
+ ptr->allocated = false;
305
+ }
306
+
307
+ return self;
308
+ }
309
+
310
+ static VALUE
311
+ ptr_autorelease(VALUE self, VALUE autorelease)
312
+ {
313
+ Pointer* ptr;
314
+
315
+ Data_Get_Struct(self, Pointer, ptr);
316
+ ptr->autorelease = autorelease == Qtrue;
317
+
318
+ return autorelease;
319
+ }
320
+
321
+ static VALUE
322
+ ptr_autorelease_p(VALUE self)
323
+ {
324
+ Pointer* ptr;
325
+
326
+ Data_Get_Struct(self, Pointer, ptr);
327
+
328
+ return ptr->autorelease ? Qtrue : Qfalse;
329
+ }
330
+
331
+
332
+ static void
333
+ ptr_release(Pointer* ptr)
334
+ {
335
+ if (ptr->autorelease && ptr->allocated && ptr->storage != NULL) {
336
+ xfree(ptr->storage);
337
+ ptr->storage = NULL;
338
+ }
339
+ xfree(ptr);
340
+ }
341
+
255
342
  static void
256
343
  ptr_mark(Pointer* ptr)
257
344
  {
258
- rb_gc_mark(ptr->parent);
345
+ rb_gc_mark(ptr->rbParent);
259
346
  }
260
347
 
261
348
  void
@@ -268,6 +355,7 @@ rbffi_Pointer_Init(VALUE moduleFFI)
268
355
 
269
356
  rb_define_alloc_func(rbffi_PointerClass, ptr_allocate);
270
357
  rb_define_method(rbffi_PointerClass, "initialize", ptr_initialize, -1);
358
+ rb_define_method(rbffi_PointerClass, "initialize_copy", ptr_initialize_copy, 1);
271
359
  rb_define_method(rbffi_PointerClass, "inspect", ptr_inspect, 0);
272
360
  rb_define_method(rbffi_PointerClass, "to_s", ptr_inspect, 0);
273
361
  rb_define_method(rbffi_PointerClass, "+", ptr_plus, 1);
@@ -277,6 +365,9 @@ rbffi_Pointer_Init(VALUE moduleFFI)
277
365
  rb_define_alias(rbffi_PointerClass, "to_i", "address");
278
366
  rb_define_method(rbffi_PointerClass, "==", ptr_equals, 1);
279
367
  rb_define_method(rbffi_PointerClass, "order", ptr_order, -1);
368
+ rb_define_method(rbffi_PointerClass, "autorelease=", ptr_autorelease, 1);
369
+ rb_define_method(rbffi_PointerClass, "autorelease?", ptr_autorelease_p, 0);
370
+ rb_define_method(rbffi_PointerClass, "free", ptr_free, 0);
280
371
 
281
372
  rbffi_NullPointerSingleton = rb_class_new_instance(1, &rbNullAddress, rbffi_PointerClass);
282
373
  rb_define_const(rbffi_PointerClass, "NULL", rbffi_NullPointerSingleton);
@@ -21,6 +21,8 @@
21
21
  #ifndef RBFFI_POINTER_H
22
22
  #define RBFFI_POINTER_H
23
23
 
24
+ #include <stdbool.h>
25
+
24
26
  #ifdef __cplusplus
25
27
  extern "C" {
26
28
  #endif
@@ -32,6 +34,13 @@ extern VALUE rbffi_Pointer_NewInstance(void* addr);
32
34
  extern VALUE rbffi_PointerClass;
33
35
  extern VALUE rbffi_NullPointerSingleton;
34
36
 
37
+ typedef struct Pointer {
38
+ AbstractMemory memory;
39
+ VALUE rbParent;
40
+ char* storage; /* start of malloc area */
41
+ bool autorelease;
42
+ bool allocated;
43
+ } Pointer;
35
44
 
36
45
  #ifdef __cplusplus
37
46
  }
@@ -118,6 +118,47 @@ struct_initialize(int argc, VALUE* argv, VALUE self)
118
118
  return self;
119
119
  }
120
120
 
121
+ static VALUE
122
+ struct_initialize_copy(VALUE self, VALUE other)
123
+ {
124
+ Struct* src;
125
+ Struct* dst;
126
+ VALUE memargs[3];
127
+
128
+ Data_Get_Struct(self, Struct, dst);
129
+ Data_Get_Struct(other, Struct, src);
130
+ if (dst == src) {
131
+ return self;
132
+ }
133
+
134
+ dst->rbLayout = src->rbLayout;
135
+ dst->layout = src->layout;
136
+
137
+ //
138
+ // A new MemoryPointer instance is allocated here instead of just calling
139
+ // #dup on rbPointer, since the Pointer may not know its length, or may
140
+ // be longer than just this struct.
141
+ //
142
+ if (src->pointer->address != NULL) {
143
+ memargs[0] = INT2FIX(1);
144
+ memargs[1] = INT2FIX(src->layout->size);
145
+ memargs[2] = Qfalse;
146
+ dst->rbPointer = rb_class_new_instance(2, memargs, rbffi_MemoryPointerClass);
147
+ dst->pointer = MEMORY(dst->rbPointer);
148
+ memcpy(dst->pointer->address, src->pointer->address, src->layout->size);
149
+ } else {
150
+ dst->rbPointer = src->rbPointer;
151
+ dst->pointer = src->pointer;
152
+ }
153
+
154
+ if (src->layout->referenceFieldCount > 0) {
155
+ dst->rbReferences = ALLOC_N(VALUE, dst->layout->referenceFieldCount);
156
+ memcpy(dst->rbReferences, src->rbReferences, dst->layout->referenceFieldCount * sizeof(VALUE));
157
+ }
158
+
159
+ return self;
160
+ }
161
+
121
162
  static VALUE
122
163
  struct_class_layout(VALUE klass)
123
164
  {
@@ -444,7 +485,7 @@ inline_array_size(VALUE self)
444
485
 
445
486
  Data_Get_Struct(self, InlineArray, array);
446
487
 
447
- return UINT2NUM(array->field->type->ffiType->size);
488
+ return UINT2NUM(((ArrayType *) array->field->type)->length);
448
489
  }
449
490
 
450
491
  static int
@@ -617,6 +658,7 @@ rbffi_Struct_Init(VALUE moduleFFI)
617
658
 
618
659
  rb_define_alloc_func(StructClass, struct_allocate);
619
660
  rb_define_method(StructClass, "initialize", struct_initialize, -1);
661
+ rb_define_method(StructClass, "initialize_copy", struct_initialize_copy, 1);
620
662
  rb_define_method(StructClass, "order", struct_order, -1);
621
663
 
622
664
  rb_define_alias(rb_singleton_class(StructClass), "alloc_in", "new");
@@ -374,7 +374,8 @@ struct_layout_initialize(VALUE self, VALUE fields, VALUE size, VALUE align)
374
374
  }
375
375
  rbName = rb_funcall2(rbField, rb_intern("name"), 0, NULL);
376
376
 
377
- Data_Get_Struct(rbField, StructField, field = layout->fields[i]);
377
+ field = layout->fields[i];
378
+ Data_Get_Struct(rbField, StructField, field);
378
379
 
379
380
  if (field->type == NULL || field->type->ffiType == NULL) {
380
381
  rb_raise(rb_eRuntimeError, "type of field %d not supported", i);
@@ -57,7 +57,6 @@ module FFI
57
57
  def initialize(info, tag=nil)
58
58
  @tag = tag
59
59
  @kv_map = Hash.new
60
- @vk_map = Hash.new
61
60
  unless info.nil?
62
61
  last_cst = nil
63
62
  value = 0
@@ -65,16 +64,15 @@ module FFI
65
64
  case i
66
65
  when Symbol
67
66
  @kv_map[i] = value
68
- @vk_map[value] = i
69
67
  last_cst = i
70
68
  value += 1
71
69
  when Integer
72
70
  @kv_map[last_cst] = i
73
- @vk_map[i] = last_cst
74
71
  value = i+1
75
72
  end
76
73
  end
77
74
  end
75
+ @vk_map = Hash[@kv_map.map{|k,v| [v,k]}]
78
76
  end
79
77
 
80
78
  def symbols
@@ -64,7 +64,7 @@ module FFI
64
64
  IS_OPENBSD = is_os("openbsd")
65
65
  IS_WINDOWS = is_os("windows")
66
66
  IS_BSD = IS_MAC || IS_FREEBSD || IS_OPENBSD
67
- CONF_DIR = File.dirname(__FILE__)
67
+ CONF_DIR = File.join(File.dirname(__FILE__), 'platform', ARCH.to_s + "-" + OS.to_s)
68
68
  public
69
69
 
70
70
 
@@ -0,0 +1,100 @@
1
+ rbx.platform.typedef.__int8_t = char
2
+ rbx.platform.typedef.__uint8_t = uchar
3
+ rbx.platform.typedef.__int16_t = short
4
+ rbx.platform.typedef.__uint16_t = ushort
5
+ rbx.platform.typedef.__int32_t = int
6
+ rbx.platform.typedef.__uint32_t = uint
7
+ rbx.platform.typedef.__int64_t = long_long
8
+ rbx.platform.typedef.__uint64_t = ulong_long
9
+ rbx.platform.typedef.__darwin_intptr_t = long
10
+ rbx.platform.typedef.__darwin_natural_t = uint
11
+ rbx.platform.typedef.__darwin_ct_rune_t = int
12
+ rbx.platform.typedef.__darwin_ptrdiff_t = int
13
+ rbx.platform.typedef.__darwin_size_t = ulong
14
+ rbx.platform.typedef.__darwin_wchar_t = int
15
+ rbx.platform.typedef.__darwin_rune_t = int
16
+ rbx.platform.typedef.__darwin_wint_t = int
17
+ rbx.platform.typedef.__darwin_clock_t = ulong
18
+ rbx.platform.typedef.__darwin_socklen_t = uint
19
+ rbx.platform.typedef.__darwin_ssize_t = long
20
+ rbx.platform.typedef.__darwin_time_t = long
21
+ rbx.platform.typedef.int8_t = char
22
+ rbx.platform.typedef.u_int8_t = uchar
23
+ rbx.platform.typedef.int16_t = short
24
+ rbx.platform.typedef.u_int16_t = ushort
25
+ rbx.platform.typedef.int32_t = int
26
+ rbx.platform.typedef.u_int32_t = uint
27
+ rbx.platform.typedef.int64_t = long_long
28
+ rbx.platform.typedef.u_int64_t = ulong_long
29
+ rbx.platform.typedef.register_t = int
30
+ rbx.platform.typedef.intptr_t = long
31
+ rbx.platform.typedef.uintptr_t = ulong
32
+ rbx.platform.typedef.user_addr_t = ulong_long
33
+ rbx.platform.typedef.user_size_t = ulong_long
34
+ rbx.platform.typedef.user_ssize_t = long_long
35
+ rbx.platform.typedef.user_long_t = long_long
36
+ rbx.platform.typedef.user_ulong_t = ulong_long
37
+ rbx.platform.typedef.user_time_t = long_long
38
+ rbx.platform.typedef.syscall_arg_t = ulong_long
39
+ rbx.platform.typedef.__darwin_blkcnt_t = long_long
40
+ rbx.platform.typedef.__darwin_blksize_t = int
41
+ rbx.platform.typedef.__darwin_dev_t = int
42
+ rbx.platform.typedef.__darwin_fsblkcnt_t = uint
43
+ rbx.platform.typedef.__darwin_fsfilcnt_t = uint
44
+ rbx.platform.typedef.__darwin_gid_t = uint
45
+ rbx.platform.typedef.__darwin_id_t = uint
46
+ rbx.platform.typedef.__darwin_ino64_t = ulong_long
47
+ rbx.platform.typedef.__darwin_ino_t = ulong_long
48
+ rbx.platform.typedef.__darwin_mach_port_name_t = uint
49
+ rbx.platform.typedef.__darwin_mach_port_t = uint
50
+ rbx.platform.typedef.__darwin_mode_t = ushort
51
+ rbx.platform.typedef.__darwin_off_t = long_long
52
+ rbx.platform.typedef.__darwin_pid_t = int
53
+ rbx.platform.typedef.__darwin_pthread_key_t = ulong
54
+ rbx.platform.typedef.__darwin_sigset_t = uint
55
+ rbx.platform.typedef.__darwin_suseconds_t = int
56
+ rbx.platform.typedef.__darwin_uid_t = uint
57
+ rbx.platform.typedef.__darwin_useconds_t = uint
58
+ rbx.platform.typedef.__darwin_uuid_t[16] = uchar
59
+ rbx.platform.typedef.u_char = uchar
60
+ rbx.platform.typedef.u_short = ushort
61
+ rbx.platform.typedef.u_int = uint
62
+ rbx.platform.typedef.u_long = ulong
63
+ rbx.platform.typedef.ushort = ushort
64
+ rbx.platform.typedef.uint = uint
65
+ rbx.platform.typedef.u_quad_t = ulong_long
66
+ rbx.platform.typedef.quad_t = long_long
67
+ rbx.platform.typedef.qaddr_t = pointer
68
+ rbx.platform.typedef.caddr_t = string
69
+ rbx.platform.typedef.daddr_t = int
70
+ rbx.platform.typedef.dev_t = int
71
+ rbx.platform.typedef.fixpt_t = uint
72
+ rbx.platform.typedef.blkcnt_t = long_long
73
+ rbx.platform.typedef.blksize_t = int
74
+ rbx.platform.typedef.gid_t = uint
75
+ rbx.platform.typedef.in_addr_t = uint
76
+ rbx.platform.typedef.in_port_t = ushort
77
+ rbx.platform.typedef.ino_t = ulong_long
78
+ rbx.platform.typedef.ino64_t = ulong_long
79
+ rbx.platform.typedef.key_t = int
80
+ rbx.platform.typedef.mode_t = ushort
81
+ rbx.platform.typedef.nlink_t = ushort
82
+ rbx.platform.typedef.id_t = uint
83
+ rbx.platform.typedef.pid_t = int
84
+ rbx.platform.typedef.off_t = long_long
85
+ rbx.platform.typedef.segsz_t = int
86
+ rbx.platform.typedef.swblk_t = int
87
+ rbx.platform.typedef.uid_t = uint
88
+ rbx.platform.typedef.clock_t = ulong
89
+ rbx.platform.typedef.size_t = ulong
90
+ rbx.platform.typedef.ssize_t = long
91
+ rbx.platform.typedef.time_t = long
92
+ rbx.platform.typedef.useconds_t = uint
93
+ rbx.platform.typedef.suseconds_t = int
94
+ rbx.platform.typedef.fd_mask = int
95
+ rbx.platform.typedef.pthread_key_t = ulong
96
+ rbx.platform.typedef.fsblkcnt_t = uint
97
+ rbx.platform.typedef.fsfilcnt_t = uint
98
+ rbx.platform.typedef.sa_family_t = uchar
99
+ rbx.platform.typedef.socklen_t = uint
100
+ rbx.platform.typedef.rlim_t = ulong_long
@@ -0,0 +1,100 @@
1
+ rbx.platform.typedef.__u_char = uchar
2
+ rbx.platform.typedef.__u_short = ushort
3
+ rbx.platform.typedef.__u_int = uint
4
+ rbx.platform.typedef.__u_long = ulong
5
+ rbx.platform.typedef.__int8_t = char
6
+ rbx.platform.typedef.__uint8_t = uchar
7
+ rbx.platform.typedef.__int16_t = short
8
+ rbx.platform.typedef.__uint16_t = ushort
9
+ rbx.platform.typedef.__int32_t = int
10
+ rbx.platform.typedef.__uint32_t = uint
11
+ rbx.platform.typedef.__int64_t = long_long
12
+ rbx.platform.typedef.__uint64_t = ulong_long
13
+ rbx.platform.typedef.__quad_t = long_long
14
+ rbx.platform.typedef.__u_quad_t = ulong_long
15
+ rbx.platform.typedef.__dev_t = ulong_long
16
+ rbx.platform.typedef.__uid_t = uint
17
+ rbx.platform.typedef.__gid_t = uint
18
+ rbx.platform.typedef.__ino_t = ulong
19
+ rbx.platform.typedef.__ino64_t = ulong_long
20
+ rbx.platform.typedef.__mode_t = uint
21
+ rbx.platform.typedef.__nlink_t = uint
22
+ rbx.platform.typedef.__off_t = long
23
+ rbx.platform.typedef.__off64_t = long_long
24
+ rbx.platform.typedef.__pid_t = int
25
+ rbx.platform.typedef.__clock_t = long
26
+ rbx.platform.typedef.__rlim_t = ulong
27
+ rbx.platform.typedef.__rlim64_t = ulong_long
28
+ rbx.platform.typedef.__id_t = uint
29
+ rbx.platform.typedef.__time_t = long
30
+ rbx.platform.typedef.__useconds_t = uint
31
+ rbx.platform.typedef.__suseconds_t = long
32
+ rbx.platform.typedef.__daddr_t = int
33
+ rbx.platform.typedef.__swblk_t = long
34
+ rbx.platform.typedef.__key_t = int
35
+ rbx.platform.typedef.__clockid_t = int
36
+ rbx.platform.typedef.__timer_t = pointer
37
+ rbx.platform.typedef.__blksize_t = long
38
+ rbx.platform.typedef.__blkcnt_t = long
39
+ rbx.platform.typedef.__blkcnt64_t = long_long
40
+ rbx.platform.typedef.__fsblkcnt_t = ulong
41
+ rbx.platform.typedef.__fsblkcnt64_t = ulong_long
42
+ rbx.platform.typedef.__fsfilcnt_t = ulong
43
+ rbx.platform.typedef.__fsfilcnt64_t = ulong_long
44
+ rbx.platform.typedef.__ssize_t = int
45
+ rbx.platform.typedef.__loff_t = long_long
46
+ rbx.platform.typedef.*__qaddr_t = long_long
47
+ rbx.platform.typedef.*__caddr_t = char
48
+ rbx.platform.typedef.__intptr_t = int
49
+ rbx.platform.typedef.__socklen_t = uint
50
+ rbx.platform.typedef.u_char = uchar
51
+ rbx.platform.typedef.u_short = ushort
52
+ rbx.platform.typedef.u_int = uint
53
+ rbx.platform.typedef.u_long = ulong
54
+ rbx.platform.typedef.quad_t = long_long
55
+ rbx.platform.typedef.u_quad_t = ulong_long
56
+ rbx.platform.typedef.loff_t = long_long
57
+ rbx.platform.typedef.ino_t = ulong_long
58
+ rbx.platform.typedef.dev_t = ulong_long
59
+ rbx.platform.typedef.gid_t = uint
60
+ rbx.platform.typedef.mode_t = uint
61
+ rbx.platform.typedef.nlink_t = uint
62
+ rbx.platform.typedef.uid_t = uint
63
+ rbx.platform.typedef.off_t = long_long
64
+ rbx.platform.typedef.pid_t = int
65
+ rbx.platform.typedef.id_t = uint
66
+ rbx.platform.typedef.ssize_t = int
67
+ rbx.platform.typedef.daddr_t = int
68
+ rbx.platform.typedef.key_t = int
69
+ rbx.platform.typedef.time_t = long
70
+ rbx.platform.typedef.clockid_t = int
71
+ rbx.platform.typedef.timer_t = pointer
72
+ rbx.platform.typedef.size_t = uint
73
+ rbx.platform.typedef.ulong = ulong
74
+ rbx.platform.typedef.ushort = ushort
75
+ rbx.platform.typedef.uint = uint
76
+ rbx.platform.typedef.int8_t = char
77
+ rbx.platform.typedef.int16_t = short
78
+ rbx.platform.typedef.int32_t = int
79
+ rbx.platform.typedef.int64_t = long_long
80
+ rbx.platform.typedef.u_int8_t = uchar
81
+ rbx.platform.typedef.u_int16_t = ushort
82
+ rbx.platform.typedef.u_int32_t = uint
83
+ rbx.platform.typedef.u_int64_t = ulong_long
84
+ rbx.platform.typedef.register_t = long
85
+ rbx.platform.typedef.__sig_atomic_t = int
86
+ rbx.platform.typedef.suseconds_t = long
87
+ rbx.platform.typedef.__fd_mask = long
88
+ rbx.platform.typedef.fd_mask = long
89
+ rbx.platform.typedef.blkcnt_t = long_long
90
+ rbx.platform.typedef.fsblkcnt_t = ulong_long
91
+ rbx.platform.typedef.fsfilcnt_t = ulong_long
92
+ rbx.platform.typedef.pthread_t = ulong
93
+ rbx.platform.typedef.pthread_key_t = uint
94
+ rbx.platform.typedef.pthread_once_t = int
95
+ rbx.platform.typedef.socklen_t = uint
96
+ rbx.platform.typedef.sa_family_t = ushort
97
+ rbx.platform.typedef.rlim_t = ulong_long
98
+ rbx.platform.typedef.__rlimit_resource_t = int
99
+ rbx.platform.typedef.__rusage_who_t = int
100
+ rbx.platform.typedef.__priority_which_t = int