#include <sys/types.h>
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "merc.h"
Include dependency graph for mem.c:

Go to the source code of this file.
|
|
Definition at line 57 of file mem.c. References oclass_data::next, and sociallist. Referenced by load_socials(), and SEDIT(). 00058 {
00059
00060
00061 social->next = sociallist;
00062 sociallist = social;
00063
00064
00065
00066 return;
00067
00068
00069 }
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 240 of file mem.c. References area_free, free_string(), and area_data::next. 00241 {
00242 free_string (pArea->name);
00243 free_string (pArea->file_name);
00244 free_string (pArea->builders);
00245 free_string (pArea->credits);
00246
00247 pArea->next = area_free->next;
00248 area_free = pArea;
00249 return;
00250 }
|
Here is the call graph for this function:

|
|
Definition at line 283 of file mem.c. References exit_free, free_string(), and exit_data::next. Referenced by change_exit(), and free_room_index(). 00284 {
00285 free_string (pExit->keyword);
00286 free_string (pExit->description);
00287
00288 pExit->next = exit_free;
00289 exit_free = pExit;
00290 return;
00291 }
|
Here is the call graph for this function:

|
|
Definition at line 543 of file mem.c. References free_mprog(), free_shop(), free_string(), mob_index_free, and mob_index_data::next. 00544 {
00545 free_string (pMob->player_name);
00546 free_string (pMob->short_descr);
00547 free_string (pMob->long_descr);
00548 free_string (pMob->description);
00549 free_mprog (pMob->mprogs);
00550
00551 free_shop (pMob->pShop);
00552
00553 pMob->next = mob_index_free;
00554 mob_index_free = pMob;
00555 return;
00556 }
|
Here is the call graph for this function:

|
|
Definition at line 582 of file mem.c. References free_string(), mpcode_free, and mprog_code::next. 00583 {
00584 free_string (pMcode->code);
00585 pMcode->next = mpcode_free;
00586 mpcode_free = pMcode;
00587 return;
00588 }
|
Here is the call graph for this function:

|
|
Definition at line 452 of file mem.c. References free_affect(), free_extra_descr(), free_string(), obj_index_data::next, extra_descr_data::next, affect_data::next, and obj_index_free. 00453 {
00454 EXTRA_DESCR_DATA *pExtra;
00455 AFFECT_DATA *pAf;
00456
00457 free_string (pObj->name);
00458 free_string (pObj->short_descr);
00459 free_string (pObj->description);
00460
00461 for (pAf = pObj->affected; pAf; pAf = pAf->next)
00462 {
00463 free_affect (pAf);
00464 }
00465
00466 for (pExtra = pObj->extra_descr; pExtra; pExtra = pExtra->next)
00467 {
00468 free_extra_descr (pExtra);
00469 }
00470
00471 pObj->next = obj_index_free;
00472 obj_index_free = pObj;
00473 return;
00474 }
|
Here is the call graph for this function:

|
|
Definition at line 157 of file mem.c. References reset_data::next, and reset_free. Referenced by do_resets(), free_room_index(), and load_resets(). 00158 {
00159 pReset->next = reset_free;
00160 reset_free = pReset;
00161 return;
00162 }
|
|
|
Definition at line 335 of file mem.c. References free_exit(), free_extra_descr(), free_reset_data(), free_string(), MAX_DIR, room_index_data::next, reset_data::next, extra_descr_data::next, and room_index_free. 00336 {
00337 int door;
00338 EXTRA_DESCR_DATA *pExtra;
00339 RESET_DATA *pReset;
00340
00341 free_string (pRoom->name);
00342 free_string (pRoom->description);
00343 free_string (pRoom->owner);
00344
00345 for (door = 0; door < MAX_DIR; door++)
00346 {
00347 if (pRoom->exit[door])
00348 free_exit (pRoom->exit[door]);
00349 }
00350
00351 for (pExtra = pRoom->extra_descr; pExtra; pExtra = pExtra->next)
00352 {
00353 free_extra_descr (pExtra);
00354 }
00355
00356 for (pReset = pRoom->reset_first; pReset; pReset = pReset->next)
00357 {
00358 free_reset_data (pReset);
00359 }
00360
00361 pRoom->next = room_index_free;
00362 room_index_free = pRoom;
00363 return;
00364 }
|
Here is the call graph for this function:

|
|
Definition at line 401 of file mem.c. References shop_data::next, and shop_free. Referenced by free_mob_index(), and MEDIT().
|
|
|
Definition at line 102 of file mem.c. References free_string(), social_list::next, social_free, and sociallist. 00103 {
00104 free_string(sline->name);
00105 free_string(sline->char_no_arg);
00106 free_string(sline->others_no_arg);
00107 free_string(sline->char_found);
00108 free_string(sline->others_found);
00109 free_string(sline->vict_found);
00110 free_string(sline->char_not_found);
00111 free_string(sline->char_auto);
00112 free_string(sline->others_auto);
00113
00114 sline->next = social_free->next;
00115 sociallist = sline;
00116 }
|
Here is the call graph for this function:

|
|
Definition at line 166 of file mem.c. References area_data::age, alloc_perm(), AREA_ADDED, area_data::area_flags, area_free, area_data::builders, area_data::empty, area_data::file_name, MAX_INPUT_LENGTH, area_data::max_vnum, area_data::min_vnum, area_data::name, area_data::next, area_data::nplayer, area_data::security, str_dup(), top_area, TRUE, and area_data::vnum. Referenced by AEDIT(). 00167 {
00168 AREA_DATA *pArea;
00169 char buf[MAX_INPUT_LENGTH];
00170
00171 if (!area_free)
00172 {
00173 pArea = alloc_perm (sizeof (*pArea));
00174 top_area++;
00175 }
00176 else
00177 {
00178 pArea = area_free;
00179 area_free = area_free->next;
00180 }
00181
00182 pArea->next = NULL;
00183 pArea->name = str_dup ("New area");
00184 /* pArea->recall = ROOM_VNUM_TEMPLE; ROM OLC */
00185 pArea->area_flags = AREA_ADDED;
00186 pArea->security = 1;
00187 pArea->builders = str_dup ("None");
00188 pArea->min_vnum = 0;
00189 pArea->max_vnum = 0;
00190 pArea->age = 0;
00191 pArea->nplayer = 0;
00192 pArea->empty = TRUE; /* ROM patch */
00193 sprintf (buf, "area%d.are", pArea->vnum);
00194 pArea->file_name = str_dup (buf);
00195 pArea->vnum = top_area - 1;
00196
00197 return pArea;
00198 }
|
Here is the call graph for this function:

|
|
Definition at line 254 of file mem.c. References alloc_perm(), exit_data::description, exit_free, exit_data::exit_info, exit_data::key, exit_data::keyword, exit_data::next, exit_data::rs_flags, str_empty, exit_data::to_room, top_exit, and exit_data::u1. Referenced by change_exit(). 00255 {
00256 EXIT_DATA *pExit;
00257
00258 if (!exit_free)
00259 {
00260 pExit = alloc_perm (sizeof (*pExit));
00261 top_exit++;
00262 }
00263 else
00264 {
00265 pExit = exit_free;
00266 exit_free = exit_free->next;
00267 }
00268
00269 pExit->u1.to_room = NULL; /* ROM OLC */
00270 pExit->next = NULL;
00271 /* pExit->vnum = 0; ROM OLC */
00272 pExit->exit_info = 0;
00273 pExit->key = 0;
00274 pExit->keyword = &str_empty[0];
00275 pExit->description = &str_empty[0];
00276 pExit->rs_flags = 0;
00277
00278 return pExit;
00279 }
|
Here is the call graph for this function:

|
|
Definition at line 119 of file mem.c. References alloc_perm(), help_data::keyword, help_data::level, help_data::next, str_dup(), and help_data::text. Referenced by HEDIT(), and load_helps(). 00120 {
00121 HELP_DATA *NewHelp;
00122 NewHelp = alloc_perm(sizeof(*NewHelp) );
00123 NewHelp->level = 0;
00124 NewHelp->keyword = str_dup("");
00125 NewHelp->text = str_dup("");
00126 NewHelp->next = NULL;
00127 return NewHelp;
00128 }
|
Here is the call graph for this function:

|
|
Definition at line 478 of file mem.c. References mob_index_data::ac, AC_BASH, AC_EXOTIC, AC_PIERCE, AC_SLASH, mob_index_data::act, ACT_IS_NPC, mob_index_data::affected_by, mob_index_data::alignment, alloc_perm(), mob_index_data::area, mob_index_data::count, mob_index_data::damage, mob_index_data::default_pos, mob_index_data::description, DICE_BONUS, DICE_NUMBER, DICE_TYPE, mob_index_data::form, mob_index_data::hit, mob_index_data::hitroll, mob_index_data::imm_flags, mob_index_data::killed, mob_index_data::level, mob_index_data::long_descr, mob_index_data::mana, mob_index_data::material, mob_index_free, mob_index_data::new_format, mob_index_data::next, mob_index_data::off_flags, mob_index_data::parts, mob_index_data::player_name, POS_STANDING, mob_index_data::pShop, mob_index_data::race, race_lookup(), mob_index_data::res_flags, mob_index_data::sex, mob_index_data::short_descr, mob_index_data::size, SIZE_MEDIUM, mob_index_data::spec_fun, mob_index_data::start_pos, str_dup(), str_empty, top_mob_index, TRUE, mob_index_data::vnum, mob_index_data::vuln_flags, and mob_index_data::wealth. Referenced by MEDIT(). 00479 {
00480 MOB_INDEX_DATA *pMob;
00481
00482 if (!mob_index_free)
00483 {
00484 pMob = alloc_perm (sizeof (*pMob));
00485 top_mob_index++;
00486 }
00487 else
00488 {
00489 pMob = mob_index_free;
00490 mob_index_free = mob_index_free->next;
00491 }
00492
00493 pMob->next = NULL;
00494 pMob->spec_fun = NULL;
00495 pMob->pShop = NULL;
00496 pMob->area = NULL;
00497 pMob->player_name = str_dup ("no name");
00498 pMob->short_descr = str_dup ("(no short description)");
00499 pMob->long_descr = str_dup ("(no long description)\n\r");
00500 pMob->description = &str_empty[0];
00501 pMob->vnum = 0;
00502 pMob->count = 0;
00503 pMob->killed = 0;
00504 pMob->sex = 0;
00505 pMob->level = 0;
00506 pMob->act = ACT_IS_NPC;
00507 pMob->affected_by = 0;
00508 pMob->alignment = 0;
00509 pMob->hitroll = 0;
00510 pMob->race = race_lookup ("human"); /* - Hugin */
00511 pMob->form = 0; /* ROM patch -- Hugin */
00512 pMob->parts = 0; /* ROM patch -- Hugin */
00513 pMob->imm_flags = 0; /* ROM patch -- Hugin */
00514 pMob->res_flags = 0; /* ROM patch -- Hugin */
00515 pMob->vuln_flags = 0; /* ROM patch -- Hugin */
00516 pMob->material = str_dup ("unknown"); /* -- Hugin */
00517 pMob->off_flags = 0; /* ROM patch -- Hugin */
00518 pMob->size = SIZE_MEDIUM; /* ROM patch -- Hugin */
00519 pMob->ac[AC_PIERCE] = 0; /* ROM patch -- Hugin */
00520 pMob->ac[AC_BASH] = 0; /* ROM patch -- Hugin */
00521 pMob->ac[AC_SLASH] = 0; /* ROM patch -- Hugin */
00522 pMob->ac[AC_EXOTIC] = 0; /* ROM patch -- Hugin */
00523 pMob->hit[DICE_NUMBER] = 0; /* ROM patch -- Hugin */
00524 pMob->hit[DICE_TYPE] = 0; /* ROM patch -- Hugin */
00525 pMob->hit[DICE_BONUS] = 0; /* ROM patch -- Hugin */
00526 pMob->mana[DICE_NUMBER] = 0; /* ROM patch -- Hugin */
00527 pMob->mana[DICE_TYPE] = 0; /* ROM patch -- Hugin */
00528 pMob->mana[DICE_BONUS] = 0; /* ROM patch -- Hugin */
00529 pMob->damage[DICE_NUMBER] = 0; /* ROM patch -- Hugin */
00530 pMob->damage[DICE_TYPE] = 0; /* ROM patch -- Hugin */
00531 pMob->damage[DICE_NUMBER] = 0; /* ROM patch -- Hugin */
00532 pMob->start_pos = POS_STANDING; /* -- Hugin */
00533 pMob->default_pos = POS_STANDING; /* -- Hugin */
00534 pMob->wealth = 0;
00535
00536 pMob->new_format = TRUE; /* ROM */
00537
00538 return pMob;
00539 }
|
Here is the call graph for this function:

