Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals

recycle.c File Reference

#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "merc.h"
#include "recycle.h"

Include dependency graph for recycle.c:

Go to the source code of this file.

Functions

bool add_buf (BUFFER *buffer, char *string)
char * buf_string (BUFFER *buffer)
void clear_buf (BUFFER *buffer)
void free_affect (AFFECT_DATA *af)
void free_ban (BAN_DATA *ban)
void free_buf (BUFFER *buffer)
void free_char (CHAR_DATA *ch)
void free_descriptor (DESCRIPTOR_DATA *d)
void free_extra_descr (EXTRA_DESCR_DATA *ed)
void free_gen_data (GEN_DATA *gen)
void free_help (HELP_DATA *help)
void free_mem_data (MEM_DATA *memory)
void free_mprog (MPROG_LIST *mp)
void free_note (NOTE_DATA *note)
void free_obj (OBJ_DATA *obj)
void free_pcdata (PC_DATA *pcdata)
long get_mob_id (void)
long get_pc_id (void)
int get_size (int val)
AFFECT_DATAnew_affect (void)
BAN_DATAnew_ban (void)
BUFFERnew_buf ()
BUFFERnew_buf_size (int size)
CHAR_DATAnew_char (void)
OCLASS_DATAnew_class (void)
DESCRIPTOR_DATAnew_descriptor (void)
EXTRA_DESCR_DATAnew_extra_descr (void)
GEN_DATAnew_gen_data (void)
HELP_AREAnew_had (void)
MEM_DATAnew_mem_data (void)
MPROG_LISTnew_mprog (void)
NOTE_DATAnew_note ()
OBJ_DATAnew_obj (void)
PC_DATAnew_pcdata (void)

Variables

AFFECT_DATAaffect_free
BAN_DATAban_free
BUFFERbuf_free
const int buf_size [MAX_BUF_LIST]
CHAR_DATAchar_free
OCLASS_DATAclass_free
DESCRIPTOR_DATAdescriptor_free
EXTRA_DESCR_DATAextra_descr_free
GEN_DATAgen_data_free
HELP_AREAhad_free
HELP_DATAhelp_free
long last_mob_id
long last_pc_id
MEM_DATAmem_data_free
MPROG_LISTmprog_free
NOTE_DATAnote_free
OBJ_DATAobj_free
PC_DATApcdata_free


Function Documentation

bool add_buf BUFFER buffer,
char *  string
 

Definition at line 593 of file recycle.c.

References alloc_mem(), BUFFER_OVERFLOW, bug(), FALSE, free_mem(), get_size(), buf_type::size, buf_type::state, buf_type::string, and TRUE.

Referenced by ban_site(), do_alist(), do_cshow(), do_find_bad_object(), do_help(), do_kcshow(), do_kingdom_status(), do_mfind(), do_mwhere(), do_ofind(), do_owhere(), do_permit(), do_play(), do_reply(), do_show_skill(), do_skills(), do_spells(), do_tell(), do_who_clan(), do_who_kingdom(), do_whois(), MEDIT(), MPEDIT(), parse_note(), REDIT(), show_classes(), show_damlist(), show_liqlist(), show_list_to_char(), and spell_locate_object().

00594 {
00595     int len;
00596     char *oldstr;
00597     int oldsize;
00598 
00599     oldstr = buffer->string;
00600     oldsize = buffer->size;
00601 
00602     if (buffer->state == BUFFER_OVERFLOW)    /* don't waste time on bad strings! */
00603         return FALSE;
00604 
00605     len = strlen (buffer->string) + strlen (string) + 1;
00606 
00607     while (len >= buffer->size)
00608     {                            /* increase the buffer size */
00609         buffer->size = get_size (buffer->size + 1);
00610         {
00611             if (buffer->size == -1)
00612             {                    /* overflow */
00613                 buffer->size = oldsize;
00614                 buffer->state = BUFFER_OVERFLOW;
00615                 bug ("buffer overflow past size %d", buffer->size);
00616                 return FALSE;
00617             }
00618         }
00619     }
00620 
00621     if (buffer->size != oldsize)
00622     {
00623         buffer->string = alloc_mem (buffer->size);
00624 
00625         strcpy (buffer->string, oldstr);
00626         free_mem (oldstr, oldsize);
00627     }
00628 
00629     strcat (buffer->string, string);
00630     return TRUE;
00631 }

