char *sfile;
const char *sfile;
save_into_file(sfile)	char *sfile;{	int fp;	int file_id;	char name_buffer[MAXPATHLEN];	char *hptr;	struct rogue_time rt_buf;	if (sfile[0] == '~') {		if ((hptr = md_getenv("HOME"))) {			if (strlen(hptr) + strlen(sfile+1) < sizeof(name_buffer)) {				(void) strlcpy(name_buffer, hptr,					sizeof name_buffer);				(void) strlcat(name_buffer, sfile+1,					sizeof name_buffer);				sfile = name_buffer;			} else {				messagef(0, "homedir is too long");				return;			}		}	}	if (	((fp = open(sfile, O_WRONLY | O_CREAT | O_TRUNC, 0644)) == -1) ||			((file_id = md_get_file_id(sfile)) == -1)) {		messagef(0, "problem accessing the save file");		if (fp != -1)			close(fp);		return;	}	md_ignore_signals();	write_failed = 0;	(void) xxx(1);	r_write(fp, (char *) &detect_monster, sizeof(detect_monster));	r_write(fp, (char *) &cur_level, sizeof(cur_level));	r_write(fp, (char *) &max_level, sizeof(max_level));	write_string(hunger_str, fp);	write_string(login_name, fp);	r_write(fp, (char *) &party_room, sizeof(party_room));	write_pack(&level_monsters, fp);	write_pack(&level_objects, fp);	r_write(fp, (char *) &file_id, sizeof(file_id));	rw_dungeon(fp, 1);	r_write(fp, (char *) &foods, sizeof(foods));	r_write(fp, (char *) &rogue, sizeof(fighter));	write_pack(&rogue.pack, fp);	rw_id(id_potions, fp, POTIONS, 1);	rw_id(id_scrolls, fp, SCROLS, 1);	rw_id(id_wands, fp, WANDS, 1);	rw_id(id_rings, fp, RINGS, 1);	r_write(fp, (char *) traps, (MAX_TRAPS * sizeof(trap)));	r_write(fp, (char *) is_wood, (WANDS * sizeof(boolean)));	r_write(fp, (char *) &cur_room, sizeof(cur_room));	rw_rooms(fp, 1);	r_write(fp, (char *) &being_held, sizeof(being_held));	r_write(fp, (char *) &bear_trap, sizeof(bear_trap));	r_write(fp, (char *) &halluc, sizeof(halluc));	r_write(fp, (char *) &blind, sizeof(blind));	r_write(fp, (char *) &confused, sizeof(confused));	r_write(fp, (char *) &levitate, sizeof(levitate));	r_write(fp, (char *) &haste_self, sizeof(haste_self));	r_write(fp, (char *) &see_invisible, sizeof(see_invisible));	r_write(fp, (char *) &detect_monster, sizeof(detect_monster));	r_write(fp, (char *) &wizard, sizeof(wizard));	r_write(fp, (char *) &score_only, sizeof(score_only));	r_write(fp, (char *) &m_moves, sizeof(m_moves));	md_gct(&rt_buf);	rt_buf.second += 10;		/* allow for some processing time */	r_write(fp, (char *) &rt_buf, sizeof(rt_buf));	close(fp);	if (write_failed) {		(void) md_df(sfile);	/* delete file */	} else {		clean_up("");	}}