Module: AutoC::STD

Included in:
Allocator, CString, Composite, Hasher, Vector
Defined in:
lib/autoc/std.rb

Overview

A collection of standard (mostly) primitive C types

Defined Under Namespace

Modules: Coercions, PrimitiveCoercions Classes: Complex, Primitive

Constant Summary collapse

MATH_H =
AutoC::SystemHeader.new 'math.h'
ASSERT_H =
AutoC::SystemHeader.new 'assert.h'
STDDEF_H =
AutoC::SystemHeader.new 'stddef.h'
MALLOC_H =
AutoC::SystemHeader.new 'malloc.h'
STRING_H =
AutoC::SystemHeader.new 'string.h'
STDBOOL_H =
AutoC::SystemHeader.new 'stdbool.h'
COMPLEX_H =
AutoC::SystemHeader.new 'complex.h'
INTTYPES_H =
AutoC::SystemHeader.new 'inttypes.h'
STDLIB_H =

STDLIB_H = AutoC::SystemHeader.new ‘stdlib.h’ Required by Visual Studio’s rand_s() to work

AutoC::Code.new interface: %{
  #ifdef _MSC_VER
    #define _CRT_RAND_S
  #endif
  #include <stdlib.h>
}
BOOL =
Primitive.new '_Bool', matcher: /^(bool|_Bool)$/, header: STDBOOL_H
CHAR =
Primitive.new 'char'
SIGNED_CHAR =
Primitive.new 'signed char', matcher: /^signed\s+char$/
UNSIGNED_CHAR =
Primitive.new 'unsigned char', matcher: /^unsigned\s+char$/
WCHAR_T =
Primitive.new 'wchar_t', header: STDDEF_H
SHORT =
SIGNED_SHORT = SHORT_INT = SIGNED_SHORT_INT = Primitive.new 'short', matcher: /^(signed\s+)?short(\s+int)?$/
UNSIGNED_SHORT =
UNSIGNED_SHORT_INT = Primitive.new 'unsigned short', matcher: /^unsigned\s+short(\s+int)?$/
INT =
SIGNED = SIGNED_INT = Primitive.new 'int', matcher: /^(int|signed|signed\s+int)$/
UNSIGNED =
UNSIGNED_INT = Primitive.new 'unsigned', matcher: /^(unsigned|unsigned\s+int)$/
LONG =
SIGNED_LONG = LONG_INT = SIGNED_LONG_INT = Primitive.new 'long', matcher: /^(signed\s+)?long(\s+int)?$/
UNSIGNED_LONG =
UNSIGNED_LONG_INT = Primitive.new 'unsigned long', matcher: /^unsigned\s+long(\s+int)?$/
LONG_LONG =
SIGNED_LONG_LONG = LONG_LONG_INT = SIGNED_LONG_LONG_INT = Primitive.new 'long long', matcher: /^(signed\s+)?long\s+long(\s+int)?$/
UNSIGNED_LONG_LONG =
UNSIGNED_LONG_LONG_INT = Primitive.new 'unsigned long long', matcher: /^unsigned\s+long\s+long(\s+int)?$/
SIZE_T =
Primitive.new 'size_t', header: STDDEF_H
PTRDIFF_T =
Primitive.new 'ptrdiff_t', header: STDDEF_H
UINTPTR_T =
Primitive.new 'uintptr_t', header: STDDEF_H
FLOAT =
Primitive.new 'float'
DOUBLE =
Primitive.new 'double'
LONG_DOUBLE =
Primitive.new 'long double', matcher: /^long\s+double$/
FLOAT_T =
Primitive.new 'float_t', header: MATH_H
DOUBLE_T =
Primitive.new 'double_t', header: MATH_H
COMPLEX =

Complex

Complex.new '_Complex', matcher: /^(complex|_Complex)$/, header: COMPLEX_H
FLOAT_COMPLEX =
Complex.new 'float _Complex', matcher: /^float\s+(complex|_Complex)$/, header: COMPLEX_H
DOUBLE_COMPLEX =
Complex.new 'double _Complex', matcher: /^double\s+(complex|_Complex)$/, header: COMPLEX_H
LONG_DOUBLE_COMPLEX =
Complex.new 'long double _Complex', matcher: /^long\s+double\s+(complex|_Complex)$/, header: COMPLEX_H
INTPTR_T =
Primitive.new 'intptr_t', header: INTTYPES_H
INTMAX_T =
Primitive.new 'intmax_t', header: INTTYPES_H
UINTMAX_T =
Primitive.new 'uintmax_t', header: INTTYPES_H