Here is the call graph for this function:

char* buf_string BUFFER buffer  ) 
 

Definition at line 641 of file recycle.c.

References buf_type::string.

Referenced by ban_site(), do_alist(), do_cshow(), do_find_bad_object(), do_help(), do_kcshow(), do_kingdom_status(), do_mfind(), do_mwhere(), do_ofind(), do_owhere(), do_permit(), do_play(), do_replay(), do_show_skill(), do_skills(), do_spells(), do_who_clan(), do_who_kingdom(), do_whois(), MEDIT(), MPEDIT(), parse_note(), REDIT(), show_classes(), show_damlist(), show_liqlist(), show_list_to_char(), and spell_locate_object().

00642 {
00643     return buffer->string;
00644 }

void clear_buf BUFFER buffer  ) 
 

Definition at line 634 of file recycle.c.

References BUFFER_SAFE, buf_type::state, and buf_type::string.

Referenced by do_replay().

00635 {
00636     buffer->string[0] = '\0';
00637     buffer->state = BUFFER_SAFE;
00638 }

void free_affect AFFECT_DATA af  ) 
 

Definition at line 236 of file recycle.c.

References affect_free, INVALIDATE, IS_VALID, and affect_data::next.

Referenced by affect_remove(), affect_remove_obj(), fread_pet(), free_obj(), free_obj_index(), OEDIT(), spell_enchant_armor(), and spell_enchant_weapon().

00237 {
00238     if (!IS_VALID (af))
00239         return;
00240 
00241     INVALIDATE (af);
00242     af->next = affect_free;
00243     affect_free = af;
00244 }

void free_ban BAN_DATA ban  ) 
 

Definition at line 95 of file recycle.c.

References ban_free, free_string(), INVALIDATE, IS_VALID, and ban_data::next.

Referenced by ban_site(), and do_allow().

00096 {
00097     if (!IS_VALID (ban))
00098         return;
00099 
00100     free_string (ban->name);
00101     INVALIDATE (ban);
00102 
00103     ban->next = ban_free;
00104     ban_free = ban;
00105 }

Here is the call graph for this function:

void free_buf BUFFER buffer  ) 
 

Definition at line 577 of file recycle.c.

References buf_free, BUFFER_FREED, free_mem(), INVALIDATE, IS_VALID, buf_type::next, buf_type::size, buf_type::state, and buf_type::string.

Referenced by ban_site(), do_alist(), do_cshow(), do_dump_objects(), do_find_bad_object(), do_help(), do_kcshow(), do_kingdom_status(), do_mfind(), do_mwhere(), do_ofind(), do_owhere(), do_permit(), do_play(), do_show_skill(), do_skills(), do_spells(), do_who_clan(), do_who_kingdom(), do_whois(), free_pcdata(), MEDIT(), MPEDIT(), parse_note(), REDIT(), show_damlist(), show_liqlist(), show_list_to_char(), and spell_locate_object().

00578 {
00579     if (!IS_VALID (buffer))
00580         return;
00581 
00582     free_mem (buffer->string, buffer->size);
00583     buffer->string = NULL;
00584     buffer->size = 0;
00585     buffer->state = BUFFER_FREED;
00586     INVALIDATE (buffer);
00587 
00588     buffer->next = buf_free;
00589     buf_free = buffer;
00590 }

Here is the call graph for this function:

void free_char CHAR_DATA ch  ) 
 

Definition at line 346 of file recycle.c.

References affect_remove(), char_free, extract_obj(), free_note(), free_pcdata(), free_string(), INVALIDATE, IS_NPC, IS_VALID, mobile_count, affect_data::next, and obj_data::next_content.

Referenced by check_reconnect(), close_socket(), extract_char(), and nanny().

00347 {
00348     OBJ_DATA *obj;
00349     OBJ_DATA *obj_next;
00350     AFFECT_DATA *paf;
00351     AFFECT_DATA *paf_next;
00352 
00353     if (!IS_VALID (ch))
00354         return;
00355 
00356     if (IS_NPC (ch))
00357         mobile_count--;
00358 
00359     for (obj = ch->carrying; obj != NULL; obj = obj_next)
00360     {
00361         obj_next = obj->next_content;
00362         extract_obj (obj);
00363     }
00364 
00365     for (paf = ch->affected; paf != NULL; paf = paf_next)
00366     {
00367         paf_next = paf->next;
00368         affect_remove (ch, paf);
00369     }
00370 
00371     free_string (ch->name);
00372     free_string (ch->short_descr);
00373     free_string (ch->long_descr);
00374     free_string (ch->description);
00375     free_string (ch->prompt);
00376     free_string (ch->prefix);
00377 /*    free_note (ch->pnote); */
00378       free_note  (ch->pnote);
00379     free_pcdata (ch->pcdata);
00380 
00381     ch->next = char_free;
00382     char_free = ch;
00383 
00384     INVALIDATE (ch);
00385     return;
00386 }

Here is the call graph for this function:

void free_descriptor DESCRIPTOR_DATA d  ) 
 

Definition at line 135 of file recycle.c.

References descriptor_free, free_mem(), free_string(), INVALIDATE, IS_VALID, and descriptor_data::next.

Referenced by close_socket().

00136 {
00137     if (!IS_VALID (d))
00138         return;
00139 
00140     free_string (d->host);
00141     free_mem (d->outbuf, d->outsize);
00142     INVALIDATE (d);
00143     d->next = descriptor_free;
00144     descriptor_free = d;
00145 }

Here is the call graph for this function:

void free_extra_descr EXTRA_DESCR_DATA ed  ) 
 

Definition at line 199 of file recycle.c.

References extra_descr_free, free_string(), INVALIDATE, IS_VALID, and extra_descr_data::next.

Referenced by free_obj(), free_obj_index(), free_room_index(), OEDIT(), and REDIT().

00200 {
00201     if (!IS_VALID (ed))
00202         return;
00203 
00204     free_string (ed->keyword);
00205     free_string (ed->description);
00206     INVALIDATE (ed);
00207 
00208     ed->next = extra_descr_free;
00209     extra_descr_free = ed;
00210 }

Here is the call graph for this function:

void free_gen_data GEN_DATA gen  ) 
 

Definition at line 167 of file recycle.c.

References gen_data_free, INVALIDATE, IS_VALID, and gen_data::next.

Referenced by nanny().

00168 {
00169     if (!IS_VALID (gen))
00170         return;
00171 
00172     INVALIDATE (gen);
00173 
00174     gen->next = gen_data_free;
00175     gen_data_free = gen;
00176 }

void free_help HELP_DATA help  ) 
 

Definition at line 731 of file recycle.c.

References free_string(), help_free, and oclass_data::next.

00732 {
00733     free_string (help->keyword);
00734     free_string (help->text);
00735     help->next = help_free;
00736     help_free = help;
00737 }

Here is the call graph for this function:

void free_mem_data MEM_DATA memory  ) 
 

Definition at line 494 of file recycle.c.

References INVALIDATE, IS_VALID, mem_data_free, and mem_data::next.

00495 {
00496     if (!IS_VALID (memory))
00497         return;
00498 
00499     memory->next = mem_data_free;
00500     mem_data_free = memory;
00501     INVALIDATE (memory);
00502 }

void free_mprog MPROG_LIST mp  ) 
 

Definition at line 670 of file recycle.c.

References INVALIDATE, IS_VALID, mprog_free, and mprog_list::next.

Referenced by free_mob_index(), and MEDIT().

00671 {
00672     if (!IS_VALID (mp))
00673         return;
00674 
00675     INVALIDATE (mp);
00676     mp->next = mprog_free;
00677     mprog_free = mp;
00678 }

void free_note NOTE_DATA note  ) 
 

Definition at line 58 of file recycle.c.

References free_string(), INVALIDATE, IS_VALID, note_data::next, and note_free.

Referenced by free_char(), load_thread(), note_remove(), and parse_note().

00059 {
00060     if (!IS_VALID(note))
00061     return;
00062     free_string( note->text    );
00063     free_string( note->subject );
00064     free_string( note->to_list );
00065     free_string( note->date    );
00066     free_string( note->sender  );
00067     INVALIDATE(note);
00068     note->next = note_free;
00069     note_free   = note;
00070 }

Here is the call graph for this function:

void free_obj OBJ_DATA obj  ) 
 

Definition at line 267 of file recycle.c.

References free_affect(), free_extra_descr(), free_string(), INVALIDATE, IS_VALID, extra_descr_data::next, affect_data::next, and obj_free.

Referenced by extract_obj(), and fread_obj().

