version 1.115 | | version 1.116 |
---|
| | |
/* | | /* |
* static char *rcsid_object_c = | | * static char *rcsid_object_c = |
* "$Id: object.c,v 1.115 2005/12/05 22:58:34 akirschbaum Exp $"; | | * "$Id: object.c,v 1.116 2005/12/05 23:34:03 akirschbaum Exp $"; |
*/ | | */ |
| | |
/* | | /* |
| | |
* All objects are dumped to stderr (or alternate logfile, if in server-mode) | | * All objects are dumped to stderr (or alternate logfile, if in server-mode) |
*/ | | */ |
| | |
void dump_all_objects() { | | void dump_all_objects(void) { |
object *op; | | object *op; |
for(op=objects;op!=NULL;op=op->next) { | | for(op=objects;op!=NULL;op=op->next) { |
dump_object(op); | | dump_object(op); |
| | |
return op; | | return op; |
} | | } |
| | |
void free_all_object_data() { | | void free_all_object_data(void) { |
#ifdef MEMORY_DEBUG | | #ifdef MEMORY_DEBUG |
object *op, *next; | | object *op, *next; |
| | |
| | |
* It is called from get_object() if the unused list is empty. | | * It is called from get_object() if the unused list is empty. |
*/ | | */ |
| | |
void expand_objects() { | | void expand_objects(void) { |
int i; | | int i; |
object *new; | | object *new; |
new = (object *) CALLOC(OBJ_EXPAND,sizeof(object)); | | new = (object *) CALLOC(OBJ_EXPAND,sizeof(object)); |
| | |
* If there are no free objects, expand_objects() is called to get more. | | * If there are no free objects, expand_objects() is called to get more. |
*/ | | */ |
| | |
object *get_object() { | | object *get_object(void) { |
object *op; | | object *op; |
| | |
if(free_objects==NULL) { | | if(free_objects==NULL) { |
| | |
* count_free() returns the number of objects on the list of free objects. | | * count_free() returns the number of objects on the list of free objects. |
*/ | | */ |
| | |
int count_free() { | | int count_free(void) { |
int i=0; | | int i=0; |
object *tmp=free_objects; | | object *tmp=free_objects; |
while(tmp!=NULL) | | while(tmp!=NULL) |
| | |
* count_used() returns the number of objects on the list of used objects. | | * count_used() returns the number of objects on the list of used objects. |
*/ | | */ |
| | |
int count_used() { | | int count_used(void) { |
int i=0; | | int i=0; |
object *tmp=objects; | | object *tmp=objects; |
while(tmp!=NULL) | | while(tmp!=NULL) |
| | |
* count_active() returns the number of objects on the list of active objects. | | * count_active() returns the number of objects on the list of active objects. |
*/ | | */ |
| | |
int count_active() { | | int count_active(void) { |
int i=0; | | int i=0; |
object *tmp=active_objects; | | object *tmp=active_objects; |
while(tmp!=NULL) | | while(tmp!=NULL) |