Kempozer color manipulation library
This project is maintained by kempozer
libkempozer is implemented using C11.
All source files must:
kmz_.All exposed structs must:
_t.kmz_.{) on the same line as the struct identifier.typedef following the struct declaration with the struct identifier converted to Pascal Case excluding the trailing t.@const tag on fields that are read-only.prefix non-public fields with _.
Example:
struct kmz_my_struct_t {
/** @const */
int _var;
};
typedef struct kmz_my_struct_t KmzMyStruct;
provide a macro constructor if the struct represents a value type.
Example:
struct kmz_my_value_struct_t {
int var_1, var_2;
};
typedef struct kmz_my_value_struct_t KmzMyValueStruct;
#define kmz_my_value_struct(var_1, var_2) (MyValueStruct) {var_1,var_2}
All exposed struct constructors must:
from_ immediately following the common method prefix.return <struct> or <struct> *.
Example:
KmzMyStruct * KmzMyStruct__from_int(int var) {
KmzMyStruct * me = malloc(sizeof(KmzMyStruct));
me->_var = var;
return me;
}
All exposed struct methods must:
typedef identifier of the struct followed by __.have a first parameter of <struct> me or <struct> * me.
Example:
int KmzMyStruct__get_var(KmzMyStruct * me);
include the opening parenthesis ({) on the same line as the method identifier in the source file.
Example:
int KmzMyStruct__get_var(KmzMyStruct * me) {
return me->_var;
}
All exposed struct constants must:
static const.be prefixed with the typedef identifier of the struct followed by __.
Example:
static const int KmzMyStruct__MY_CONSTANT = 0;
All exposed macros that are designed to be used in code must:
be prefixed with kmz__.
Example:
#define kmz__my_macro(arg1)
define a name for any varargs expected.
Example:
#define kmz_my_vararg_macro(args...)