Previous: Linking with the Library, Up: Introduction [Contents][Index]
The names of all datatypes declared in the QSMM public header files and its source code are in lowercase. The suffixes of those names correspond to C language keywords used for datatype declarations:
typedef
The ‘_t’ suffix. The names of datatypes for function pointers have the ‘_func_t’ suffix.
enum
The ‘_e’ suffix.
struct
The ‘_s’ suffix.
union
The ‘_u’ suffix.
The names of all datatypes declared in the QSMM public header files have the ‘qsmm_’ prefix.
QSMM has conventions for the use of basic C language types and the types size_t
, qsmm_sig_t
, and qsmm_ssig_t
in various situations.
The API and the package source code itself1 follow these conventions.
C programs using QSMM may also follow them.
The primary conventions are that if a datatype holds signal identifiers or the numbers of signals, and such values
qsmm_sig_t
;
qsmm_ssig_t
;
qsmm_sig_t
;
qsmm_ssig_t
.
The secondary convention is that for sizes of memory arrays and for non-negative indices of their elements allowed to be greater than 32767, you should use the type size_t
.
For other situations, including situations when you choose not to use the type qsmm_sig_t
or qsmm_ssig_t
according to the first two items of primary conventions stated above, the rules are:
char
or int
or use specific bits in values of other numeric types.
char
or int
.
signed char
or int
.
unsigned char
or int
.
int
.
int
.
unsigned int
.
long
or unsigned long
.
long
.
long long
or unsigned long long
.
For example, in QSMM:
char
holds unpacked boolean flags;
int
holds error codes and indices of spur types;
long
holds frequencies and moments of discrete time.
The set of datatypes declared in the API with the ‘_t’ suffix in their names includes the datatypes qsmm_sig_t
and qsmm_ssig_t
, datatypes for function pointers with the ‘_func_t’ suffix, and datatypes for object handles.
See Object Handles, for more information about datatypes for object handles.
Datatypes declared in the API with the ‘_e’ suffix in their names are enumerations. Elements of enumerations are in uppercase.
Datatypes with the suffixes ‘_s’ and ‘_u’ are structures and unions respectively. The order of their fields depends on the datatypes of those fields and is the following:
void
type).
The type order is the following: char
, signed char
, unsigned char
, short
, unsigned short
, int
, unsigned int
, long
, unsigned long
, long long
, unsigned long long
, float
, double
, long double
.
void
type.
For every type name within each type category listed above, the type order is the following:
void
type).
const
qualifier in the order of increasing the number of asterisks.
const
qualifier in the order of increasing the number of asterisks.
As of QSMM version 1.17, not all package source code is yet reworked to follow these conventions.
Previous: Linking with the Library, Up: Introduction [Contents][Index]