|
|
Definition at line 560 of file mem.c. References alloc_perm(), mprog_code::code, mpcode_free, mprog_code::next, str_dup(), top_mprog_index, and mprog_code::vnum. Referenced by MPEDIT(). 00561 {
00562 MPROG_CODE *NewCode;
00563
00564 if (!mpcode_free)
00565 {
00566 NewCode = alloc_perm (sizeof (*NewCode));
00567 top_mprog_index++;
00568 }
00569 else
00570 {
00571 NewCode = mpcode_free;
00572 mpcode_free = mpcode_free->next;
00573 }
00574
00575 NewCode->vnum = 0;
00576 NewCode->code = str_dup ("");
00577 NewCode->next = NULL;
00578
00579 return NewCode;
00580 }
|
Here is the call graph for this function:

|
|
Definition at line 410 of file mem.c. References obj_index_data::affected, alloc_perm(), obj_index_data::area, obj_index_data::condition, obj_index_data::cost, obj_index_data::count, obj_index_data::description, obj_index_data::extra_descr, obj_index_data::extra_flags, ITEM_TRASH, obj_index_data::item_type, obj_index_data::material, obj_index_data::name, obj_index_data::new_format, obj_index_data::next, obj_index_free, obj_index_data::short_descr, str_dup(), top_obj_index, TRUE, obj_index_data::value, obj_index_data::vnum, obj_index_data::wear_flags, and obj_index_data::weight. Referenced by OEDIT(). 00411 {
00412 OBJ_INDEX_DATA *pObj;
00413 int value;
00414
00415 if (!obj_index_free)
00416 {
00417 pObj = alloc_perm (sizeof (*pObj));
00418 top_obj_index++;
00419 }
00420 else
00421 {
00422 pObj = obj_index_free;
00423 obj_index_free = obj_index_free->next;
00424 }
00425
00426 pObj->next = NULL;
00427 pObj->extra_descr = NULL;
00428 pObj->affected = NULL;
00429 pObj->area = NULL;
00430 pObj->name = str_dup ("no name");
00431 pObj->short_descr = str_dup ("(no short description)");
00432 pObj->description = str_dup ("(no description)");
00433 pObj->vnum = 0;
00434 pObj->item_type = ITEM_TRASH;
00435 pObj->extra_flags = 0;
00436 pObj->wear_flags = 0;
00437 pObj->count = 0;
00438 pObj->weight = 0;
00439 pObj->cost = 0;
00440 pObj->material = str_dup ("unknown"); /* ROM */
00441 pObj->condition = 100; /* ROM */
00442 for (value = 0; value < 5; value++) /* 5 - ROM */
00443 pObj->value[value] = 0;
00444
00445 pObj->new_format = TRUE; /* ROM */
00446
00447 return pObj;
00448 }
|
Here is the call graph for this function:

|
|
Definition at line 130 of file mem.c. References alloc_perm(), reset_data::arg1, reset_data::arg2, reset_data::arg3, reset_data::arg4, reset_data::command, reset_data::next, reset_free, and top_reset. Referenced by do_resets(), load_resets(), and REDIT(). 00131 {
00132 RESET_DATA *pReset;
00133
00134 if (!reset_free)
00135 {
00136 pReset = alloc_perm (sizeof (*pReset));
00137 top_reset++;
00138 }
00139 else
00140 {
00141 pReset = reset_free;
00142 reset_free = reset_free->next;
00143 }
00144
00145 pReset->next = NULL;
00146 pReset->command = 'X';
00147 pReset->arg1 = 0;
00148 pReset->arg2 = 0;
00149 pReset->arg3 = 0;
00150 pReset->arg4 = 0;
00151
00152 return pReset;
00153 }
|
Here is the call graph for this function:

|
|
Definition at line 294 of file mem.c. References alloc_perm(), room_index_data::area, room_index_data::clan, room_index_data::contents, room_index_data::description, room_index_data::exit, room_index_data::extra_descr, room_index_data::heal_rate, room_index_data::light, room_index_data::mana_rate, MAX_DIR, room_index_data::name, room_index_data::next, room_index_data::owner, room_index_data::people, room_index_data::room_flags, room_index_free, room_index_data::sector_type, str_empty, top_room, and room_index_data::vnum. Referenced by do_make_bare(), and REDIT(). 00295 {
00296 ROOM_INDEX_DATA *pRoom;
00297 int door;
00298
00299 if (!room_index_free)
00300 {
00301 pRoom = alloc_perm (sizeof (*pRoom));
00302 top_room++;
00303 }
00304 else
00305 {
00306 pRoom = room_index_free;
00307 room_index_free = room_index_free->next;
00308 }
00309
00310 pRoom->next = NULL;
00311 pRoom->people = NULL;
00312 pRoom->contents = NULL;
00313 pRoom->extra_descr = NULL;
00314 pRoom->area = NULL;
00315
00316 for (door = 0; door < MAX_DIR; door++)
00317 pRoom->exit[door] = NULL;
00318
00319 pRoom->name = &str_empty[0];
00320 pRoom->description = &str_empty[0];
00321 pRoom->owner = &str_empty[0];
00322 pRoom->vnum = 0;
00323 pRoom->room_flags = 0;
00324 pRoom->light = 0;
00325 pRoom->sector_type = 0;
00326 pRoom->clan = 0;
00327 pRoom->heal_rate = 100;
00328 pRoom->mana_rate = 100;
00329
00330 return pRoom;
00331 }
|
Here is the call graph for this function:

|
|
Definition at line 369 of file mem.c. References alloc_perm(), shop_data::buy_type, shop_data::close_hour, shop_data::keeper, MAX_TRADE, shop_data::next, shop_data::open_hour, shop_data::profit_buy, shop_data::profit_sell, shop_free, and top_shop. Referenced by MEDIT(). 00370 {
00371 SHOP_DATA *pShop;
00372 int buy;
00373
00374 if (!shop_free)
00375 {
00376 pShop = alloc_perm (sizeof (*pShop));
00377 top_shop++;
00378 }
00379 else
00380 {
00381 pShop = shop_free;
00382 shop_free = shop_free->next;
00383 }
00384
00385 pShop->next = NULL;
00386 pShop->keeper = 0;
00387
00388 for (buy = 0; buy < MAX_TRADE; buy++)
00389 pShop->buy_type[buy] = 0;
00390
00391 pShop->profit_buy = 100;
00392 pShop->profit_sell = 100;
00393 pShop->open_hour = 0;
00394 pShop->close_hour = 23;
00395
00396 return pShop;
00397 }
|
Here is the call graph for this function:

|
|
Definition at line 72 of file mem.c. References alloc_perm(), social_list::char_auto, social_list::char_found, social_list::char_no_arg, social_list::char_not_found, social_list::name, social_list::next, social_list::others_auto, social_list::others_found, social_list::others_no_arg, social_free, and social_list::vict_found. Referenced by load_socials(), and SEDIT(). 00073 {
00074 SOCIAL_LIST *stemp;
00075 static SOCIAL_LIST sl;
00076
00077 if (social_free == NULL)
00078 {
00079 stemp = alloc_perm(sizeof(*stemp));
00080 }
00081 else
00082 {
00083 stemp = social_free;
00084 social_free = social_free->next;
00085 }
00086
00087 *stemp = sl;
00088 stemp->name = NULL;
00089 stemp->char_no_arg = NULL;
00090 stemp->others_no_arg = NULL;
00091 stemp->char_found = NULL;
00092 stemp->others_found = NULL;
00093 stemp->vict_found = NULL;
00094 stemp->char_not_found = NULL;
00095 stemp->char_auto = NULL;
00096 stemp->others_auto = NULL;
00097
00098
00099 return stemp;
00100 }
|
Here is the call graph for this function:

|
|
|
|
|
Definition at line 38 of file mem.c. Referenced by free_area(), and new_area(). |
|
|
Definition at line 52 of file mem.c. Referenced by CEDIT(). |
|
|
Definition at line 51 of file mem.c. Referenced by CEDIT(). |
|
|
Definition at line 41 of file mem.c. Referenced by free_exit(), and new_exit(). |
|
|
Definition at line 40 of file mem.c. Referenced by free_extra_descr(), and new_extra_descr(). |
|
|
Definition at line 45 of file mem.c. Referenced by free_mob_index(), and new_mob_index(). |
|
|
Definition at line 558 of file mem.c. Referenced by free_mpcode(), and new_mpcode(). |
|
|
Definition at line 43 of file mem.c. Referenced by free_obj_index(), and new_obj_index(). |
|
|
Definition at line 46 of file mem.c. Referenced by free_reset_data(), and new_reset_data(). |
|
|
Definition at line 42 of file mem.c. Referenced by free_room_index(), and new_room_index(). |
|
|
Definition at line 44 of file mem.c. Referenced by free_shop(), and new_shop(). |
|
|
Definition at line 47 of file mem.c. Referenced by free_social(), and new_social(). |
|
|
|
|
|
|
|
|
|
|
|
Definition at line 201 of file db.c. Referenced by load_mobprogs(), and new_mpcode(). |
|
|
|
|
|
|
1.4.0