| Interface | Description |
|---|---|
| ASTLocusTag.ASTLocusTagProvider |
Interface tag for
ASTLocusTag provider. |
| CodeGenUtils.EmissionCallback |
A class that emits source code of some time when activated.
|
| CommentEmitter | |
| GenericCPP |
Generic C preprocessor interface for GlueGen
|
| GlueEmitter |
Specifies the interface by which GlueGen requests glue code to be
generated.
|
| GlueEmitterControls |
Specifies the interface by which a GlueEmitter can request
additional information from the glue generator.
|
| Logging.LoggerIf |
An interface for
Logger. |
| SymbolFilter |
Provides a mechanism by which the GlueEmitter can look at all of
the #defines, enum values and function symbols and perform certain
filtering and processing which requires all of them to be visible
simultaneously.
|
| Class | Description |
|---|---|
| ArrayTypes |
Convenience class containing the Class objects corresponding to arrays of
various types (e.g.,
ArrayTypes.booleanArrayClass is the Class of Java type
"boolean[]"). |
| ASTLocusTag |
An AST location tag.
|
| CMethodBindingEmitter |
Emits the C-side component of the Java<->C JNI binding.
|
| CMethodBindingEmitter.DefaultCommentEmitter |
Class that emits a generic comment for CMethodBindingEmitters; the comment
includes the C signature of the native method that is being bound by the
emitter java method.
|
| CodeGenUtils | |
| ConstantDefinition |
Represents a [native] constant expression,
comprises the [native] expression, see
ConstantDefinition.getNativeExpr()
and the optional ConstantDefinition.CNumber representation, see ConstantDefinition.getNumber(). |
| ConstantDefinition.CNumber |
A Number, either integer, optionally [long, unsigned],
or floating point, optionally [double].
|
| ConstantDefinition.JavaExpr |
A valid java expression, including its result type,
usually generated from a native [C] expression,
see
JavaExpr#create(ConstantDefinition). |
| DebugEmitter |
Debug emitter which prints the parsing results to standard output.
|
| FunctionEmitter | |
| FunctionEmitter.EmissionModifier | |
| GlueGen |
Glue code generator for C functions and data structures.
|
| JavaConfiguration |
Parses and provides access to the contents of .cfg files for the
JavaEmitter.
|
| JavaEmitter | |
| JavaMethodBindingEmitter |
An emitter that emits only the interface for a Java<->C JNI binding.
|
| JavaType |
Describes a java-side representation of a type that is used to represent
the same data on both the Java-side and C-side during a JNI operation.
|
| Logging | |
| MethodBinding |
Represents the binding of a C function to a Java method.
|
| ReferencedStructs | |
| TypeConfig |
Static
Type config helper
binding JavaConfiguration.relaxedEqualSemanticsTest() system wide. |
| TypeInfo |
Utility class for handling Opaque directives for JavaEmitter.
|
| Enum | Description |
|---|---|
| JavaEmitter.EmissionStyle |
Style of code emission.
|
| JavaEmitter.MethodAccess |
Access control for emitted Java methods.
|
| Exception | Description |
|---|---|
| GlueGenException |
A generic exception for Jogamp errors used throughout the binding
as a substitute for
RuntimeException. |
| type | java bits | native bits | type | signed | origin | |
|---|---|---|---|---|---|---|
| x32 | x64 | |||||
| void | 0 | 0 | 0 | void | void | ANSI-C |
| char | 8 | 8 | 8 | integer | any | ANSI-C |
| short | 16 | 16 | 16 | integer | any | ANSI-C |
| int | 32 | 32 | 32 | integer | any | ANSI-C |
| long | 64 | 32 | 321 | integer | any | ANSI-C - Windows |
| long | 64 | 32 | 64 | integer | any | ANSI-C - Unix |
| float | 32 | 32 | 32 | float | signed | ANSI-C |
| double | 64 | 64 | 64 | double | signed | ANSI-C |
| __int32 | 32 | 32 | 32 | integer | any | windows |
| __int64 | 64 | 64 | 64 | integer | any | windows |
| int8_t | 8 | 8 | 8 | integer | signed | stdint.h |
| uint8_t | 8 | 8 | 8 | integer | unsigned | stdint.h |
| int16_t | 16 | 16 | 16 | integer | signed | stdint.h |
| uint16_t | 16 | 16 | 16 | integer | unsigned | stdint.h |
| int32_t | 32 | 32 | 32 | integer | signed | stdint.h |
| uint32_t | 32 | 32 | 32 | integer | unsigned | stdint.h |
| int64_t | 64 | 64 | 64 | integer | signed | stdint.h |
| uint64_t | 64 | 64 | 64 | integer | unsigned | stdint.h |
| intptr_t | 64 | 32 | 64 | integer | signed | stdint.h |
| uintptr_t | 64 | 32 | 64 | integer | unsigned | stdint.h |
| ptrdiff_t | 64 | 32 | 64 | integer | signed | stddef.h |
| size_t | 64 | 32 | 64 | integer | unsigned | stddef.h |
| wchar_t | 32 | 32 | 32 | integer | signed | stddef.h |
Warning: Try to avoid unspecified bit sized types, especially long, since it differs on Unix and Windows!
Notes:
Compounds (structures) are aligned naturally, i.e. their inner components are aligned
and are itself aligned to it's largest element.
padding = ( alignment - ( offset % alignment ) ) % alignment ;Optimization utilizing alignment as a multiple of 2
aligned_offset = offset + padding ;
-> x % 2n == x & ( 2n - 1 )remainder = offset & ( alignment - 1 ) ;Without branching, using the 2nd modulo operation for the case offset == alignment:
padding = ( remainder > 0 ) ? alignment - remainder : 0 ;
aligned_offset = offset + padding ;
padding = ( alignment - ( offset & ( alignment - 1 ) ) ) & ( alignment - 1 ) ;See
aligned_offset = offset + padding ;
com.jogamp.gluegen.cgram.types.SizeThunk.align(..).
typedef struct {
char fill; // nibble one byte
// padding to align s1: padding_0
type_t s1; //
} test_struct_type_t;
padding_0 = sizeof(test_struct_type_t) - sizeof(type_t) - sizeof(char) ;
alignmentOf(type_t) = sizeof(test_struct_type_t) - sizeof(type_t) ;
| type | 32 bits | 64 bits | ||
|---|---|---|---|---|
| size | alignment | size | alignment | |
| char | 1 | 1 | 1 | 1 |
| short | 2 | 2 | 2 | 2 |
| int | 4 | 4 | 4 | 4 |
| float | 4 | 4 | 4 | 4 |
| long | 4 | 4 | 8†,4∗ | 8†,4∗ |
| pointer | 4 | 4 | 8 | 8 |
| long long | 8 | 4†,8∗+ | 8 | 8 |
| double | 8 | 4†,8∗+ | 8 | 8 |
| long double | 12†∗,8+,16- | 4†∗,8+,16- | 16 | 16 |
#include <gluegen_stdint.h> #include <gluegen_stddef.h> uint64_t test64; size_t size1; ptrdiff_t ptr1;
-I:
gluegen/make/stub_includes/platform
includeRefid element:
gluegen/make/stub_includes/gluegen
#define __GLUEGEN__ 2