X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=src%2Ffiles.c;h=1d9bf6c883e61d8f0312d50604cbb64bbd060b80;hb=refs%2Fheads%2Fmaster;hp=492799fa203aedbbc5adbf2f9b151658d0e17e9d;hpb=551f9a4131df7f8451b2a647e1c9d15e240a2a9f;p=hengband%2Fhengband.git diff --git a/src/files.c b/src/files.c deleted file mode 100644 index 492799fa2..000000000 --- a/src/files.c +++ /dev/null @@ -1,6982 +0,0 @@ -/*! - * @file files.c - * @brief ファイル入出力管理 / Purpose: code dealing with files (and death) - * @date 2014/01/28 - * @author - *
- * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
- * This software may be copied and distributed for educational, research,
- * and not for profit purposes provided that this copyright and statement
- * are included in all such copies.  Other copyrights may also apply.
- * 2014 Deskull rearranged comment for Doxygen.\n
- * 
- */ - -#include "angband.h" -#include "util.h" -#include "files.h" -#include "core.h" - -#include "birth.h" -#include "files.h" - -#include "bldg.h" - -#include "cmd-magiceat.h" -#include "cmd-dump.h" -#include "world.h" -#include "player-inventory.h" -#include "player-race.h" -#include "player-status.h" -#include "player-move.h" -#include "player-class.h" -#include "player-skill.h" -#include "player-personality.h" -#include "player-sex.h" -#include "player-effects.h" -#include "sort.h" -#include "mutation.h" -#include "quest.h" -#include "store.h" -#include "artifact.h" -#include "avatar.h" -#include "shoot.h" -#include "patron.h" -#include "monster.h" -#include "monster-process.h" -#include "monster-status.h" -#include "object-flavor.h" -#include "object-hook.h" -#include "realm.h" -#include "realm-hex.h" -#include "cmd-pet.h" -#include "spells.h" -#include "term.h" -#include "view-mainwindow.h" -#include "floor-events.h" -#include "floor-town.h" -#include "dungeon-file.h" -#include "init.h" -#include "monster-spell.h" -#include "floor.h" -#include "dungeon.h" -#include "melee.h" -#include "objectkind.h" -#include "autopick.h" -#include "save.h" -#include "realm-song.h" - -#define PREF_TYPE_NORMAL 0 -#define PREF_TYPE_AUTOPICK 1 -#define PREF_TYPE_HISTPREF 2 - - /* Mode flags for displaying player flags */ -#define DP_CURSE 0x01 -#define DP_IMM 0x02 -#define DP_WP 0x08 - -#define GRAVE_LINE_WIDTH 31 - -concptr ANGBAND_DIR; //!< Path name: The main "lib" directory This variable is not actually used anywhere in the code -concptr ANGBAND_DIR_APEX; //!< High score files (binary) These files may be portable between platforms -concptr ANGBAND_DIR_BONE; //!< Bone files for player ghosts (ascii) These files are portable between platforms -concptr ANGBAND_DIR_DATA; //!< Binary image files for the "*_info" arrays (binary) These files are not portable between platforms -concptr ANGBAND_DIR_EDIT; //!< Textual template files for the "*_info" arrays (ascii) These files are portable between platforms -concptr ANGBAND_DIR_SCRIPT; //!< Script files These files are portable between platforms. -concptr ANGBAND_DIR_FILE; //!< Various extra files (ascii) These files may be portable between platforms -concptr ANGBAND_DIR_HELP; //!< Help files (normal) for the online help (ascii) These files are portable between platforms -concptr ANGBAND_DIR_INFO; //!< Help files (spoilers) for the online help (ascii) These files are portable between platforms -concptr ANGBAND_DIR_PREF; //!< Default user "preference" files (ascii) These files are rarely portable between platforms -concptr ANGBAND_DIR_SAVE; //!< Savefiles for current characters (binary) -concptr ANGBAND_DIR_USER; //!< User "preference" files (ascii) These files are rarely portable between platforms -concptr ANGBAND_DIR_XTRA; //!< Various extra files (binary) These files are rarely portable between platforms - -s16b signal_count; /* Hack -- Count interupts */ - -/* - * Buffer to hold the current savefile name - * 'savefile' holds full path name. 'savefile_base' holds only base name. - */ -char savefile[1024]; -char savefile_base[40]; - -/* - * You may or may not want to use the following "#undef". - */ - /* #undef _POSIX_SAVED_IDS */ - - /*! - * @brief ファイルのドロップパーミッションチェック / Hack -- drop permissions - */ -void safe_setuid_drop(void) -{ - -#ifdef SET_UID - -# ifdef SAFE_SETUID - -# ifdef SAFE_SETUID_POSIX - - if (setuid(getuid()) != 0) - { - quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!")); - } - if (setgid(getgid()) != 0) - { - quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!")); - } - -# else - - if (setreuid(geteuid(), getuid()) != 0) - { - quit(_("setreuid(): 正しく許可が取れません!", "setreuid(): cannot set permissions correctly!")); - } - if (setregid(getegid(), getgid()) != 0) - { - quit(_("setregid(): 正しく許可が取れません!", "setregid(): cannot set permissions correctly!")); - } - -# endif - -# endif - -#endif - -} - - -/*! - * @brief ファイルのグラブパーミッションチェック / Hack -- grab permissions - */ -void safe_setuid_grab(void) -{ - -#ifdef SET_UID - -# ifdef SAFE_SETUID - -# ifdef SAFE_SETUID_POSIX - - if (setuid(p_ptr->player_egid) != 0) - { - quit(_("setuid(): 正しく許可が取れません!", "setuid(): cannot set permissions correctly!")); - } - if (setgid(p_ptr->player_egid) != 0) - { - quit(_("setgid(): 正しく許可が取れません!", "setgid(): cannot set permissions correctly!")); - } - -# else - - if (setreuid(geteuid(), getuid()) != 0) - { - quit(_("setreuid(): 正しく許可が取れません!", "setreuid(): cannot set permissions correctly!")); - } - if (setregid(getegid(), getgid()) != 0) - { - quit(_("setregid(): 正しく許可が取れません!", "setregid(): cannot set permissions correctly!")); - } - -# endif /* SAFE_SETUID_POSIX */ - -# endif /* SAFE_SETUID */ - -#endif /* SET_UID */ - -} - - -/*! - * @brief 各種データテキストをトークン単位に分解する / Extract the first few "tokens" from a buffer - * @param buf データテキストの参照ポインタ - * @param num トークンの数 - * @param tokens トークンを保管する文字列参照ポインタ配列 - * @param mode オプション - * @return 解釈した文字列数 - * @details - *
- * This function uses "colon" and "slash" as the delimeter characters.
- * We never extract more than "num" tokens.  The "last" token may include
- * "delimeter" characters, allowing the buffer to include a "string" token.
- * We save pointers to the tokens in "tokens", and return the number found.
- * Hack -- Attempt to handle the 'c' character formalism
- * Hack -- An empty buffer, or a final delimeter, yields an "empty" token.
- * Hack -- We will always extract at least one token
- * 
- */ -s16b tokenize(char *buf, s16b num, char **tokens, BIT_FLAGS mode) -{ - s16b i = 0; - char *s = buf; - while (i < num - 1) - { - char *t; - for (t = s; *t; t++) - { - /* Found a delimiter */ - if ((*t == ':') || (*t == '/')) break; - - /* Handle single quotes */ - if ((mode & TOKENIZE_CHECKQUOTE) && (*t == '\'')) - { - /* Advance */ - t++; - - /* Handle backslash */ - if (*t == '\\') t++; - - /* Require a character */ - if (!*t) break; - - /* Advance */ - t++; - - /* Hack -- Require a close quote */ - if (*t != '\'') *t = '\''; - } - - /* Handle back-slash */ - if (*t == '\\') t++; - } - - /* Nothing left */ - if (!*t) break; - - /* Nuke and advance */ - *t++ = '\0'; - - /* Save the token */ - tokens[i++] = s; - - /* Advance */ - s = t; - } - - /* Save the token */ - tokens[i++] = s; - return i; -} - - -/* A number with a name */ -typedef struct named_num named_num; - -struct named_num -{ - concptr name; /* The name of this thing */ - int num; /* A number associated with it */ -}; - - -/* Index of spell type names */ -static named_num gf_desc[] = -{ - {"GF_ELEC", GF_ELEC }, - {"GF_POIS", GF_POIS }, - {"GF_ACID", GF_ACID }, - {"GF_COLD", GF_COLD }, - {"GF_FIRE", GF_FIRE }, - {"GF_PSY_SPEAR", GF_PSY_SPEAR }, - {"GF_MISSILE", GF_MISSILE }, - {"GF_ARROW", GF_ARROW }, - {"GF_PLASMA", GF_PLASMA }, - {"GF_WATER", GF_WATER }, - {"GF_LITE", GF_LITE }, - {"GF_DARK", GF_DARK }, - {"GF_LITE_WEAK", GF_LITE_WEAK }, - {"GF_DARK_WEAK", GF_DARK_WEAK }, - {"GF_SHARDS", GF_SHARDS }, - {"GF_SOUND", GF_SOUND }, - {"GF_CONFUSION", GF_CONFUSION }, - {"GF_FORCE", GF_FORCE }, - {"GF_INERTIA", GF_INERTIAL }, - {"GF_MANA", GF_MANA }, - {"GF_METEOR", GF_METEOR }, - {"GF_ICE", GF_ICE }, - {"GF_CHAOS", GF_CHAOS }, - {"GF_NETHER", GF_NETHER }, - {"GF_DISENCHANT", GF_DISENCHANT }, - {"GF_NEXUS", GF_NEXUS }, - {"GF_TIME", GF_TIME }, - {"GF_GRAVITY", GF_GRAVITY }, - {"GF_KILL_WALL", GF_KILL_WALL }, - {"GF_KILL_DOOR", GF_KILL_DOOR }, - {"GF_KILL_TRAP", GF_KILL_TRAP }, - {"GF_MAKE_WALL", GF_MAKE_WALL }, - {"GF_MAKE_DOOR", GF_MAKE_DOOR }, - {"GF_MAKE_TRAP", GF_MAKE_TRAP }, - {"GF_MAKE_TREE", GF_MAKE_TREE }, - {"GF_OLD_CLONE", GF_OLD_CLONE }, - {"GF_OLD_POLY", GF_OLD_POLY }, - {"GF_OLD_HEAL", GF_OLD_HEAL }, - {"GF_OLD_SPEED", GF_OLD_SPEED }, - {"GF_OLD_SLOW", GF_OLD_SLOW }, - {"GF_OLD_CONF", GF_OLD_CONF }, - {"GF_OLD_SLEEP", GF_OLD_SLEEP }, - {"GF_HYPODYNAMIA", GF_HYPODYNAMIA }, - {"GF_AWAY_UNDEAD", GF_AWAY_UNDEAD }, - {"GF_AWAY_EVIL", GF_AWAY_EVIL }, - {"GF_AWAY_ALL", GF_AWAY_ALL }, - {"GF_TURN_UNDEAD", GF_TURN_UNDEAD }, - {"GF_TURN_EVIL", GF_TURN_EVIL }, - {"GF_TURN_ALL", GF_TURN_ALL }, - {"GF_DISP_UNDEAD", GF_DISP_UNDEAD }, - {"GF_DISP_EVIL", GF_DISP_EVIL }, - {"GF_DISP_ALL", GF_DISP_ALL }, - {"GF_DISP_DEMON", GF_DISP_DEMON }, - {"GF_DISP_LIVING", GF_DISP_LIVING }, - {"GF_ROCKET", GF_ROCKET }, - {"GF_NUKE", GF_NUKE }, - {"GF_MAKE_GLYPH", GF_MAKE_GLYPH }, - {"GF_STASIS", GF_STASIS }, - {"GF_STONE_WALL", GF_STONE_WALL }, - {"GF_DEATH_RAY", GF_DEATH_RAY }, - {"GF_STUN", GF_STUN }, - {"GF_HOLY_FIRE", GF_HOLY_FIRE }, - {"GF_HELL_FIRE", GF_HELL_FIRE }, - {"GF_DISINTEGRATE", GF_DISINTEGRATE }, - {"GF_CHARM", GF_CHARM }, - {"GF_CONTROL_UNDEAD", GF_CONTROL_UNDEAD }, - {"GF_CONTROL_ANIMAL", GF_CONTROL_ANIMAL }, - {"GF_PSI", GF_PSI }, - {"GF_PSI_DRAIN", GF_PSI_DRAIN }, - {"GF_TELEKINESIS", GF_TELEKINESIS }, - {"GF_JAM_DOOR", GF_JAM_DOOR }, - {"GF_DOMINATION", GF_DOMINATION }, - {"GF_DISP_GOOD", GF_DISP_GOOD }, - {"GF_DRAIN_MANA", GF_DRAIN_MANA }, - {"GF_MIND_BLAST", GF_MIND_BLAST }, - {"GF_BRAIN_SMASH", GF_BRAIN_SMASH }, - {"GF_CAUSE_1", GF_CAUSE_1 }, - {"GF_CAUSE_2", GF_CAUSE_2 }, - {"GF_CAUSE_3", GF_CAUSE_3 }, - {"GF_CAUSE_4", GF_CAUSE_4 }, - {"GF_HAND_DOOM", GF_HAND_DOOM }, - {"GF_CAPTURE", GF_CAPTURE }, - {"GF_ANIM_DEAD", GF_ANIM_DEAD }, - {"GF_CHARM_LIVING", GF_CHARM_LIVING }, - {"GF_IDENTIFY", GF_IDENTIFY }, - {"GF_ATTACK", GF_ATTACK }, - {"GF_ENGETSU", GF_ENGETSU }, - {"GF_GENOCIDE", GF_GENOCIDE }, - {"GF_PHOTO", GF_PHOTO }, - {"GF_CONTROL_DEMON", GF_CONTROL_DEMON }, - {"GF_LAVA_FLOW", GF_LAVA_FLOW }, - {"GF_BLOOD_CURSE", GF_BLOOD_CURSE }, - {"GF_SEEKER", GF_SEEKER }, - {"GF_SUPER_RAY", GF_SUPER_RAY }, - {"GF_STAR_HEAL", GF_STAR_HEAL }, - {"GF_WATER_FLOW", GF_WATER_FLOW }, - {"GF_CRUSADE", GF_CRUSADE }, - {"GF_STASIS_EVIL", GF_STASIS_EVIL }, - {"GF_WOUNDS", GF_WOUNDS }, - {NULL, 0 } -}; - - -/*! - * @brief 設定ファイルの各行から各種テキスト情報を取得する / - * Parse a sub-file of the "extra info" (format shown below) - * @param creature_ptr プレーヤーへの参照ポインタ - * @param buf データテキストの参照ポインタ - * @return エラーコード - * @details - *
- * Each "action" line has an "action symbol" in the first column,
- * followed by a colon, followed by some command specific info,
- * usually in the form of "tokens" separated by colons or slashes.
- * Blank lines, lines starting with white space, and lines starting
- * with pound signs ("#") are ignored (as comments).
- * Note the use of "tokenize()" to allow the use of both colons and
- * slashes as delimeters, while still allowing final tokens which
- * may contain any characters including "delimiters".
- * Note the use of "strtol()" to allow all "integers" to be encoded
- * in decimal, hexidecimal, or octal form.
- * Note that "monster zero" is used for the "player" attr/char, "object
- * zero" will be used for the "stack" attr/char, and "feature zero" is
- * used for the "nothing" attr/char.
- * Parse another file recursively, see below for details
- *   %:\
- * Specify the attr/char values for "monsters" by race index
- *   R:\:\:\
- * Specify the attr/char values for "objects" by kind index
- *   K:\:\:\
- * Specify the attr/char values for "features" by feature index
- *   F:\:\:\
- * Specify the attr/char values for unaware "objects" by kind tval
- *   U:\:\:\
- * Specify the attr/char values for inventory "objects" by kind tval
- *   E:\:\:\
- * Define a macro action, given an encoded macro action
- *   A:\
- * Create a normal macro, given an encoded macro trigger
- *   P:\
- * Create a command macro, given an encoded macro trigger
- *   C:\
- * Create a keyset mapping
- *   S:\:\:\
- * Turn an option off, given its name
- *   X:\
- * Turn an option on, given its name
- *   Y:\
- * Specify visual information, given an index, and some data
- *   V:\:\:\:\:\
- * Specify the set of colors to use when drawing a zapped spell
- *   Z:\:\
- * Specify a macro trigger template and macro trigger names.
- *   T:\:\:\:\:...
- *   T:\:\:\
- * 
- */ -errr process_pref_file_command(player_type *creature_ptr, char *buf) -{ - if (buf[1] != ':') return 1; - - char *zz[16]; - switch (buf[0]) - { - /* Mega-Hack -- read external player's history file */ - /* Process "H:" */ - case 'H': - add_history_from_pref_line(buf + 2); - return 0; - - /* Process "R::/" -- attr/char for monster races */ - case 'R': - { - if (tokenize(buf + 2, 3, zz, TOKENIZE_CHECKQUOTE) != 3) break; - monster_race *r_ptr; - int i = (huge)strtol(zz[0], NULL, 0); - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - SYMBOL_CODE n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0); - if (i >= max_r_idx) return 1; - r_ptr = &r_info[i]; - if (n1 || (!(n2 & 0x80) && n2)) r_ptr->x_attr = n1; /* Allow TERM_DARK text */ - if (n2) r_ptr->x_char = n2; - return 0; - } - - /* Process "K::/" -- attr/char for object kinds */ - case 'K': - { - if (tokenize(buf + 2, 3, zz, TOKENIZE_CHECKQUOTE) != 3) break; - - object_kind *k_ptr; - int i = (huge)strtol(zz[0], NULL, 0); - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - SYMBOL_CODE n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0); - if (i >= max_k_idx) return 1; - k_ptr = &k_info[i]; - if (n1 || (!(n2 & 0x80) && n2)) k_ptr->x_attr = n1; /* Allow TERM_DARK text */ - if (n2) k_ptr->x_char = n2; - return 0; - } - - /* Process "F::/" -- attr/char for terrain features */ - /* "F::/" */ - /* "F::/:LIT" */ - /* "F::/:/:/" */ - case 'F': - { - feature_type *f_ptr; - int num = tokenize(buf + 2, F_LIT_MAX * 2 + 1, zz, TOKENIZE_CHECKQUOTE); - - if ((num != 3) && (num != 4) && (num != F_LIT_MAX * 2 + 1)) return 1; - else if ((num == 4) && !streq(zz[3], "LIT")) return 1; - - int i = (huge)strtol(zz[0], NULL, 0); - if (i >= max_f_idx) return 1; - f_ptr = &f_info[i]; - - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - SYMBOL_CODE n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0); - if (n1 || (!(n2 & 0x80) && n2)) f_ptr->x_attr[F_LIT_STANDARD] = n1; /* Allow TERM_DARK text */ - if (n2) f_ptr->x_char[F_LIT_STANDARD] = n2; - - /* Mega-hack -- feat supports lighting */ - switch (num) - { - /* No lighting support */ - case 3: - n1 = f_ptr->x_attr[F_LIT_STANDARD]; - n2 = f_ptr->x_char[F_LIT_STANDARD]; - for (int j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++) - { - f_ptr->x_attr[j] = n1; - f_ptr->x_char[j] = n2; - } - - break; - - /* Use default lighting */ - case 4: - apply_default_feat_lighting(f_ptr->x_attr, f_ptr->x_char); - break; - - /* Use desired lighting */ - case F_LIT_MAX * 2 + 1: - for (int j = F_LIT_NS_BEGIN; j < F_LIT_MAX; j++) - { - n1 = (TERM_COLOR)strtol(zz[j * 2 + 1], NULL, 0); - n2 = (SYMBOL_CODE)strtol(zz[j * 2 + 2], NULL, 0); - if (n1 || (!(n2 & 0x80) && n2)) f_ptr->x_attr[j] = n1; /* Allow TERM_DARK text */ - if (n2) f_ptr->x_char[j] = n2; - } - - break; - } - } - - return 0; - - /* Process "S::/" -- attr/char for special things */ - case 'S': - { - if (tokenize(buf + 2, 3, zz, TOKENIZE_CHECKQUOTE) != 3) break; - - int j = (byte)strtol(zz[0], NULL, 0); - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - SYMBOL_CODE n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0); - misc_to_attr[j] = n1; - misc_to_char[j] = n2; - return 0; - } - - /* Process "U::/" -- attr/char for unaware items */ - case 'U': - { - if (tokenize(buf + 2, 3, zz, TOKENIZE_CHECKQUOTE) != 3) break; - - int j = (huge)strtol(zz[0], NULL, 0); - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - SYMBOL_CODE n2 = (SYMBOL_CODE)strtol(zz[2], NULL, 0); - for (int i = 1; i < max_k_idx; i++) - { - object_kind *k_ptr = &k_info[i]; - if (k_ptr->tval == j) - { - if (n1) k_ptr->d_attr = n1; - if (n2) k_ptr->d_char = n2; - } - } - - return 0; - } - - /* Process "E::" -- attribute for inventory objects */ - case 'E': - { - if (tokenize(buf + 2, 2, zz, TOKENIZE_CHECKQUOTE) != 2) break; - - int j = (byte)strtol(zz[0], NULL, 0) % 128; - TERM_COLOR n1 = (TERM_COLOR)strtol(zz[1], NULL, 0); - if (n1) tval_to_attr[j] = n1; - return 0; - } - - /* Process "A:" -- save an "action" for later */ - case 'A': - text_to_ascii(macro__buf, buf + 2); - return 0; - - /* Process "P:" -- normal macro */ - case 'P': - { - char tmp[1024]; - - text_to_ascii(tmp, buf + 2); - macro_add(tmp, macro__buf); - return 0; - } - - /* Process "C:" -- create keymap */ - case 'C': - { - if (tokenize(buf + 2, 2, zz, TOKENIZE_CHECKQUOTE) != 2) return 1; - - int mode = strtol(zz[0], NULL, 0); - if ((mode < 0) || (mode >= KEYMAP_MODES)) return 1; - - char tmp[1024]; - text_to_ascii(tmp, zz[1]); - if (!tmp[0] || tmp[1]) return 1; - int i = (byte)(tmp[0]); - - string_free(keymap_act[mode][i]); - - keymap_act[mode][i] = string_make(macro__buf); - - return 0; - } - - /* Process "V:::::" -- visual info */ - case 'V': - { - if (tokenize(buf + 2, 5, zz, TOKENIZE_CHECKQUOTE) != 5) break; - - int i = (byte)strtol(zz[0], NULL, 0); - angband_color_table[i][0] = (byte)strtol(zz[1], NULL, 0); - angband_color_table[i][1] = (byte)strtol(zz[2], NULL, 0); - angband_color_table[i][2] = (byte)strtol(zz[3], NULL, 0); - angband_color_table[i][3] = (byte)strtol(zz[4], NULL, 0); - return 0; - } - - /* Process "X:" -- turn option off */ - /* Process "Y:" -- turn option on */ - case 'X': - case 'Y': - { - for (int i = 0; option_info[i].o_desc; i++) - { - bool is_option = option_info[i].o_var != NULL; - is_option &= option_info[i].o_text != NULL; - is_option &= streq(option_info[i].o_text, buf + 2); - if (!is_option) continue; - - int os = option_info[i].o_set; - int ob = option_info[i].o_bit; - - if ((creature_ptr->playing || current_world_ptr->character_xtra) && - (OPT_PAGE_BIRTH == option_info[i].o_page) && !current_world_ptr->wizard) - { - msg_format(_("初期オプションは変更できません! '%s'", "Birth options can not changed! '%s'"), buf); - msg_print(NULL); - return 0; - } - - if (buf[0] == 'X') - { - option_flag[os] &= ~(1L << ob); - (*option_info[i].o_var) = FALSE; - return 0; - } - - option_flag[os] |= (1L << ob); - (*option_info[i].o_var) = TRUE; - return 0; - } - - /* don't know that option. ignore it.*/ - msg_format(_("オプションの名前が正しくありません: %s", "Ignored invalid option: %s"), buf); - msg_print(NULL); - return 0; - } - - /* Process "Z::" -- set spell color */ - case 'Z': - { - /* Find the colon */ - char *t = my_strchr(buf + 2, ':'); - - if (!t) return 1; - - /* Nuke the colon */ - *(t++) = '\0'; - - for (int i = 0; gf_desc[i].name; i++) - { - /* Match this type */ - if (streq(gf_desc[i].name, buf + 2)) - { - /* Remember this color set */ - gf_color[gf_desc[i].num] = (TERM_COLOR)quark_add(t); - - /* Success */ - return 0; - } - } - - break; - } - - /* Initialize macro trigger names and a template */ - /* Process "T:::" */ - /* Process "T: