10 #ifndef K_API_API_DEF_H
11 #define K_API_API_DEF_H
18 #define kDlCall kxDlCall
21 # define kFx(TYPE) kExportFx(TYPE)
22 # define kDx(TYPE) kExportDx(TYPE)
24 # define kFx(TYPE) kImportFx(TYPE)
25 # define kDx(TYPE) kImportDx(TYPE)
40 #define k8U_MAX (255U)
41 #define k8U_NULL (k8U_MAX)
53 #define k16U_MAX (65535U)
54 #define k16U_NULL (k16U_MAX)
66 #define k32U_MAX (4294967295U)
67 #define k32U_NULL (k32U_MAX)
78 #define k64U(CONST) kx64U(CONST)
79 #define k64U_MIN k64U(0)
80 #define k64U_MAX k64U(18446744073709551615)
81 #define k64U_NULL (k64U_MAX)
82 #define kINFINITE k64U_MAX
94 #define k8S_MIN (-k8S_MAX -1)
95 #define k8S_NULL (k8S_MIN)
106 #define k16S_MAX (32767)
107 #define k16S_MIN (-k16S_MAX -1)
108 #define k16S_NULL (k16S_MIN)
119 #define k32S_MAX (2147483647)
120 #define k32S_MIN (-k32S_MAX -1)
121 #define k32S_NULL (k32S_MIN)
132 #define k64S(CONST) kx64S(CONST)
133 #define k64S_MAX k64S(9223372036854775807)
134 #define k64S_MIN (-k64S_MAX -1)
135 #define k64S_NULL (k64S_MIN)
146 #define k32F_MIN (1.175494351e-38F)
147 #define k32F_MAX (3.402823466e+38F)
148 #define k32F_NULL (-k32F_MAX)
159 #define k64F_MIN (2.2250738585072014e-308)
160 #define k64F_MAX (1.7976931348623157e+308)
161 #define k64F_NULL (-k64F_MAX)
169 typedef kxByte
kByte;
178 typedef kxSize
kSize;
180 #define kSIZE_MAX kxSIZE_MAX
181 #define kSIZE_NULL kSIZE_MAX
192 #define kSSIZE_MIN kxSSIZE_MIN
193 #define kSSIZE_MAX kxSSIZE_MAX
194 #define kSSIZE_NULL kSSIZE_MIN
213 #define kIsNull(POINTER) kIsNull_(POINTER)
233 typedef kxChar
kChar;
311 #define kERROR_STATE (-1000)
312 #define kERROR_NOT_FOUND (-999)
313 #define kERROR_COMMAND (-998)
314 #define kERROR_PARAMETER (-997)
315 #define kERROR_UNIMPLEMENTED (-996)
316 #define kERROR_MEMORY (-994)
317 #define kERROR_TIMEOUT (-993)
318 #define kERROR_INCOMPLETE (-992)
319 #define kERROR_STREAM (-991)
320 #define kERROR_CLOSED (-990)
321 #define kERROR_VERSION (-989)
322 #define kERROR_ABORT (-988)
323 #define kERROR_ALREADY_EXISTS (-987)
324 #define kERROR_NETWORK (-986)
325 #define kERROR_HEAP (-985)
326 #define kERROR_FORMAT (-984)
327 #define kERROR_READ_ONLY (-983)
328 #define kERROR_WRITE_ONLY (-982)
329 #define kERROR_BUSY (-981)
330 #define kERROR_CONFLICT (-980)
331 #define kERROR_OS (-979)
332 #define kERROR_DEVICE (-978)
333 #define kERROR_FULL (-977)
334 #define kERROR_IN_PROGRESS (-976)
358 #define kIsError(EXPRESSION) kIsError_(EXPRESSION)
369 #define kSuccess(EXPRESSION) kSuccess_(EXPRESSION)
381 #define kCheck(EXPRESSION) kCheck_(EXPRESSION)
393 #define kCheckArgs(EXPRESSION) kCheckArgs_(EXPRESSION)
405 #define kCheckState(EXPRESSION) kCheckState_(EXPRESSION)
422 #define kThrow(EXPRESSION) kThrow_(EXPRESSION)
435 #define kTest(EXPRESSION) kTest_(EXPRESSION)
448 #define kTestArgs(EXPRESSION) kTestArgs_(EXPRESSION)
461 #define kTestState(EXPRESSION) kTestState_(EXPRESSION)
471 #define kCatch(STATUS_POINTER) kCatch_(STATUS_POINTER)
483 #define kEndCatch(STATUS) kEndCatch_(STATUS)
490 #define kFinally kFinally_
500 #define kEndFinally() kEndFinally_()
510 #define kCatchEx(STATUS_POINTER) kCatchEx_(STATUS_POINTER)
524 #define kEndCatchEx(STATUS) kEndCatchEx_(STATUS)
531 #define kFinallyEx kFinallyEx_
541 #define kEndFinallyEx() kEndFinallyEx_()
550 #define kAssert(EXPRESSION) kAssert_(EXPRESSION)
562 #define kAssertType(OBJECT, SYMBOL) kAssertType_(OBJECT, SYMBOL)
573 #define kTrace(TAG) kTrace_(TAG)
593 kFx(kVersion)
kVersion_Create(k32u major, k32u minor, k32u release, k32u build);
603 kFx(kStatus)
kVersion_Parse(kVersion* version, const kChar* buffer);
614 kFx(kStatus)
kVersion_Format(kVersion version, kChar* buffer, kSize capacity);
683 typedef struct kPoint32s
695 typedef struct kPoint32f
707 typedef struct kPoint64f
720 #define kPoint_Init_(POINT, X, Y) kxPoint_Init_(POINT, X, Y)
741 typedef struct kPoint3d32s
782 #define kPoint3d_Init_(POINT, X, Y, Z) kxPoint3d_Init_(POINT, X, Y, Z)
849 #define kRect_Init_(RECT, X, Y, W, H) kxRect_Init_(RECT, X, Y, W, H)
891 #define kRotatedRect_Init_(RECT, XC, YC, W, H, A) kxRotatedRect_Init_(RECT, XC, YC, W, H, A)
907 #define kPIXEL_FORMAT_NULL (0)
908 #define kPIXEL_FORMAT_8BPP_GREYSCALE (1)
909 #define kPIXEL_FORMAT_8BPP_CFA (2)
910 #define kPIXEL_FORMAT_8BPC_BGRX (3)
927 #define kCFA_NONE (0)
928 #define kCFA_BAYER_BGGR (1)
929 #define kCFA_BAYER_GBRG (2)
930 #define kCFA_BAYER_RGGB (3)
931 #define kCFA_BAYER_GRBG (4)
955 #define kRgb_Init_(RGB, R, G, B) kxRgb_Init_(RGB, R, G, B)
980 #define kArgb_Init_(ARGB, A, R, G, B) kxArgb_Init_(ARGB, A, R, G, B)
998 #define kCOMPARISON_EQ (0)
999 #define kCOMPARISON_NEQ (1)
1000 #define kCOMPARISON_LT (2)
1001 #define kCOMPARISON_LTE (3)
1002 #define kCOMPARISON_GT (4)
1003 #define kCOMPARISON_GTE (5)
1057 #define kFILE_MODE_READ (0x1)
1058 #define kFILE_MODE_WRITE (0x2)
1059 #define kFILE_MODE_UPDATE (0x4)
1074 #define kSEEK_ORIGIN_BEGIN (0)
1075 #define kSEEK_ORIGIN_CURRENT (1)
1076 #define kSEEK_ORIGIN_END (2)
1103 #define kTypeOf(SYMBOL) kTypeOf_(SYMBOL)
1130 #define kAssemblyOf(SYMBOL) kAssemblyOf_(SYMBOL)
1140 #define kStaticOf(SYMBOL) kStaticOf_(SYMBOL)
1148 #define kStaticInitialized(SYMBOL) kStaticInitialized_(SYMBOL)
1158 #define kCountOf(CARRAY) kCountOf_(CARRAY)
1171 #define kCast(TYPE, ITEM) kCast_(TYPE, ITEM)
1180 #define kMin_(A, B) kxMin_(A, B)
1189 #define kMax_(A, B) kxMax_(A, B)
1199 #define kClamp_(V, VMIN, VMAX) kxClamp_((V), (VMIN), (VMAX))
1207 #define kAbs_(A) kxAbs_(A)
1214 #define kZero_(VALUE) kxZero_(VALUE)
1223 #define kItemCopy_(DEST, SRC, SIZE) kxItemCopy_(DEST, SRC, SIZE)
1232 #define kItemSet_(DEST, FILL, SIZE) kxItemSet_(DEST, FILL, SIZE)
1240 #define kItemZero_(DEST, SIZE) kItemSet_(DEST, 0, SIZE)
1249 #define kItemAt_(BASE, INDEX, SIZE) kAt_((BASE), (INDEX)*(SIZE))
1258 #define kDeclareAssembly(PREFIX, SYMBOL) kDeclareAssembly_(PREFIX, SYMBOL)
1268 #define kBeginAssembly(PREFIX, SYMBOL, VERSION) kBeginAssembly_(PREFIX, SYMBOL, VERSION)
1275 #define kEndAssembly() kEndAssembly_()
1285 #define kDeclareValue(PREFIX, SYMBOL, BASE) kDeclareValue_(PREFIX, SYMBOL, BASE)
1295 #define kBeginValue(PREFIX, SYMBOL, BASE) kBeginValue_(PREFIX, SYMBOL, BASE)
1302 #define kEndValue() kEndValue_()
1312 #define kDeclareEnum(PREFIX, SYMBOL, BASE) kDeclareEnum_(PREFIX, SYMBOL, BASE)
1322 #define kBeginEnum(PREFIX, SYMBOL, BASE) kBeginEnum_(PREFIX, SYMBOL, BASE)
1329 #define kEndEnum() kEndEnum_()
1339 #define kDeclareBitEnum(PREFIX, SYMBOL, BASE) kDeclareBitEnum_(PREFIX, SYMBOL, BASE)
1349 #define kBeginBitEnum(PREFIX, SYMBOL, BASE) kBeginBitEnum_(PREFIX, SYMBOL, BASE)
1356 #define kEndBitEnum() kEndBitEnum_()
1366 #define kDeclareArrayValue(PREFIX, SYMBOL, BASE) kDeclareArrayValue_(PREFIX, SYMBOL, BASE)
1377 #define kBeginArrayValue(PREFIX, SYMBOL, TYPE, BASE) kBeginArrayValue_(PREFIX, SYMBOL, TYPE, BASE)
1384 #define kEndArrayValue() kEndArrayValue_()
1394 #define kDeclareInterface(PREFIX, SYMBOL, BASE) kDeclareInterface_(PREFIX, SYMBOL, BASE)
1404 #define kBeginInterface(PREFIX, SYMBOL, BASE) kBeginInterface_(PREFIX, SYMBOL, BASE)
1411 #define kEndInterface() kEndInterface_()
1421 #define kDeclareFullClass(PREFIX, SYMBOL, BASE) kDeclareFullClass_(PREFIX, SYMBOL, BASE)
1431 #define kBeginFullClass(PREFIX, SYMBOL, BASE) kBeginFullClass_(PREFIX, SYMBOL, BASE)
1438 #define kEndFullClass() kEndFullClass_()
1448 #define kDeclareVirtualClass(PREFIX, SYMBOL, BASE) kDeclareVirtualClass_(PREFIX, SYMBOL, BASE)
1458 #define kBeginVirtualClass(PREFIX, SYMBOL, BASE) kBeginVirtualClass_(PREFIX, SYMBOL, BASE)
1465 #define kEndVirtualClass() kEndVirtualClass_()
1474 #define kDeclareStaticClass(PREFIX, SYMBOL) kDeclareStaticClass_(PREFIX, SYMBOL)
1483 #define kBeginStaticClass(PREFIX, SYMBOL) kBeginStaticClass_(PREFIX, SYMBOL)
1490 #define kEndStaticClass() kEndStaticClass_()
1500 #define kDeclareClass(PREFIX, SYMBOL, BASE) kDeclareClass_(PREFIX, SYMBOL, BASE)
1510 #define kBeginClass(PREFIX, SYMBOL, BASE) kBeginClass_(PREFIX, SYMBOL, BASE)
1517 #define kEndClass() kEndClass_()
1525 #define kAddDependency(SYMBOL) kAddDependency_(SYMBOL)
1533 #define kAddType(SYMBOL) kAddType_(SYMBOL)
1545 #define kAddPriority(SYMBOL) kAddPriority_(SYMBOL)
1554 #define kAddInterface(SYMBOL, IFACE) kAddInterface_(SYMBOL, IFACE)
1563 #define kAddMethod(SYMBOL, METHOD) kAddMethod_(SYMBOL, METHOD)
1573 #define kAddVMethod(IN_TYPE, FROM_TYPE, METHOD) kAddVMethod_(IN_TYPE, FROM_TYPE, METHOD)
1584 #define kAddIVMethod(IN_TYPE, FROM_IFACE, IMETHOD, CMETHOD) kAddIVMethod_(IN_TYPE, FROM_IFACE, IMETHOD, CMETHOD)
1594 #define kAddField(VALUE, FIELD_TYPE, FIELD) kAddField_(VALUE, FIELD_TYPE, FIELD)
1603 #define kAddEnumerator(VALUE, ENUMERATOR) kAddEnumerator_(VALUE, ENUMERATOR)
1616 #define kAddVersion(TYPE, FORMAT, FORMAT_VER, GUID, WRITE_METHOD, READ_METHOD) \
1617 kAddVersion_(TYPE, FORMAT, FORMAT_VER, GUID, WRITE_METHOD, READ_METHOD)
1626 #define kAddFlags(TYPE, FLAGS) kAddFlags_(TYPE, FLAGS)
1630 #include <kApi/kApiDef.x.h>
Represents a 64-unit, null-terminated, kChar sequence.
Represents a 32-bit unsigned integer.
k32s y
Y-coordinate of the origin.
Definition: kApiDef.h:807
k64f height
Height of the rectangle.
Definition: kApiDef.h:837
k32f x
X-coordinate of the origin.
Definition: kApiDef.h:820
Rectangle structure with 32-bit signed integer fields.
Definition: kApiDef.h:804
3D point structure with 32-bit floating-point fields.
Definition: kApiDef.h:754
k64f x
X-coordinate of the origin.
Definition: kApiDef.h:834
k32s width
Width of the rectangle.
Definition: kApiDef.h:861
k8u b
Blue component value.
Definition: kApiDef.h:941
const kChar * kStatus_Name(kStatus status)
Returns a text string representing the name of a status code (e.g.
k16s width
Width of the rectangle.
Definition: kApiDef.h:794
ARGB color pixel structure.
Definition: kApiDef.h:963
k16s y
Y-coordinate of the origin.
Definition: kApiDef.h:793
2D point structure with 16-bit signed integer fields.
Definition: kApiDef.h:671
Represents a 64-bit unsigned integer.
Architecture/compiler-specific definitions.
Represents a 256-unit, null-terminated, kChar sequence.
kPointer receiver
Callback receiver context pointer.
Definition: kApiDef.h:1041
Rotated rectangle structure with 32-bit floating-point fields.
Definition: kApiDef.h:872
k64f y
Y-coordinate of the origin.
Definition: kApiDef.h:835
kStatus(kCall * kCallbackFx)(kPointer receiver, kPointer sender, void *args)
Callback signature for a generic event handler.
Definition: kApiDef.h:1030
Represents a void pointer.
RGB color pixel structure.
Definition: kApiDef.h:939
k16s z
Z-coordinate value.
Definition: kApiDef.h:732
Represents a 16-bit unsigned integer.
k32s xc
X-coordinate of the rectangle center.
Definition: kApiDef.h:859
Rotated rectangle structure with 32-bit signed integer fields.
Definition: kApiDef.h:857
k32f yc
Y-coordinate of the rectangle center.
Definition: kApiDef.h:875
Represents an unsigned integer that can store a pointer address.
k32s angle
Rotation angle of the rectangle.
Definition: kApiDef.h:863
Represents an 8-bit unsigned integer.
k64f y
Y-coordinate value.
Definition: kApiDef.h:770
k64f x
X-coordinate value.
Definition: kApiDef.h:769
k8u kVersion_Build(kVersion version)
Returns the build part of a version number.
kStatus kVersion_Parse(kVersion *version, const kChar *buffer)
Parses a version from a formatted string.
Represents a single unit (byte) in a UTF-8 character.
Represents a byte on the current platform.
k16s x
X-coordinate value.
Definition: kApiDef.h:673
k16s y
Y-coordinate value.
Definition: kApiDef.h:731
k32f angle
Rotation angle of the rectangle.
Definition: kApiDef.h:878
Represents a signed integer that can store a pointer address.
k32s height
Height of the rectangle.
Definition: kApiDef.h:809
Rectangle structure with 32-bit floating-point fields.
Definition: kApiDef.h:818
kSize(kCall * kHashFx)(const void *item)
Callback signature to determine hash code of an item.
Definition: kApiDef.h:1020
k32s width
Width of the rectangle.
Definition: kApiDef.h:808
k32s height
Height of the rectangle.
Definition: kApiDef.h:862
Rectangle structure with 64-bit floating-point fields.
Definition: kApiDef.h:832
Represents a 128-unit, null-terminated, kChar sequence.
k32f x
X-coordinate value.
Definition: kApiDef.h:756
k16s y
Y-coordinate value.
Definition: kApiDef.h:674
k16s x
X-coordinate value.
Definition: kApiDef.h:730
k32f z
Z-coordinate value.
Definition: kApiDef.h:758
k64f width
Width of the rectangle.
Definition: kApiDef.h:836
k64f z
Z-coordinate value.
Definition: kApiDef.h:771
Represents a callback function and context pointer.
Definition: kApiDef.h:1038
k8u r
Red component value.
Definition: kApiDef.h:967
k32s yc
Y-coordinate of the rectangle center.
Definition: kApiDef.h:860
Represents a 32-bit signed integer.
k32s kVersion_Compare(kVersion version1, kVersion version2)
Returns an integral value indicating the relationship between the versions.
kBool(kCall * kEqualsFx)(const void *item1, const void *item2)
Callback signature to determine equality of two items.
Definition: kApiDef.h:1012
void(kCall * kFunction)()
Generic pointer to function.
Definition: kApiDef.h:28
k8u r
Red component value.
Definition: kApiDef.h:943
k32f height
Height of the rectangle.
Definition: kApiDef.h:877
k8u g
Green component value.
Definition: kApiDef.h:942
Represents a 64-bit signed integer.
kStatus kVersion_Format(kVersion version, kChar *buffer, kSize capacity)
Formats a version to a string buffer.
Represents a 16-unit, null-terminated, kChar sequence.
Flags that control how a file is opened.
Represents an 8-bit signed integer.
k32f width
Width of the rectangle.
Definition: kApiDef.h:876
k8u b
Blue component value.
Definition: kApiDef.h:965
k16s height
Height of the rectangle.
Definition: kApiDef.h:795
k8u g
Green component value.
Definition: kApiDef.h:966
Represents a 32-unit, null-terminated, kChar sequence.
3D point structure with 16-bit signed integer fields.
Definition: kApiDef.h:728
k8u kVersion_Release(kVersion version)
Returns the release part of a version number.
Represents a 16-bit signed integer.
k32f y
Y-coordinate of the origin.
Definition: kApiDef.h:821
Represents a 32-bit floating-point number.
Represents a version number.
k8u a
Alpha component value.
Definition: kApiDef.h:968
k8u kVersion_Minor(kVersion version)
Returns the minor part of a version number.
Represents an enumeration of error codes.
k8u x
Undefined.
Definition: kApiDef.h:944
#define kCall
kApi standard function calling convention.
Definition: kApiDef.h:17
Image color filter array enumeration.
k32f width
Width of the rectangle.
Definition: kApiDef.h:822
Rectangle structure with 16-bit signed integer fields.
Definition: kApiDef.h:790
kVersion kVersion_Create(k32u major, k32u minor, k32u release, k32u build)
Creates a version value from its constituent parts.
k8u kVersion_Major(kVersion version)
Returns the major part of a version number.
Represents a 64-bit floating-point number.
Comparison type enumeration.
k32s x
X-coordinate of the origin.
Definition: kApiDef.h:806
k32f xc
X-coordinate of the rectangle center.
Definition: kApiDef.h:874
Represents a boolean value.
k16s x
X-coordinate of the origin.
Definition: kApiDef.h:792
k32f height
Height of the rectangle.
Definition: kApiDef.h:823
3D point structure with 64-bit floating-point fields.
Definition: kApiDef.h:767
k32f y
Y-coordinate value.
Definition: kApiDef.h:757