unsigned mx_unlock(MX_LOCK* lock)
Destruct a MX_LOCK
This function destroys a MX_LOCK and removes it from it's associated MX_ATOM object. If the object has been flagged for deletion (with the mx_delete() macro) then removal of the last lock caused the MX_ATOM destructor to be called and (if necessary) memory returned to the operating system.
If the release of the lock triggered calling of the object destructor then the function returns non-zero. If this occurs then it is not safe to access the object anymore. If this function returns false then either:
unsigned mx_lastlock(const MX_LOCK* lock)
Find out if a lock is the last one of an object
void* mx__atom(MX_ATOM* atom, MX__ATOM_DESTRUCT destruct, size_t datasize)
Construct an MX_ATOM
This internal function constructs an MX_ATOM and registers a destructor to call when the object gets deleted. (deds/atom.c)
If insufficient object size is suggested then the actually allocated memory is increased to safely contain an MX_ATOM. Passing 0 for datasize is safe. (deds/atom.c)
If no existing MX_ATOM memory is given then memory will be allocated. (deds/atom.c)
The address of the newly constructed MX_ATOM is returned.
(deds/atom.c)
void mx_rect_move(MX_RECT* rrect, int x, int y)
Move a MX_RECT
This function moves a MX_REXT so that the upper left of the rectangle
is at a given x,y, position. The size of the rectangle is not changed.
(deds/rect.c)
void mx_rect_resize(MX_RECT* rrect, int w, int h)
Resize a MX_RECT
This function resizes a MX_REXT to a given size. The upper left point
of the rectangle does not change.
(deds/rect.c)
void* mx__rectatom(MX_RECTATOM_DATA* rectatom, MX__ATOM_DESTRUCT destruct, size_t size)
Construct a MX_RECTATOM.
void mx__rectatom_place(MX_RECTATOM_DATA* rectatom, const MX_RECT* rrect)
Place a MX_RECTATOM
This function places a MX_RECTATOM at a specified area.
(deds/rectatom.c)
void mx_string_realloc(MX_STRING* string, const MX_ALLOC alloc, const MX_FREE dfree)
Reallocate a MX_STRING
This function changes the memory allocation of the text inside a
MX_STRING to the ones in the argumnets. Memory is allocated using the alloc
function and the current contents of the string is copied to the newly
allocated memory. The free function will be called when the memory
associated with the text needs to be freed.
(deds/string/realloc.c)
void mx_string_set(MX_STRING* string, const char* text, int len, const MX_FREE dfree)
Set MX_STRING text and length
This function sets the text, length and free function of a MX_STRING object. When mx_string_free() is called the free function will be called to release the memory associated with the text. The free parameter may be 0 in which case no function will be called to release the text memory. (deds/string/set.c)
If the len parameter is less than 0 (usually -1) then the string
is assumed to be zero terminated.
(deds/string/set.c)
void mx_string(MX_STRING* string)
Construct a MX_STRING
This function initializes a MX_STRING object. It writes the memory full with 0 values. (deds/string/string.c)
Since a MX_STRING filled with 0 is correctly constructed then
static instances dont necessarily have to be constructed before use.
(deds/string/string.c)
void mx_string_free(MX_STRING* string)
Destruct a MX_STRING
This function frees a MX_STRING object. If the associated free
will be called to release any internal memory.
(deds/string/string.c)
const char* mx_string_text(const MX_STRING* string, int* len)
Get MX_STRING text and length
This function return the text of the string along with the length of the text segment. (deds/string/text.c)
The len argument can be 0 in which case the length is not returned.
(deds/string/text.c)
int mx_string_len(const MX_STRING* string)
Get MX_STRING length
This function return the length of the text segment.
(deds/string/text.c)
size_t mx__vector_makeroom(MX__VECTOR_DATA* vect, const size_t num, const size_t place, const size_t sizeofdata)
During appending we expand vectors by doubling thier size with a
minimum of 16 but a different value might be better in some applications.
Can a reasonable API be made for this?
(deds/vector/makeroom.c)
Generated by MXDOC 2.6 on Wed Apr 25 21:43:00 2007