2
* Copyright (c) 2004, 2005 TADA AB - Taby Sweden
2
* Copyright (c) 2004, 2005, 2006 TADA AB - Taby Sweden
3
3
* Distributed under the terms shown in the file COPYRIGHT
4
4
* found in the root folder of this project or at
5
5
* http://eng.tada.se/osprojects/COPYRIGHT.html
16
16
* void primitive type.
18
static TypeClass s_voidClass;
21
static Datum _void_invoke(Type self, JNIEnv* env, jclass cls, jmethodID method, jvalue* args, PG_FUNCTION_ARGS)
18
static Datum _void_invoke(Type self, jclass cls, jmethodID method, jvalue* args, PG_FUNCTION_ARGS)
23
bool saveicj = isCallingJava;
25
(*env)->CallStaticVoidMethodA(env, cls, method, args);
26
isCallingJava = saveicj;
20
JNI_callStaticVoidMethodA(cls, method, args);
27
21
fcinfo->isnull = true;
31
static jvalue _void_coerceDatum(Type self, JNIEnv* env, Datum nothing)
25
static jvalue _void_coerceDatum(Type self, Datum nothing)
38
static Datum _void_coerceObject(Type self, JNIEnv* env, jobject nothing)
32
static Datum _void_coerceObject(Type self, jobject nothing)
43
static Type void_obtain(Oid typeId)
48
37
/* Make this datatype available to the postgres system.
50
extern Datum Void_initialize(PG_FUNCTION_ARGS);
51
PG_FUNCTION_INFO_V1(Void_initialize);
52
Datum Void_initialize(PG_FUNCTION_ARGS)
39
extern void Void_initialize(void);
40
void Void_initialize(void)
54
s_voidClass = TypeClass_alloc("type.void");
55
s_voidClass->JNISignature = "V";
56
s_voidClass->javaTypeName = "void";
57
s_voidClass->invoke = _void_invoke;
58
s_voidClass->coerceDatum = _void_coerceDatum;
59
s_voidClass->coerceObject = _void_coerceObject;
60
s_void = TypeClass_allocInstance(s_voidClass, VOIDOID);
62
Type_registerPgType(VOIDOID, void_obtain);
63
Type_registerJavaType("void", void_obtain);
42
TypeClass cls = TypeClass_alloc("type.void");
43
cls->JNISignature = "V";
44
cls->javaTypeName = "void";
45
cls->invoke = _void_invoke;
46
cls->coerceDatum = _void_coerceDatum;
47
cls->coerceObject = _void_coerceObject;
48
Type_registerType("void", TypeClass_allocInstance(cls, VOIDOID));