*/
void do_cmd_diary(player_type *creature_ptr)
{
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
int i;
while (TRUE)
char tmp[160];
char buf[1024];
FILE *auto_dump_stream;
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
while (TRUE)
{
{
int i, p = 0;
bool need_redraw = FALSE;
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
while (TRUE)
{
static concptr mark = "Macro Dump";
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- FILE_TYPE(FILE_TYPE_TEXT);
if (!open_auto_dump(fpp, buf, mark)) return;
auto_dump_printf(*fpp, _("\n# 自動マクロセーブ\n\n", "\n# Automatic macro dump\n\n"));
}
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- FILE_TYPE(FILE_TYPE_TEXT);
if (!open_auto_dump(&auto_dump_stream, buf, mark)) return -1;
auto_dump_printf(auto_dump_stream, _("\n# 自動キー配置セーブ\n\n", "\n# Automatic keymap dump\n\n"));
char buf[1024];
FILE *auto_dump_stream;
BIT_FLAGS mode = rogue_like_commands ? KEYMAP_MODE_ROGUE : KEYMAP_MODE_ORIG;
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
while (TRUE)
{
{
TERM_LEN wid, hgt;
Term_get_size(&wid, &hgt);
- FILE_TYPE(FILE_TYPE_TEXT);
FILE *fff;
fff = my_fopen(filename, "w");
if (!check_screen_html_can_open(fff, filename, message)) return;
FILE *fff;
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, "dump.txt");
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
if (!check_screen_text_can_open(fff, buf)) return FALSE;
concptr empty_symbol = "<< ? >>";
if (use_bigtile) empty_symbol = "<< ?? >>";
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
while (TRUE)
{
{
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, name);
-
- FILE_TYPE(FILE_TYPE_TEXT);
-
int fd = fd_open(buf, O_RDONLY);
if (fd >= 0)
{
safe_setuid_drop();
if (fd < 0)
{
- FILE_TYPE(FILE_TYPE_DATA);
safe_setuid_grab();
fd = fd_make(buf, 0644);
safe_setuid_drop();
*/
static bool save_player_aux(player_type *player_ptr, char *name)
{
- FILE_TYPE(FILE_TYPE_SAVE);
-
/* Grab permissions */
safe_setuid_grab();
/* No file yet */
fff = NULL;
- /* File type is "SAVE" */
- FILE_TYPE(FILE_TYPE_SAVE);
-
/* Grab permissions */
safe_setuid_grab();
sprintf(file_name, _("playrecord-%s.txt", "playrec-%s.txt"), savefile_base);
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, file_name);
- FILE_TYPE(FILE_TYPE_TEXT);
*fff = my_fopen(buf, "a");
if (*fff) return TRUE;
*/
void do_cmd_checkquest(player_type *creature_ptr)
{
- FILE_TYPE(FILE_TYPE_TEXT);
screen_save();
do_cmd_knowledge_quests(creature_ptr);
screen_load();
}
/*** Dump the binary image file ***/
- /* File type is "DATA" */
- FILE_TYPE(FILE_TYPE_DATA);
path_build(buf, sizeof(buf), ANGBAND_DIR_DATA, format(_("%s_j.raw", "%s.raw"), filename));
/* Grab permissions */
BIT_FLAGS file_permission = 0664;
if (fd < 0)
{
- /* File type is "DATA" */
- FILE_TYPE(FILE_TYPE_DATA);
-
/* Grab permissions */
safe_setuid_grab();
#include "util/util.h"
#include "view/display-main-window.h"
-#if defined(MACH_O_CARBON)
-#ifdef verify
-#undef verify
-#endif
-#endif
-
/*!
* @brief オブジェクト、地形の表示シンボルなど初期化する / Reset the "visual" lists
* @return なし
# define PATH_SEP "\\"
#endif
- /*
- * The Macintosh allows the use of a "file type" when creating a file
- */
-#if defined(MACH_O_CARBON)
-# define FILE_TYPE_TEXT 'TEXT'
-# define FILE_TYPE_DATA 'DATA'
-# define FILE_TYPE_SAVE 'SAVE'
-# define FILE_TYPE(X) (_ftype = (X))
-#else
-# define FILE_TYPE(X) ((void)0)
-#endif
-
/*
* Linux has "stricmp()" with a different name
*/
#define DEFAULT_X11_FONT_7 "5x8"
#endif
-/*
- * Hack -- Mach-O (native binary format of OS X) is basically a Un*x
- * but has Mac OS/Windows-like user interface
- */
-#ifdef MACH_O_CARBON
-# ifdef PRIVATE_USER_PATH
-# undef PRIVATE_USER_PATH
-# endif
-# ifdef SAVEFILE_USE_UID
-# undef SAVEFILE_USE_UID
-# endif
-#endif
-
#ifndef HAVE_CONFIG_H
#define WORLD_SCORE
#endif /* HAVE_CONFIG_H */
*/
FILE *my_fopen(concptr file, concptr mode)
{
-#if defined(MACH_O_CARBON)
- FILE *tempfff;
-#endif
char buf[1024];
if (path_parse(buf, 1024, file)) return (NULL);
-#if defined(MACH_O_CARBON)
- if (my_strchr(mode, 'w'))
- {
- tempfff = fopen(buf, mode);
- fsetfileinfo(buf, _fcreator, _ftype);
- fclose(tempfff);
- }
-#endif
return (fopen(buf, mode));
}
#endif
for (s = tmp; *s; s++)
{
-#if defined(MACH_O_CARBON)
-
- /*
- * Be nice to the Macintosh, where a file can have Mac or Unix
- * end of line, especially since the introduction of OS X.
- * MPW tools were also very tolerant to the Unix EOL.
- */
- if (*s == '\r') *s = '\n';
-
-#endif /* MACH_O_CARBON */
if (*s == '\n')
{
buf[i] = '\0';
char buf[1024];
if (path_parse(buf, 1024, file)) return -1;
-#if defined(MACH_O_CARBON)
- {
- int fdes;
- fdes = open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode);
- if (fdes >= 0) fsetfileinfo(buf, _fcreator, _ftype);
- return (fdes);
- }
-
-#else
return (open(buf, O_CREAT | O_EXCL | O_WRONLY | O_BINARY, mode));
-#endif
}
extern int usleep(huge usecs);
#endif
-#if defined(MACH_O_CARBON)
-extern void fsetfileinfo(concptr path, u32b fcreator, u32b ftype);
-#endif
-
-#if defined(MACH_O_CARBON)
-/* Globals needed */
-extern u32b _ftype;
-extern u32b _fcreator;
-#endif
-
/*
* Hack -- force definitions -- see fd_seek()
*/
extern const char hexsym[16];
-// todo ファイル処理関数・メッセージ処理関数・画面病が関数で最低限分割する.
+// todo ファイル処理関数・メッセージ処理関数・画面描画関数で最低限分割する.
extern errr path_parse(char *buf, int max, concptr file);
extern errr path_build(char *buf, int max, concptr path, concptr file);
extern FILE *my_fopen(concptr file, concptr mode);
char buf[1024];
path_build(buf, sizeof buf, ANGBAND_DIR_USER, "opt_info.txt");
- /* File type is "TEXT" */
FILE *fff;
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "a");
if (!fff)
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
if (!fff)
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
if (!fff)
char exp[80];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
-
if (!fff)
{
msg_print("Cannot create spoiler file.");
MONRACE_IDX *who;
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
-
if (!fff)
{
msg_print("Cannot create spoiler file.");
int *evol_tree_zero; /* For C_KILL() */
path_build(buf, sizeof buf, ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
-
if (!fff)
{
msg_print("Cannot create spoiler file.");
char buf[1024];
path_build(buf, sizeof(buf), ANGBAND_DIR_USER, fname);
- /* File type is "TEXT" */
- FILE_TYPE(FILE_TYPE_TEXT);
fff = my_fopen(buf, "w");
-
if (!fff)
{
msg_print("Cannot create list file.");