00268 {
00269     AFFECT_DATA *paf, *paf_next;
00270     EXTRA_DESCR_DATA *ed, *ed_next;
00271 
00272     if (!IS_VALID (obj))
00273         return;
00274 
00275     for (paf = obj->affected; paf != NULL; paf = paf_next)
00276     {
00277         paf_next = paf->next;
00278         free_affect (paf);
00279     }
00280     obj->affected = NULL;
00281 
00282     for (ed = obj->extra_descr; ed != NULL; ed = ed_next)
00283     {
00284         ed_next = ed->next;
00285         free_extra_descr (ed);
00286     }
00287     obj->extra_descr = NULL;
00288 
00289     free_string (obj->name);
00290     free_string (obj->description);
00291     free_string (obj->short_descr);
00292     free_string (obj->owner);
00293     INVALIDATE (obj);
00294 
00295     obj->next = obj_free;
00296     obj_free = obj;
00297 }

Here is the call graph for this function:

void free_pcdata PC_DATA pcdata  ) 
 

Definition at line 420 of file recycle.c.

References free_buf(), free_string(), INVALIDATE, IS_VALID, MAX_ALIAS, pc_data::next, and pcdata_free.

Referenced by free_char().

00421 {
00422     int alias;
00423 
00424     if (!IS_VALID (pcdata))
00425         return;
00426 
00427     free_string (pcdata->pwd);
00428     free_string (pcdata->bamfin);
00429     free_string (pcdata->bamfout);
00430     free_string (pcdata->title);
00431     free_buf (pcdata->buffer);
00432 
00433     for (alias = 0; alias < MAX_ALIAS; alias++)
00434     {
00435         free_string (pcdata->alias[alias]);
00436         free_string (pcdata->alias_sub[alias]);
00437     }
00438     INVALIDATE (pcdata);
00439     pcdata->next = pcdata_free;
00440     pcdata_free = pcdata;
00441 
00442     return;
00443 }

Here is the call graph for this function:

long get_mob_id void   ) 
 

Definition at line 461 of file recycle.c.

References last_mob_id.

Referenced by create_mobile().

00462 {
00463     last_mob_id++;
00464     return last_mob_id;
00465 }

long get_pc_id void   ) 
 

Definition at line 452 of file recycle.c.

References current_time, and last_pc_id.

Referenced by load_char_obj().

00453 {
00454     int val;
00455 
00456     val = (current_time <= last_pc_id) ? last_pc_id + 1 : current_time;
00457     last_pc_id = val;
00458     return val;
00459 }

int get_size int  val  ) 
 

Definition at line 513 of file recycle.c.

References buf_size, and MAX_BUF_LIST.

Referenced by add_buf(), new_buf(), and new_buf_size().

00514 {
00515     int i;
00516 
00517     for (i = 0; i < MAX_BUF_LIST; i++)
00518         if (buf_size[i] >= val)
00519         {
00520             return buf_size[i];
00521         }
00522 
00523     return -1;
00524 }

AFFECT_DATA* new_affect void   ) 
 

Definition at line 216 of file recycle.c.

References affect_free, alloc_perm(), affect_data::next, and VALIDATE.

Referenced by acid_effect(), affect_enchant(), affect_to_char(), affect_to_obj(), fread_char(), fread_obj(), fread_pet(), OEDIT(), spell_enchant_armor(), and spell_enchant_weapon().

00217 {
00218     static AFFECT_DATA af_zero;
00219     AFFECT_DATA *af;
00220 
00221     if (affect_free == NULL)
00222         af = alloc_perm (sizeof (*af));
00223     else
00224     {
00225         af = affect_free;
00226         affect_free = affect_free->next;
00227     }
00228 
00229     *af = af_zero;
00230 
00231 
00232     VALIDATE (af);
00233     return af;
00234 }

Here is the call graph for this function:

BAN_DATA* new_ban void   ) 
 

Definition at line 76 of file recycle.c.

References alloc_perm(), ban_free, ban_data::name, ban_data::next, str_empty, and VALIDATE.

Referenced by ban_site(), and load_bans().

00077 {
00078     static BAN_DATA ban_zero;
00079     BAN_DATA *ban;
00080 
00081     if (ban_free == NULL)
00082         ban = alloc_perm (sizeof (*ban));
00083     else
00084     {
00085         ban = ban_free;
00086         ban_free = ban_free->next;
00087     }
00088 
00089     *ban = ban_zero;
00090     VALIDATE (ban);
00091     ban->name = &str_empty[0];
00092     return ban;
00093 }

