inc/shaRes.h

Go to the documentation of this file.
00001 /* Shared Resource file 
00002  *
00003  * This file is copyright 2002 Jim Kent, but license is hereby
00004  * granted for all use - public, private or commercial. */
00005 
00006 #ifndef SHARES_H
00007 #define SHARES_H
00008 
00009 struct shaResNode
00010 /* A shared resource node. */
00011     {
00012     struct shaResNode *next;
00013     struct shaResNode *prev;
00014     int links;
00015     char *name;
00016     struct shaResList *list;
00017     void *data;
00018     };
00019 
00020 struct shaResList
00021 /* A shared resource list. */
00022     {
00023     struct shaResNode *head;
00024     void (*freeData)(void *pData);
00025     };
00026 
00027 
00028 void shaUnlink(struct shaResNode *node);
00029 /* Decrement link count and free if down to zero. */
00030 
00031 void shaLink(struct shaResNode *node);
00032 /* Increment link count. */
00033 
00034 struct shaResNode *shaNewNode(struct shaResList *list, char *name, void *data);
00035 /* Create a new node with link count of one. */
00036 
00037 void shaCleanup(struct shaResList *list);
00038 /* Free every node on list. */
00039 
00040 void shaInit(struct shaResList *list, void (*freeData)(void *pData));
00041 /* Start up resource list. */
00042 #endif /* SHARES_H */
00043 
00044 
00045 

Generated on Tue Dec 25 18:39:29 2007 for blat by  doxygen 1.5.2