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

Go to the source code of this file.
Functions | |
| char * | flag_string (const struct flag_type *flag_table, int bits) |
| int | flag_value (const struct flag_type *flag_table, char *argument) |
| bool | is_stat (const struct flag_type *flag_table) |
Variables | |
| const struct flag_stat_type | flag_stat_table [] |
|
||||||||||||
|
Definition at line 151 of file bit.c. References IS_SET, and is_stat(). Referenced by AEDIT(), display_resets(), MEDIT(), OEDIT(), REDIT(), save_resets(), and show_obj_values(). 00152 {
00153 static char buf[2][512];
00154 static int cnt = 0;
00155 int flag;
00156
00157 if (++cnt > 1)
00158 cnt = 0;
00159
00160 buf[cnt][0] = '\0';
00161
00162 for (flag = 0; flag_table[flag].name != NULL; flag++)
00163 {
00164 if (!is_stat (flag_table) && IS_SET (bits, flag_table[flag].bit))
00165 {
00166 strcat (buf[cnt], " ");
00167 strcat (buf[cnt], flag_table[flag].name);
00168 }
00169 else if (flag_table[flag].bit == bits)
00170 {
00171 strcat (buf[cnt], " ");
00172 strcat (buf[cnt], flag_table[flag].name);
00173 break;
00174 }
00175 }
00176 return (buf[cnt][0] != '\0') ? buf[cnt] + 1 : "none";
00177 }
|
Here is the call graph for this function:

|
||||||||||||
|
Definition at line 111 of file bit.c. References FALSE, flag_lookup(), is_stat(), MAX_INPUT_LENGTH, NO_FLAG, one_argument(), SET_BIT, and TRUE. Referenced by aedit(), change_exit(), do_oflagall(), do_resets(), do_rflagall(), MEDIT(), OEDIT(), REDIT(), and set_obj_values(). 00112 {
00113 char word[MAX_INPUT_LENGTH];
00114 int bit;
00115 int marked = 0;
00116 bool found = FALSE;
00117
00118 if (is_stat (flag_table))
00119 return flag_lookup (argument, flag_table);
00120
00121 /*
00122 * Accept multiple flags.
00123 */
00124 for (;;)
00125 {
00126 argument = one_argument (argument, word);
00127
00128 if (word[0] == '\0')
00129 break;
00130
00131 if ((bit = flag_lookup (word, flag_table)) != NO_FLAG)
00132 {
00133 SET_BIT (marked, bit);
00134 found = TRUE;
00135 }
00136 }
00137
00138 if (found)
00139 return marked;
00140 else
00141 return NO_FLAG;
00142 }
|
Here is the call graph for this function:

|
|
Definition at line 93 of file bit.c. References FALSE, flag_stat_table, and TRUE. Referenced by flag_string(), and flag_value(). 00094 {
00095 int flag;
00096
00097 for (flag = 0; flag_stat_table[flag].structure; flag++)
00098 {
00099 if (flag_stat_table[flag].structure == flag_table
00100 && flag_stat_table[flag].stat)
00101 return TRUE;
00102 }
00103 return FALSE;
00104 }
|
|
|
Initial value: {
{area_flags, FALSE},
{sex_flags, TRUE},
{exit_flags, FALSE},
{door_resets, TRUE},
{room_flags, FALSE},
{sector_flags, TRUE},
{type_flags, TRUE},
{extra_flags, FALSE},
{wear_flags, FALSE},
{act_flags, FALSE},
{affect_flags, FALSE},
{apply_flags, TRUE},
{wear_loc_flags, TRUE},
{wear_loc_strings, TRUE},
{container_flags, FALSE},
{form_flags, FALSE},
{part_flags, FALSE},
{ac_type, TRUE},
{size_flags, TRUE},
{position_flags, TRUE},
{off_flags, FALSE},
{imm_flags, FALSE},
{res_flags, FALSE},
{vuln_flags, FALSE},
{weapon_class, TRUE},
{weapon_type2, FALSE},
{apply_types, TRUE},
{0, 0}
}
Definition at line 50 of file bit.c. Referenced by is_stat(). |
1.4.0