Here is the call graph for this function:

BUFFER* new_buf  ) 
 

Definition at line 526 of file recycle.c.

References alloc_mem(), alloc_perm(), BASE_BUF, buf_free, BUFFER_SAFE, get_size(), buf_type::next, buf_type::size, buf_type::state, buf_type::string, and VALIDATE.

Referenced by ban_site(), do_alist(), do_cshow(), do_dump_objects(), do_find_bad_object(), do_help(), do_kcshow(), do_kingdom_status(), do_mfind(), do_mwhere(), do_ofind(), do_owhere(), do_permit(), do_play(), do_show_skill(), do_skills(), do_spells(), do_who(), do_who_clan(), do_who_kingdom(), do_whois(), MEDIT(), MPEDIT(), new_pcdata(), parse_note(), REDIT(), show_classes(), show_damlist(), show_liqlist(), show_list_to_char(), and spell_locate_object().

00527 {
00528     BUFFER *buffer;
00529 
00530     if (buf_free == NULL)
00531         buffer = alloc_perm (sizeof (*buffer));
00532     else
00533     {
00534         buffer = buf_free;
00535         buf_free = buf_free->next;
00536     }
00537 
00538     buffer->next = NULL;
00539     buffer->state = BUFFER_SAFE;
00540     buffer->size = get_size (BASE_BUF);
00541 
00542     buffer->string = alloc_mem (buffer->size);
00543     buffer->string[0] = '\0';
00544     VALIDATE (buffer);
00545 
00546     return buffer;
00547 }

Here is the call graph for this function:

BUFFER* new_buf_size int  size  ) 
 

Definition at line 549 of file recycle.c.

References alloc_mem(), alloc_perm(), buf_free, BUFFER_SAFE, bug(), get_size(), buf_type::next, buf_type::size, buf_type::state, buf_type::string, and VALIDATE.

00550 {
00551     BUFFER *buffer;
00552 
00553     if (buf_free == NULL)
00554         buffer = alloc_perm (sizeof (*buffer));
00555     else
00556     {
00557         buffer = buf_free;
00558         buf_free = buf_free->next;
00559     }
00560 
00561     buffer->next = NULL;
00562     buffer->state = BUFFER_SAFE;
00563     buffer->size = get_size (size);
00564     if (buffer->size == -1)
00565     {
00566         bug ("new_buf: buffer size %d too large.", size);
00567         exit (1);
00568     }
00569     buffer->string = alloc_mem (buffer->size);
00570     buffer->string[0] = '\0';
00571     VALIDATE (buffer);
00572 
00573     return buffer;
00574 }

Here is the call graph for this function:

CHAR_DATA* new_char void   ) 
 

Definition at line 303 of file recycle.c.

References alloc_perm(), char_data::armor, char_free, current_time, char_data::description, char_data::hit, char_data::lines, char_data::logon, char_data::long_descr, char_data::mana, char_data::max_hit, char_data::max_mana, char_data::max_move, MAX_STATS, char_data::mod_stat, char_data::move, char_data::name, char_data::next, PAGELEN, char_data::perm_stat, POS_STANDING, char_data::position, char_data::prefix, char_data::prompt, char_data::short_descr, str_empty, and VALIDATE.

Referenced by create_mobile(), and load_char_obj().

00304 {
00305     static CHAR_DATA ch_zero;
00306     CHAR_DATA *ch;
00307     int i;
00308 
00309     if (char_free == NULL)
00310         ch = alloc_perm (sizeof (*ch));
00311     else
00312     {
00313         ch = char_free;
00314         char_free = char_free->next;
00315     }
00316 
00317     *ch = ch_zero;
00318     VALIDATE (ch);
00319     ch->name = &str_empty[0];
00320     ch->short_descr = &str_empty[0];
00321     ch->long_descr = &str_empty[0];
00322     ch->description = &str_empty[0];
00323     ch->prompt = &str_empty[0];
00324     ch->prefix = &str_empty[0];
00325     ch->logon = current_time;
00326     ch->lines = PAGELEN;
00327     for (i = 0; i < 4; i++)
00328         ch->armor[i] = 100;
00329     ch->position = POS_STANDING;
00330     ch->hit = 20;
00331     ch->max_hit = 20;
00332     ch->mana = 100;
00333     ch->max_mana = 100;
00334     ch->move = 100;
00335     ch->max_move = 100;
00336     for (i = 0; i < MAX_STATS; i++)
00337     {
00338         ch->perm_stat[i] = 13;
00339         ch->mod_stat[i] = 0;
00340     }
00341 
00342     return ch;
00343 }

