[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
The general rule is that all type and function names defined by the
library are prefixed with ap_
, in order to prevent name
conflicts with other libraries. Moreover, functions operating on
objects of type ap_typ_t
are usually prefixed with
ap_typ_op
.
Given an object of datatype typ_t*
, two kinds of allocation/deallocation pairs of functions may be defined:
typ_t obj;
void typ_init(typ_t* arg, ...)
or typ_t typ_make(...)
void typ_clear(typ_t* arg)
this pair of functions follows the semantics used in the GMP
library. The first function initializes the object of type
typ_t
pointed to by arg, and fills it with a valid
content. The second function deallocates the memory possibly pointed
to by fields of the object *arg
, but do not attempt to
deallocate the memory pointed by arg.
typ_t* obj;
typ_t* typ_alloc(...)
void typ_free(typ_t* arg)
the first function allocates an object of type typ_t
and then
calls a typ_init
-like function on the result; the second
functions first call a typ_clear
-like function and then
deallocate the memory pointed by arg.