Base class for reference counting and delete locking
MX_ATOM is an object intended to be used as a base class to implement reference counting and delete locking in the derived class.
Properly constructed MX_ATOM objects are bit-copy-correct which means that a binary copy retains proper functioning. The copied object should not be used after the binary copy.
Because MX_ATOM is bit-copy-correct it can safely be placed in a MX_VECTOR
or the memory realloc'd.
(deds/atom.h)
MX_LOCK
Stop MX_ATOMs from getting deleted
This object implements a delete lock for an MX_ATOM. While a valid MX_LOCK exists for an MX_ATOM object (or one derived from it) the object is guaranteed not be deleted. An object can have multiple locks placed on it.
MX_LOCK is NOT bit-copy-correct so it cannot safely be placed in a MX_VECTOR
or in memory that gets realloc'd.
(deds/atom.h)
#define MX_REF(type)
A reference type, a typed MX_LOCK
This macro defines a MX_LOCK where the target is of some defined type.
A reference functions the same way as a MX_LOCK except the locked (i.e. referenced)
object is available in a typesafe way. A pointer to the reference target is
available with the MXREF macro.
(deds/atom.h)
#define MX_DLLIST(type)
Double linked list
This macro declares a double linked list structure. The list
surrounding type can then be manipulated by the other mx_dllist_* and
MX_DLLIST_* macros. The type should be initialized with all zeros.
(deds/dllist.h)
#define MX_DLLIST_ELEM(type)
Elements for a double linked list
This macro declares elements for a double linked list structure.
This delcaration must be included in a struct with an appropriate type. The
surrounding type can then be manipulated by the other mx_dllist_* and
MX_DLLIST_* macros. The surrounding type should be initialized with all
zeros.
(deds/dllist.h)
#define MX_DLLIST_NODE(type,list)
Elements for a double linked list node
This macro declares elements for a double linked list node
structure. This delcaration must be included in a struct with an appropriate
type. The surrounding type can then be manipulated by the other mx_dllist_*
and MX_DLLIST_* macros. The surrounding type should be initialized with all
zeros.
(deds/dllist.h)
typedef void* (*MX_ALLOC) (size_t bytes);
A stdlib malloc-like function.
typedef void* (*MX_REALLOC) (void* ptr, size_t bytes);
A stdlib realloc-like function.
typedef void (*MX_FREE) (void* ptr);
A stdlib free-like function.
MX_ALLOCATOR
A standard memory alloc/realloc/free tool
MX_RECT
A basic rectangle
This type is a basic rectangle with an upper-left at x1,y1 and lower-right at x2, y2. (deds/rect.h)
member: int x1 Left coordinate (deds/rect.h)
member: int y1 Upper coordinate (deds/rect.h)
member: int x2 Right coordinate (deds/rect.h)
member:
int y2 Lower coordinate
(deds/rect.h)
MX_RECTATOM_DATA
MX_RECT with reference counting
MX_STRING
A string object
#define MX_VECTOR(type)
A 100% typesafe generic vector for C
This macro functions as a type delaration for a vector of user-defined
type.
(deds/vector.h)
#define MX_VECTOR_ITERATOR(type)
An iterator for a MX_VECTOR
This macro functions as a type declaration for an iterator for a
similarly typed MX_VECTOR.
(deds/vector.h)
Generated by MXDOC 2.6 on Wed Apr 25 21:43:00 2007