/* Declare general routines for manipulating a bag data structure. *Synchronizeduseistheresponsibilityofcaller.
*/
struct bag;
/* Must be used to create a bag. itemSize is the size *oftheitemsstoredinthebag.initialAllocationisahint *fortheinitialnumberofitemstoallocate.Returnsthe *allocatedbag,returnsNULLifoutofmemory.
*/ struct bag *bagCreateBag(int itemSize, int initialAllocation);
/* *Copybagcontentstoanothernewbag.Thenewbagisreturned,or *NULLifoutofmemory.
*/ struct bag *bagDup(struct bag *);
/* Destroy the bag and reclaim the space it uses.
*/ void bagDestroyBag(struct bag *theBag);
/* Find 'key' in bag. Assumes first entry in item is a pointer. *Returnfounditempointer,NULLifnotfound.
*/ void *bagFind(struct bag *theBag, void *key);
/* Add space for an item in the bag. *Returnallocateditempointer,NULLifnomemory.
*/ void *bagAdd(struct bag *theBag);
/* Delete specified item from bag. *Doesnochecks.
*/ void bagDelete(struct bag *theBag, void *condemned);
/* Delete all items from the bag.
*/ void bagDeleteAll(struct bag *theBag);
/* Return the count of items stored in the bag.
*/ int bagSize(struct bag *theBag);
/* Enumerate over the items in the bag, calling 'func' for *eachitem.Thefunctionispassedtheitemandtheuser *supplied'arg'.Aborttheenumerationifthefunction *returnsFALSE.ReturnTRUEiftheenumerationcompleted *successfullyandFALSEifitwasaborted. *Additionanddeletionduringenumerationisnotsupported.
*/ typedef jboolean (*bagEnumerateFunction)(void *item, void *arg);
jboolean bagEnumerateOver(struct bag *theBag,
bagEnumerateFunction func, void *arg);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.