Here is the call graph for this function:

OCLASS_DATA* new_class void   ) 
 

Definition at line 717 of file recycle.c.

References alloc_perm(), class_free, and oclass_data::next.

Referenced by CEDIT().

00718 {
00719     OCLASS_DATA *pClass;
00720     if (class_free)
00721     {
00722         pClass = class_free;
00723         class_free = class_free->next;
00724     }
00725     else
00726         pClass = alloc_perm(sizeof(*pClass));
00727     return pClass;
00728 }

Here is the call graph for this function:

DESCRIPTOR_DATA* new_descriptor void   ) 
 

Definition at line 110 of file recycle.c.

References alloc_mem(), alloc_perm(), CON_GET_NAME, descriptor_data::connected, descriptor_free, descriptor_data::next, descriptor_data::outbuf, descriptor_data::outsize, descriptor_data::showstr_head, descriptor_data::showstr_point, and VALIDATE.

00111 {
00112     static DESCRIPTOR_DATA d_zero;
00113     DESCRIPTOR_DATA *d;
00114 
00115     if (descriptor_free == NULL)
00116         d = alloc_perm (sizeof (*d));
00117     else
00118     {
00119         d = descriptor_free;
00120         descriptor_free = descriptor_free->next;
00121     }
00122 
00123     *d = d_zero;
00124     VALIDATE (d);
00125 
00126     d->connected = CON_GET_NAME;
00127     d->showstr_head = NULL;
00128     d->showstr_point = NULL;
00129     d->outsize = 2000;
00130     d->outbuf = alloc_mem (d->outsize);
00131 
00132     return d;
00133 }

Here is the call graph for this function:

EXTRA_DESCR_DATA* new_extra_descr void   ) 
 

Definition at line 181 of file recycle.c.

References alloc_perm(), extra_descr_data::description, extra_descr_free, extra_descr_data::keyword, extra_descr_data::next, str_empty, and VALIDATE.

Referenced by clone_object(), do_string(), fread_obj(), OEDIT(), and REDIT().

00182 {
00183     EXTRA_DESCR_DATA *ed;
00184 
00185     if (extra_descr_free == NULL)
00186         ed = alloc_perm (sizeof (*ed));
00187     else
00188     {
00189         ed = extra_descr_free;
00190         extra_descr_free = extra_descr_free->next;
00191     }
00192 
00193     ed->keyword = &str_empty[0];
00194     ed->description = &str_empty[0];
00195     VALIDATE (ed);
00196     return ed;
00197 }

Here is the call graph for this function:

GEN_DATA* new_gen_data void   ) 
 

Definition at line 150 of file recycle.c.

References alloc_perm(), gen_data_free, gen_data::next, and VALIDATE.

Referenced by nanny().

00151 {
00152     static GEN_DATA gen_zero;
00153     GEN_DATA *gen;
00154 
00155     if (gen_data_free == NULL)
00156         gen = alloc_perm (sizeof (*gen));
00157     else
00158     {
00159         gen = gen_data_free;
00160         gen_data_free = gen_data_free->next;
00161     }
00162     *gen = gen_zero;
00163     VALIDATE (gen);
00164     return gen;
00165 }

Here is the call graph for this function:

HELP_AREA* new_had void   ) 
 

Definition at line 682 of file recycle.c.

References alloc_perm(), had_free, and help_area_data::next.

Referenced by load_helps().

00683 {
00684     HELP_AREA *had;
00685     static HELP_AREA zHad;
00686 
00687     if (had_free)
00688     {
00689         had = had_free;
00690         had_free = had_free->next;
00691     }
00692     else
00693         had = alloc_perm (sizeof (*had));
00694 
00695     *had = zHad;
00696 
00697     return had;
00698 }

Here is the call graph for this function:

MEM_DATA* new_mem_data void   ) 
 

Definition at line 473 of file recycle.c.

References alloc_mem(), mem_data::id, mem_data_free, mem_data::next, mem_data::reaction, VALIDATE, and mem_data::when.

00474 {
00475     MEM_DATA *memory;
00476 
00477     if (mem_data_free == NULL)
00478         memory = alloc_mem (sizeof (*memory));
00479     else
00480     {
00481         memory = mem_data_free;
00482         mem_data_free = mem_data_free->next;
00483     }
00484 
00485     memory->next = NULL;
00486     memory->id = 0;
00487     memory->reaction = 0;
00488     memory->when = 0;
00489     VALIDATE (memory);
00490 
00491     return memory;
00492 }

Here is the call graph for this function:

MPROG_LIST* new_mprog void   ) 
 

Definition at line 649 of file recycle.c.

References alloc_perm(), mprog_list::code, mprog_free, mprog_list::next, str_dup(), mprog_list::trig_type, VALIDATE, and mprog_list::vnum.

Referenced by MEDIT().

00650 {
00651     static MPROG_LIST mp_zero;
00652     MPROG_LIST *mp;
00653 
00654     if (mprog_free == NULL)
00655         mp = alloc_perm (sizeof (*mp));
00656     else
00657     {
00658         mp = mprog_free;
00659         mprog_free = mprog_free->next;
00660     }
00661 
00662     *mp = mp_zero;
00663     mp->vnum = 0;
00664     mp->trig_type = 0;
00665     mp->code = str_dup ("");
00666     VALIDATE (mp);
00667     return mp;
00668 }

Here is the call graph for this function:

NOTE_DATA* new_note  ) 
 

Definition at line 45 of file recycle.c.

References alloc_perm(), note_data::next, note_free, and VALIDATE.

Referenced by note_attach().

00046 {
00047     NOTE_DATA *note;
00048     if (note_free == NULL)
00049     note = alloc_perm(sizeof(*note));
00050     else
00051     { 
00052     note = note_free;
00053     note_free = note_free->next;
00054     }
00055     VALIDATE(note);
00056    return note;
00057 }

Here is the call graph for this function:

OBJ_DATA* new_obj void   ) 
 

Definition at line 249 of file recycle.c.

References alloc_perm(), obj_data::next, obj_free, and VALIDATE.

Referenced by create_object(), do_clone(), and fread_obj().

00250 {
00251     static OBJ_DATA obj_zero;
00252     OBJ_DATA *obj;
00253 
00254     if (obj_free == NULL)
00255         obj = alloc_perm (sizeof (*obj));
00256     else
00257     {
00258         obj = obj_free;
00259         obj_free = obj_free->next;
00260     }
00261     *obj = obj_zero;
00262     VALIDATE (obj);
00263 
00264     return obj;
00265 }

Here is the call graph for this function:

PC_DATA* new_pcdata void   ) 
 

Definition at line 390 of file recycle.c.

References pc_data::alias, pc_data::alias_sub, alloc_perm(), pc_data::buffer, MAX_ALIAS, new_buf(), pc_data::next, pcdata_free, and VALIDATE.

Referenced by load_char_obj().

00391 {
00392     int alias;
00393 
00394     static PC_DATA pcdata_zero;
00395     PC_DATA *pcdata;
00396 
00397     if (pcdata_free == NULL)
00398         pcdata = alloc_perm (sizeof (*pcdata));
00399     else
00400     {
00401         pcdata = pcdata_free;
00402         pcdata_free = pcdata_free->next;
00403     }
00404 
00405     *pcdata = pcdata_zero;
00406 
00407     for (alias = 0; alias < MAX_ALIAS; alias++)
00408     {
00409         pcdata->alias[alias] = NULL;
00410         pcdata->alias_sub[alias] = NULL;
00411     }
00412 
00413     pcdata->buffer = new_buf ();
00414 
00415     VALIDATE (pcdata);
00416     return pcdata;
00417 }

Here is the call graph for this function:


Variable Documentation

AFFECT_DATA* affect_free
 

Definition at line 214 of file recycle.c.

BAN_DATA* ban_free
 

Definition at line 74 of file recycle.c.

Referenced by free_ban(), and new_ban().

BUFFER* buf_free
 

Definition at line 471 of file recycle.c.

Referenced by free_buf(), new_buf(), and new_buf_size().

const int buf_size[MAX_BUF_LIST]
 

Initial value:

 {
    16, 32, 64, 128, 256, 1024, 2048, 4096, 8192, 16384, 32768 - 70
}

Definition at line 507 of file recycle.c.

Referenced by get_size().

CHAR_DATA* char_free
 

Definition at line 301 of file recycle.c.

OCLASS_DATA*