struct entity occupants[ENTITIES];
/* decl.c */
- int NDECL((*occupation));
- int NDECL((*afternmv));
+ int (*occupation)(void);
+ int (*afternmv)(void);
const char *hname; /* name of the game (argv[0] of main) */
int hackpid; /* current process id */
char chosen_windowtype[WINTYPELEN];
#define DLBFILE dlbfilename
#define DLBBASENAME "nhdat"
extern char dlbfilename[MAX_DLB_FILENAME];
-extern char *FDECL(build_dlb_filename, (const char *));
+extern char *build_dlb_filename(const char *);
#endif
#endif
#ifndef FILENAME_CMP
#define DLB_P dlb *
#endif
-boolean NDECL(dlb_init);
-void NDECL(dlb_cleanup);
+boolean dlb_init(void);
+void dlb_cleanup(void);
-dlb *FDECL(dlb_fopen, (const char *, const char *));
-int FDECL(dlb_fclose, (DLB_P));
-int FDECL(dlb_fread, (char *, int, int, DLB_P));
-int FDECL(dlb_fseek, (DLB_P, long, int));
-char *FDECL(dlb_fgets, (char *, int, DLB_P));
-int FDECL(dlb_fgetc, (DLB_P));
-long FDECL(dlb_ftell, (DLB_P));
+dlb *dlb_fopen(const char *, const char *);
+int dlb_fclose(DLB_P);
+int dlb_fread(char *, int, int, DLB_P);
+int dlb_fseek(DLB_P, long, int);
+char *dlb_fgets(char *, int, DLB_P);
+int dlb_fgetc(DLB_P);
+long dlb_ftell(DLB_P);
/* Resource DLB entry points */
#ifdef DLBRSRC
#ifndef EXTERN_H
#define EXTERN_H
-#define E extern
-
/* ### alloc.c ### */
#if 0
-E long *FDECL(alloc, (unsigned int));
+extern long *alloc(unsigned int);
#endif
-E char *FDECL(fmt_ptr, (const genericptr));
+extern char *fmt_ptr(const void *);
/* This next pre-processor directive covers almost the entire file,
* interrupted only occasionally to pick up specific functions as needed. */
/* ### allmain.c ### */
-E void FDECL(moveloop, (BOOLEAN_P));
-E void NDECL(stop_occupation);
-E void NDECL(display_gamewindows);
-E void NDECL(newgame);
-E void FDECL(welcome, (BOOLEAN_P));
-E time_t NDECL(get_realtime);
-E int FDECL(argcheck, (int, char **, enum earlyarg));
-E void NDECL(early_init);
+extern void moveloop(boolean);
+extern void stop_occupation(void);
+extern void display_gamewindows(void);
+extern void newgame(void);
+extern void welcome(boolean);
+extern time_t get_realtime(void);
+extern int argcheck(int, char **, enum earlyarg);
+extern void early_init(void);
/* ### apply.c ### */
-E int NDECL(doapply);
-E int NDECL(dorub);
-E int NDECL(dojump);
-E int FDECL(jump, (int));
-E int NDECL(number_leashed);
-E void FDECL(o_unleash, (struct obj *));
-E void FDECL(m_unleash, (struct monst *, BOOLEAN_P));
-E void NDECL(unleash_all);
-E boolean FDECL(leashable, (struct monst *));
-E boolean NDECL(next_to_u);
-E struct obj *FDECL(get_mleash, (struct monst *));
-E const char *NDECL(beautiful);
-E void FDECL(check_leash, (XCHAR_P, XCHAR_P));
-E boolean FDECL(um_dist, (XCHAR_P, XCHAR_P, XCHAR_P));
-E boolean FDECL(snuff_candle, (struct obj *));
-E boolean FDECL(snuff_lit, (struct obj *));
-E boolean FDECL(splash_lit, (struct obj *));
-E boolean FDECL(catch_lit, (struct obj *));
-E void FDECL(use_unicorn_horn, (struct obj **));
-E boolean FDECL(tinnable, (struct obj *));
-E void NDECL(reset_trapset);
-E void FDECL(fig_transform, (ANY_P *, long));
-E int FDECL(unfixable_trouble_count, (BOOLEAN_P));
+extern int doapply(void);
+extern int dorub(void);
+extern int dojump(void);
+extern int jump(int);
+extern int number_leashed(void);
+extern void o_unleash(struct obj *);
+extern void m_unleash(struct monst *, boolean);
+extern void unleash_all(void);
+extern boolean leashable(struct monst *);
+extern boolean next_to_u(void);
+extern struct obj *get_mleash(struct monst *);
+extern const char *beautiful(void);
+extern void check_leash(xchar, xchar);
+extern boolean um_dist(xchar, xchar, xchar);
+extern boolean snuff_candle(struct obj *);
+extern boolean snuff_lit(struct obj *);
+extern boolean splash_lit(struct obj *);
+extern boolean catch_lit(struct obj *);
+extern void use_unicorn_horn(struct obj **);
+extern boolean tinnable(struct obj *);
+extern void reset_trapset(void);
+extern void fig_transform(union any *, long);
+extern int unfixable_trouble_count(boolean);
/* ### artifact.c ### */
-E void NDECL(init_artifacts);
-E void FDECL(save_artifacts, (NHFILE *));
-E void FDECL(restore_artifacts, (NHFILE *));
-E const char *FDECL(artiname, (int));
-E struct obj *FDECL(mk_artifact, (struct obj *, ALIGNTYP_P));
-E const char *FDECL(artifact_name, (const char *, short *));
-E boolean FDECL(exist_artifact, (int, const char *));
-E void FDECL(artifact_exists, (struct obj *, const char *, BOOLEAN_P));
-E int NDECL(nartifact_exist);
-E boolean FDECL(arti_immune, (struct obj *, int));
-E boolean FDECL(spec_ability, (struct obj *, unsigned long));
-E boolean FDECL(confers_luck, (struct obj *));
-E boolean FDECL(arti_reflects, (struct obj *));
-E boolean FDECL(shade_glare, (struct obj *));
-E boolean FDECL(restrict_name, (struct obj *, const char *));
-E boolean FDECL(defends, (int, struct obj *));
-E boolean FDECL(defends_when_carried, (int, struct obj *));
-E boolean FDECL(protects, (struct obj *, BOOLEAN_P));
-E void FDECL(set_artifact_intrinsic, (struct obj *, BOOLEAN_P, long));
-E int FDECL(touch_artifact, (struct obj *, struct monst *));
-E int FDECL(spec_abon, (struct obj *, struct monst *));
-E int FDECL(spec_dbon, (struct obj *, struct monst *, int));
-E void FDECL(discover_artifact, (XCHAR_P));
-E boolean FDECL(undiscovered_artifact, (XCHAR_P));
-E int FDECL(disp_artifact_discoveries, (winid));
-E boolean FDECL(artifact_hit, (struct monst *, struct monst *, struct obj *,
- int *, int));
-E int NDECL(doinvoke);
-E boolean FDECL(finesse_ahriman, (struct obj *));
-E void FDECL(arti_speak, (struct obj *));
-E boolean FDECL(artifact_light, (struct obj *));
-E long FDECL(spec_m2, (struct obj *));
-E boolean FDECL(artifact_has_invprop, (struct obj *, UCHAR_P));
-E long FDECL(arti_cost, (struct obj *));
-E struct obj *FDECL(what_gives, (long *));
-E const char *FDECL(glow_color, (int));
-E const char *FDECL(glow_verb, (int, BOOLEAN_P));
-E void FDECL(Sting_effects, (int));
-E int FDECL(retouch_object, (struct obj **, BOOLEAN_P));
-E void FDECL(retouch_equipment, (int));
-E void NDECL(mkot_trap_warn);
-E boolean FDECL(is_magic_key, (struct monst *, struct obj *));
-E struct obj *FDECL(has_magic_key, (struct monst *));
+extern void init_artifacts(void);
+extern void save_artifacts(NHFILE *);
+extern void restore_artifacts(NHFILE *);
+extern const char *artiname(int);
+extern struct obj *mk_artifact(struct obj *, aligntyp);
+extern const char *artifact_name(const char *, short *);
+extern boolean exist_artifact(int, const char *);
+extern void artifact_exists(struct obj *, const char *, boolean);
+extern int nartifact_exist(void);
+extern boolean arti_immune(struct obj *, int);
+extern boolean spec_ability(struct obj *, unsigned long);
+extern boolean confers_luck(struct obj *);
+extern boolean arti_reflects(struct obj *);
+extern boolean shade_glare(struct obj *);
+extern boolean restrict_name(struct obj *, const char *);
+extern boolean defends(int, struct obj *);
+extern boolean defends_when_carried(int, struct obj *);
+extern boolean protects(struct obj *, boolean);
+extern void set_artifact_intrinsic(struct obj *, boolean, long);
+extern int touch_artifact(struct obj *, struct monst *);
+extern int spec_abon(struct obj *, struct monst *);
+extern int spec_dbon(struct obj *, struct monst *, int);
+extern void discover_artifact(xchar);
+extern boolean undiscovered_artifact(xchar);
+extern int disp_artifact_discoveries(winid);
+extern boolean artifact_hit(struct monst *, struct monst *, struct obj *,
+ int *, int);
+extern int doinvoke(void);
+extern boolean finesse_ahriman(struct obj *);
+extern void arti_speak(struct obj *);
+extern boolean artifact_light(struct obj *);
+extern long spec_m2(struct obj *);
+extern boolean artifact_has_invprop(struct obj *, uchar);
+extern long arti_cost(struct obj *);
+extern struct obj *what_gives(long *);
+extern const char *glow_color(int);
+extern const char *glow_verb(int, boolean);
+extern void Sting_effects(int);
+extern int retouch_object(struct obj **, boolean);
+extern void retouch_equipment(int);
+extern void mkot_trap_warn(void);
+extern boolean is_magic_key(struct monst *, struct obj *);
+extern struct obj *has_magic_key(struct monst *);
/* ### attrib.c ### */
-E boolean FDECL(adjattrib, (int, int, int));
-E void FDECL(gainstr, (struct obj *, int, BOOLEAN_P));
-E void FDECL(losestr, (int));
-E void FDECL(poisontell, (int, BOOLEAN_P));
-E void FDECL(poisoned, (const char *, int, const char *, int, BOOLEAN_P));
-E void FDECL(change_luck, (SCHAR_P));
-E int FDECL(stone_luck, (BOOLEAN_P));
-E void NDECL(set_moreluck);
-E void NDECL(restore_attrib);
-E void FDECL(exercise, (int, BOOLEAN_P));
-E void NDECL(exerchk);
-E void FDECL(init_attr, (int));
-E void NDECL(redist_attr);
-E void FDECL(adjabil, (int, int));
-E int NDECL(newhp);
-E schar FDECL(acurr, (int));
-E schar NDECL(acurrstr);
-E boolean FDECL(extremeattr, (int));
-E void FDECL(adjalign, (int));
-E int FDECL(is_innate, (int));
-E char *FDECL(from_what, (int));
-E void FDECL(uchangealign, (int, int));
+extern boolean adjattrib(int, int, int);
+extern void gainstr(struct obj *, int, boolean);
+extern void losestr(int);
+extern void poisontell(int, boolean);
+extern void poisoned(const char *, int, const char *, int, boolean);
+extern void change_luck(schar);
+extern int stone_luck(boolean);
+extern void set_moreluck(void);
+extern void restore_attrib(void);
+extern void exercise(int, boolean);
+extern void exerchk(void);
+extern void init_attr(int);
+extern void redist_attr(void);
+extern void adjabil(int, int);
+extern int newhp(void);
+extern schar acurr(int);
+extern schar acurrstr(void);
+extern boolean extremeattr(int);
+extern void adjalign(int);
+extern int is_innate(int);
+extern char *from_what(int);
+extern void uchangealign(int, int);
/* ### ball.c ### */
-E void FDECL(ballrelease, (BOOLEAN_P));
-E void NDECL(ballfall);
+extern void ballrelease(boolean);
+extern void ballfall(void);
#ifndef BREADCRUMBS
-E void NDECL(placebc);
-E void NDECL(unplacebc);
-E int NDECL(unplacebc_and_covet_placebc);
-E void FDECL(lift_covet_and_placebc, (int));
+extern void placebc(void);
+extern void unplacebc(void);
+extern int unplacebc_and_covet_placebc(void);
+extern void lift_covet_and_placebc(int);
#else
-E void FDECL(Placebc, (const char *, int));
-E void FDECL(Unplacebc, (const char *, int));
-E int FDECL(Unplacebc_and_covet_placebc, (const char *, int));
-E void FDECL(Lift_covet_and_placebc, (int, const char *, int));
#define placebc() Placebc(__FUNCTION__, __LINE__)
#define unplacebc() Unplacebc(__FUNCTION__, __LINE__)
#define unplacebc_and_covet_placebc() \
#define lift_covet_and_placebc(x) \
Lift_covet_and_placebc(x, __FUNCTION__, __LINE__)
#endif
-E void FDECL(set_bc, (int));
-E void FDECL(move_bc, (int, int, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P));
-E boolean FDECL(drag_ball, (XCHAR_P, XCHAR_P, int *, xchar *, xchar *,
- xchar *, xchar *, boolean *, BOOLEAN_P));
-E void FDECL(drop_ball, (XCHAR_P, XCHAR_P));
-E void NDECL(drag_down);
-E void NDECL(bc_sanity_check);
+extern void set_bc(int);
+extern void move_bc(int, int, xchar, xchar, xchar, xchar);
+extern boolean drag_ball(xchar, xchar, int *, xchar *, xchar *, xchar *,
+ xchar *, boolean *, boolean);
+extern void drop_ball(xchar, xchar);
+extern void drag_down(void);
+extern void bc_sanity_check(void);
/* ### bones.c ### */
-E void FDECL(sanitize_name, (char *));
-E void FDECL(drop_upon_death, (struct monst *, struct obj *, int, int));
-E boolean NDECL(can_make_bones);
-E void FDECL(savebones, (int, time_t, struct obj *));
-E int NDECL(getbones);
-E boolean FDECL(bones_include_name, (const char *));
+extern void sanitize_name(char *);
+extern void drop_upon_death(struct monst *, struct obj *, int, int);
+extern boolean can_make_bones(void);
+extern void savebones(int, time_t, struct obj *);
+extern int getbones(void);
+extern boolean bones_include_name(const char *);
/* ### botl.c ### */
-E char *NDECL(do_statusline1);
-E void NDECL(check_gold_symbol);
-E char *NDECL(do_statusline2);
-E void NDECL(bot);
-E void NDECL(timebot);
-E int FDECL(xlev_to_rank, (int));
-E int FDECL(rank_to_xlev, (int));
-E const char *FDECL(rank_of, (int, SHORT_P, BOOLEAN_P));
-E int FDECL(title_to_mon, (const char *, int *, int *));
-E void NDECL(max_rank_sz);
+extern char *do_statusline1(void);
+extern void check_gold_symbol(void);
+extern char *do_statusline2(void);
+extern void bot(void);
+extern void timebot(void);
+extern int xlev_to_rank(int);
+extern int rank_to_xlev(int);
+extern const char *rank_of(int, short, boolean);
+extern int title_to_mon(const char *, int *, int *);
+extern void max_rank_sz(void);
#ifdef SCORE_ON_BOTL
-E long NDECL(botl_score);
-#endif
-E int FDECL(describe_level, (char *));
-E void FDECL(status_initialize, (BOOLEAN_P));
-E void NDECL(status_finish);
-E boolean NDECL(exp_percent_changing);
-E int NDECL(stat_cap_indx);
-E int NDECL(stat_hunger_indx);
-E const char *FDECL(bl_idx_to_fldname, (int));
-E void FDECL(condopt, (int, boolean *, BOOLEAN_P));
-E int FDECL(parse_cond_option, (BOOLEAN_P, char *));
-E void NDECL(cond_menu);
+extern long botl_score(void);
+#endif
+extern int describe_level(char *);
+extern void status_initialize(boolean);
+extern void status_finish(void);
+extern boolean exp_percent_changing(void);
+extern int stat_cap_indx(void);
+extern int stat_hunger_indx(void);
+extern const char *bl_idx_to_fldname(int);
+extern void condopt(int, boolean *, boolean);
+extern int parse_cond_option(boolean, char *);
+extern void cond_menu(void);
#ifdef STATUS_HILITES
-E void NDECL(status_eval_next_unhilite);
-E void NDECL(reset_status_hilites);
-E boolean FDECL(parse_status_hl1, (char *op, BOOLEAN_P));
-E void FDECL(status_notify_windowport, (BOOLEAN_P));
-E void NDECL(clear_status_hilites);
-E int NDECL(count_status_hilites);
-E boolean NDECL(status_hilite_menu);
-#endif
+extern void status_eval_next_unhilite(void);
+extern void reset_status_hilites(void);
+extern boolean parse_status_hl1(char *op, boolean);
+extern void status_notify_windowport(boolean);
+extern void clear_status_hilites(void);
+extern int count_status_hilites(void);
+extern boolean status_hilite_menu(void);
+#endif /* STATUS_HILITES */
/* ### cmd.c ### */
-E char NDECL(randomkey);
-E void FDECL(random_response, (char *, int));
-E int NDECL(rnd_extcmd_idx);
-E int NDECL(domonability);
-E char FDECL(cmd_from_func, (int NDECL((*))));
-E const char *FDECL(cmdname_from_func, (int NDECL((*)), char *, BOOLEAN_P));
-E boolean FDECL(redraw_cmd, (CHAR_P));
-E const char *FDECL(levltyp_to_name, (int));
-E void NDECL(reset_occupations);
-E void FDECL(set_occupation, (int (*)(void), const char *, int));
-E char NDECL(pgetchar);
-E void FDECL(pushch, (CHAR_P));
-E void FDECL(savech, (CHAR_P));
-E const char *FDECL(key2extcmddesc, (UCHAR_P));
-E boolean FDECL(bind_specialkey, (UCHAR_P, const char *));
-E uchar FDECL(txt2key, (char *));
-E void FDECL(parseautocomplete, (char *, BOOLEAN_P));
-E void FDECL(reset_commands, (BOOLEAN_P));
-E void FDECL(rhack, (char *));
-E int NDECL(doextlist);
-E int NDECL(extcmd_via_menu);
-E int NDECL(enter_explore_mode);
-E boolean FDECL(bind_key, (UCHAR_P, const char *));
-E void NDECL(dokeylist);
-E int FDECL(xytod, (SCHAR_P, SCHAR_P));
-E void FDECL(dtoxy, (coord *, int));
-E int FDECL(movecmd, (CHAR_P));
-E int NDECL(dxdy_moveok);
-E int FDECL(getdir, (const char *));
-E void NDECL(confdir);
-E const char *FDECL(directionname, (int));
-E int FDECL(isok, (int, int));
-E int FDECL(get_adjacent_loc,
- (const char *, const char *, XCHAR_P, XCHAR_P, coord *));
-E const char *FDECL(click_to_cmd, (int, int, int));
-E char FDECL(get_count, (char *, CHAR_P, long, long *, BOOLEAN_P));
+extern char randomkey(void);
+extern void random_response(char *, int);
+extern int rnd_extcmd_idx(void);
+extern int domonability(void);
+extern char cmd_from_func(int(*)(void));
+extern const char *cmdname_from_func(int(*)(void), char *, boolean);
+extern boolean redraw_cmd(char);
+extern const char *levltyp_to_name(int);
+extern void reset_occupations(void);
+extern void set_occupation(int(*)(void), const char *, int);
+extern char pgetchar(void);
+extern void pushch(char);
+extern void savech(char);
+extern const char *key2extcmddesc(uchar);
+extern boolean bind_specialkey(uchar, const char *);
+extern uchar txt2key(char *);
+extern void parseautocomplete(char *, boolean);
+extern void reset_commands(boolean);
+extern void rhack(char *);
+extern int doextlist(void);
+extern int extcmd_via_menu(void);
+extern int enter_explore_mode(void);
+extern boolean bind_key(uchar, const char *);
+extern void dokeylist(void);
+extern int xytod(schar, schar);
+extern void dtoxy(coord *, int);
+extern int movecmd(char);
+extern int dxdy_moveok(void);
+extern int getdir(const char *);
+extern void confdir(void);
+extern const char *directionname(int);
+extern int isok(int, int);
+extern int get_adjacent_loc(const char *, const char *, xchar, xchar, coord *);
+extern const char *click_to_cmd(int, int, int);
+extern char get_count(char *, char, long, long *, boolean);
#ifdef HANGUPHANDLING
-E void FDECL(hangup, (int));
-E void NDECL(end_of_input);
+extern void hangup(int);
+extern void end_of_input(void);
#endif
-E char NDECL(readchar);
-E void NDECL(sanity_check);
-E char* FDECL(key2txt, (UCHAR_P, char *));
-E char FDECL(yn_function, (const char *, const char *, CHAR_P));
-E boolean FDECL(paranoid_query, (BOOLEAN_P, const char *));
-E void FDECL(makemap_prepost, (BOOLEAN_P, BOOLEAN_P));
+extern char readchar(void);
+extern void sanity_check(void);
+extern char* key2txt(uchar, char *);
+extern char yn_function(const char *, const char *, char);
+extern boolean paranoid_query(boolean, const char *);
+extern void makemap_prepost(boolean, boolean);
/* ### dbridge.c ### */
-E boolean FDECL(is_pool, (int, int));
-E boolean FDECL(is_lava, (int, int));
-E boolean FDECL(is_pool_or_lava, (int, int));
-E boolean FDECL(is_ice, (int, int));
-E boolean FDECL(is_moat, (int, int));
-E schar FDECL(db_under_typ, (int));
-E int FDECL(is_drawbridge_wall, (int, int));
-E boolean FDECL(is_db_wall, (int, int));
-E boolean FDECL(find_drawbridge, (int *, int *));
-E boolean FDECL(create_drawbridge, (int, int, int, BOOLEAN_P));
-E void FDECL(open_drawbridge, (int, int));
-E void FDECL(close_drawbridge, (int, int));
-E void FDECL(destroy_drawbridge, (int, int));
+extern boolean is_pool(int, int);
+extern boolean is_lava(int, int);
+extern boolean is_pool_or_lava(int, int);
+extern boolean is_ice(int, int);
+extern boolean is_moat(int, int);
+extern schar db_under_typ(int);
+extern int is_drawbridge_wall(int, int);
+extern boolean is_db_wall(int, int);
+extern boolean find_drawbridge(int *, int *);
+extern boolean create_drawbridge(int, int, int, boolean);
+extern void open_drawbridge(int, int);
+extern void close_drawbridge(int, int);
+extern void destroy_drawbridge(int, int);
/* ### decl.c ### */
-E void NDECL(decl_globals_init);
+extern void decl_globals_init(void);
/* ### detect.c ### */
-E boolean FDECL(trapped_chest_at, (int, int, int));
-E boolean FDECL(trapped_door_at, (int, int, int));
-E struct obj *FDECL(o_in, (struct obj *, CHAR_P));
-E struct obj *FDECL(o_material, (struct obj *, unsigned));
-E int FDECL(gold_detect, (struct obj *));
-E int FDECL(food_detect, (struct obj *));
-E int FDECL(object_detect, (struct obj *, int));
-E int FDECL(monster_detect, (struct obj *, int));
-E int FDECL(trap_detect, (struct obj *));
-E const char *FDECL(level_distance, (d_level *));
-E void FDECL(use_crystal_ball, (struct obj **));
-E void NDECL(do_mapping);
-E void FDECL(do_vicinity_map, (struct obj *));
-E void FDECL(cvt_sdoor_to_door, (struct rm *));
-E int NDECL(findit);
-E int NDECL(openit);
-E boolean FDECL(detecting, (void (*)(int, int, genericptr)));
-E void FDECL(find_trap, (struct trap *));
-E void NDECL(warnreveal);
-E int FDECL(dosearch0, (int));
-E int NDECL(dosearch);
-E void NDECL(sokoban_detect);
+extern boolean trapped_chest_at(int, int, int);
+extern boolean trapped_door_at(int, int, int);
+extern struct obj *o_in(struct obj *, char);
+extern struct obj *o_material(struct obj *, unsigned);
+extern int gold_detect(struct obj *);
+extern int food_detect(struct obj *);
+extern int object_detect(struct obj *, int);
+extern int monster_detect(struct obj *, int);
+extern int trap_detect(struct obj *);
+extern const char *level_distance(d_level *);
+extern void use_crystal_ball(struct obj **);
+extern void do_mapping(void);
+extern void do_vicinity_map(struct obj *);
+extern void cvt_sdoor_to_door(struct rm *);
+extern int findit(void);
+extern int openit(void);
+extern boolean detecting(void(*)(int, int, void *));
+extern void find_trap(struct trap *);
+extern void warnreveal(void);
+extern int dosearch0(int);
+extern int dosearch(void);
+extern void sokoban_detect(void);
#ifdef DUMPLOG
-E void NDECL(dump_map);
+extern void dump_map(void);
#endif
-E void FDECL(reveal_terrain, (int, int));
-E int NDECL(wiz_mgender);
+extern void reveal_terrain(int, int);
+extern int wiz_mgender(void);
/* ### dig.c ### */
-E int FDECL(dig_typ, (struct obj *, XCHAR_P, XCHAR_P));
-E boolean NDECL(is_digging);
-E int NDECL(holetime);
-E boolean FDECL(dig_check, (struct monst *, BOOLEAN_P, int, int));
-E void FDECL(digactualhole, (int, int, struct monst *, int));
-E boolean FDECL(dighole, (BOOLEAN_P, BOOLEAN_P, coord *));
-E int FDECL(use_pick_axe, (struct obj *));
-E int FDECL(use_pick_axe2, (struct obj *));
-E boolean FDECL(mdig_tunnel, (struct monst *));
-E void FDECL(draft_message, (BOOLEAN_P));
-E void FDECL(watch_dig, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void NDECL(zap_dig);
-E struct obj *FDECL(bury_an_obj, (struct obj *, boolean *));
-E void FDECL(bury_objs, (int, int));
-E void FDECL(unearth_objs, (int, int));
-E void FDECL(rot_organic, (ANY_P *, long));
-E void FDECL(rot_corpse, (ANY_P *, long));
-E struct obj *FDECL(buried_ball, (coord *));
-E void NDECL(buried_ball_to_punishment);
-E void NDECL(buried_ball_to_freedom);
-E schar FDECL(fillholetyp, (int, int, BOOLEAN_P));
-E void FDECL(liquid_flow,
- (XCHAR_P, XCHAR_P, SCHAR_P, struct trap *, const char *));
-E boolean FDECL(conjoined_pits, (struct trap *, struct trap *, BOOLEAN_P));
+extern int dig_typ(struct obj *, xchar, xchar);
+extern boolean is_digging(void);
+extern int holetime(void);
+extern boolean dig_check(struct monst *, boolean, int, int);
+extern void digactualhole(int, int, struct monst *, int);
+extern boolean dighole(boolean, boolean, coord *);
+extern int use_pick_axe(struct obj *);
+extern int use_pick_axe2(struct obj *);
+extern boolean mdig_tunnel(struct monst *);
+extern void draft_message(boolean);
+extern void watch_dig(struct monst *, xchar, xchar, boolean);
+extern void zap_dig(void);
+extern struct obj *bury_an_obj(struct obj *, boolean *);
+extern void bury_objs(int, int);
+extern void unearth_objs(int, int);
+extern void rot_organic(union any *, long);
+extern void rot_corpse(union any *, long);
+extern struct obj *buried_ball(coord *);
+extern void buried_ball_to_punishment(void);
+extern void buried_ball_to_freedom(void);
+extern schar fillholetyp(int, int, boolean);
+extern void liquid_flow(xchar, xchar, schar, struct trap *, const char *);
+extern boolean conjoined_pits(struct trap *, struct trap *, boolean);
#if 0
-E void FDECL(bury_monst, (struct monst *));
-E void NDECL(bury_you);
-E void NDECL(unearth_you);
-E void NDECL(escape_tomb);
-E void FDECL(bury_obj, (struct obj *));
+extern void bury_monst(struct monst *);
+extern void bury_you(void);
+extern void unearth_you(void);
+extern void escape_tomb(void);
+extern void bury_obj(struct obj *);
#endif
#ifdef DEBUG
-extern int NDECL(wiz_debug_cmd_bury);
+extern int wiz_debug_cmd_bury(void);
#endif
-
/* ### display.c ### */
-E void FDECL(magic_map_background, (XCHAR_P, XCHAR_P, int));
-E void FDECL(map_background, (XCHAR_P, XCHAR_P, int));
-E void FDECL(map_trap, (struct trap *, int));
-E void FDECL(map_object, (struct obj *, int));
-E void FDECL(map_invisible, (XCHAR_P, XCHAR_P));
-E boolean FDECL(unmap_invisible, (int, int));
-E void FDECL(unmap_object, (int, int));
-E void FDECL(map_location, (int, int, int));
-E void FDECL(feel_newsym, (XCHAR_P, XCHAR_P));
-E void FDECL(feel_location, (XCHAR_P, XCHAR_P));
-E void FDECL(newsym, (int, int));
-E void FDECL(newsym_force, (int, int));
-E void FDECL(shieldeff, (XCHAR_P, XCHAR_P));
-E void FDECL(tmp_at, (int, int));
-E void FDECL(flash_glyph_at, (int, int, int, int));
-E void FDECL(swallowed, (int));
-E void FDECL(under_ground, (int));
-E void FDECL(under_water, (int));
-E void NDECL(see_monsters);
-E void NDECL(set_mimic_blocking);
-E void NDECL(see_objects);
-E void NDECL(see_traps);
-E void NDECL(curs_on_u);
-E int NDECL(doredraw);
-E void NDECL(docrt);
-E void NDECL(redraw_map);
-E void FDECL(show_glyph, (int, int, int));
-E void NDECL(clear_glyph_buffer);
-E void FDECL(row_refresh, (int, int, int));
-E void NDECL(cls);
-E void FDECL(flush_screen, (int));
-E int FDECL(back_to_glyph, (XCHAR_P, XCHAR_P));
-E int FDECL(zapdir_to_glyph, (int, int, int));
-E int FDECL(glyph_at, (XCHAR_P, XCHAR_P));
-E void NDECL(reglyph_darkroom);
-E void NDECL(set_wall_state);
-E void FDECL(unset_seenv, (struct rm *, int, int, int, int));
-E int FDECL(warning_of, (struct monst *));
-E void FDECL(map_glyphinfo, (XCHAR_P, XCHAR_P, int, unsigned, glyph_info *));
+extern void magic_map_background(xchar, xchar, int);
+extern void map_background(xchar, xchar, int);
+extern void map_trap(struct trap *, int);
+extern void map_object(struct obj *, int);
+extern void map_invisible(xchar, xchar);
+extern boolean unmap_invisible(int, int);
+extern void unmap_object(int, int);
+extern void map_location(int, int, int);
+extern void feel_newsym(xchar, xchar);
+extern void feel_location(xchar, xchar);
+extern void newsym(int, int);
+extern void newsym_force(int, int);
+extern void shieldeff(xchar, xchar);
+extern void tmp_at(int, int);
+extern void flash_glyph_at(int, int, int, int);
+extern void swallowed(int);
+extern void under_ground(int);
+extern void under_water(int);
+extern void see_monsters(void);
+extern void set_mimic_blocking(void);
+extern void see_objects(void);
+extern void see_traps(void);
+extern void curs_on_u(void);
+extern int doredraw(void);
+extern void docrt(void);
+extern void redraw_map(void);
+extern void show_glyph(int, int, int);
+extern void clear_glyph_buffer(void);
+extern void row_refresh(int, int, int);
+extern void cls(void);
+extern void flush_screen(int);
+extern int back_to_glyph(xchar, xchar);
+extern int zapdir_to_glyph(int, int, int);
+extern int glyph_at(xchar, xchar);
+extern void reglyph_darkroom(void);
+extern void set_wall_state(void);
+extern void unset_seenv(struct rm *, int, int, int, int);
+extern int warning_of(struct monst *);
+extern void map_glyphinfo(xchar, xchar, int, unsigned, glyph_info *);
/* ### do.c ### */
-E int NDECL(dodrop);
-E boolean FDECL(boulder_hits_pool, (struct obj *, int, int, BOOLEAN_P));
-E boolean FDECL(flooreffects, (struct obj *, int, int, const char *));
-E void FDECL(doaltarobj, (struct obj *));
-E boolean FDECL(canletgo, (struct obj *, const char *));
-E void FDECL(dropx, (struct obj *));
-E void FDECL(dropy, (struct obj *));
-E void FDECL(dropz, (struct obj *, BOOLEAN_P));
-E void FDECL(obj_no_longer_held, (struct obj *));
-E int NDECL(doddrop);
-E int NDECL(dodown);
-E int NDECL(doup);
+extern int dodrop(void);
+extern boolean boulder_hits_pool(struct obj *, int, int, boolean);
+extern boolean flooreffects(struct obj *, int, int, const char *);
+extern void doaltarobj(struct obj *);
+extern boolean canletgo(struct obj *, const char *);
+extern void dropx(struct obj *);
+extern void dropy(struct obj *);
+extern void dropz(struct obj *, boolean);
+extern void obj_no_longer_held(struct obj *);
+extern int doddrop(void);
+extern int dodown(void);
+extern int doup(void);
#ifdef INSURANCE
-E void NDECL(save_currentstate);
-#endif
-E void FDECL(u_collide_m, (struct monst *));
-E void FDECL(goto_level, (d_level *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-E void NDECL(maybe_lvltport_feedback);
-E void FDECL(schedule_goto, (d_level *, int,
- const char *, const char *));
-E void NDECL(deferred_goto);
-E boolean FDECL(revive_corpse, (struct obj *));
-E void FDECL(revive_mon, (ANY_P *, long));
-E void FDECL(zombify_mon, (ANY_P *, long));
-E boolean FDECL(cmd_safety_prevention, (const char *, const char *, int *));
-E int NDECL(donull);
-E int NDECL(dowipe);
-E void FDECL(legs_in_no_shape, (const char *, BOOLEAN_P));
-E void FDECL(set_wounded_legs, (long, int));
-E void FDECL(heal_legs, (int));
+extern void save_currentstate(void);
+#endif
+extern void u_collide_m(struct monst *);
+extern void goto_level(d_level *, boolean, boolean, boolean);
+extern void maybe_lvltport_feedback(void);
+extern void schedule_goto(d_level *, int, const char *, const char *);
+extern void deferred_goto(void);
+extern boolean revive_corpse(struct obj *);
+extern void revive_mon(union any *, long);
+extern void zombify_mon(union any *, long);
+extern boolean cmd_safety_prevention(const char *, const char *, int *);
+extern int donull(void);
+extern int dowipe(void);
+extern void legs_in_no_shape(const char *, boolean);
+extern void set_wounded_legs(long, int);
+extern void heal_legs(int);
/* ### do_name.c ### */
-E char *FDECL(dxdy_to_dist_descr, (int, int, BOOLEAN_P));
-E char *FDECL(coord_desc, (int, int, char *, CHAR_P));
-E boolean FDECL(getpos_menu, (coord *, int));
-E int FDECL(getpos, (coord *, BOOLEAN_P, const char *));
-E void FDECL(getpos_sethilite, (void (*f)(int), boolean (*d)(int,int)));
-E void FDECL(new_mgivenname, (struct monst *, int));
-E void FDECL(free_mgivenname, (struct monst *));
-E void FDECL(new_oname, (struct obj *, int));
-E void FDECL(free_oname, (struct obj *));
-E const char *FDECL(safe_oname, (struct obj *));
-E struct monst *FDECL(christen_monst, (struct monst *, const char *));
-E struct obj *FDECL(oname, (struct obj *, const char *));
-E boolean FDECL(objtyp_is_callable, (int));
-E int NDECL(docallcmd);
-E void FDECL(docall, (struct obj *));
-E const char *NDECL(rndghostname);
-E char *FDECL(x_monnam, (struct monst *, int, const char *, int, BOOLEAN_P));
-E char *FDECL(l_monnam, (struct monst *));
-E char *FDECL(mon_nam, (struct monst *));
-E char *FDECL(noit_mon_nam, (struct monst *));
-E char *FDECL(Monnam, (struct monst *));
-E char *FDECL(noit_Monnam, (struct monst *));
-E char *FDECL(noname_monnam, (struct monst *, int));
-E char *FDECL(m_monnam, (struct monst *));
-E char *FDECL(y_monnam, (struct monst *));
-E char *FDECL(Adjmonnam, (struct monst *, const char *));
-E char *FDECL(Amonnam, (struct monst *));
-E char *FDECL(a_monnam, (struct monst *));
-E char *FDECL(distant_monnam, (struct monst *, int, char *));
-E char *FDECL(mon_nam_too, (struct monst *, struct monst *));
-E char *FDECL(monverbself, (struct monst *, char *,
- const char *, const char *));
-E char *FDECL(minimal_monnam, (struct monst *, BOOLEAN_P));
-E char *FDECL(bogusmon, (char *, char *));
-E char *FDECL(rndmonnam, (char *));
-E const char *FDECL(hcolor, (const char *));
-E const char *NDECL(rndcolor);
-E const char *FDECL(hliquid, (const char *));
-E const char *NDECL(roguename);
-E struct obj *FDECL(realloc_obj,
- (struct obj *, int, genericptr_t, int, const char *));
-E char *FDECL(coyotename, (struct monst *, char *));
-E char *FDECL(rndorcname, (char *));
-E struct monst *FDECL(christen_orc, (struct monst *, const char *,
- const char *));
-E const char *FDECL(noveltitle, (int *));
-E const char *FDECL(lookup_novel, (const char *, int *));
+extern char *dxdy_to_dist_descr(int, int, boolean);
+extern char *coord_desc(int, int, char *, char);
+extern boolean getpos_menu(coord *, int);
+extern int getpos(coord *, boolean, const char *);
+extern void getpos_sethilite(void(*f)(int), boolean(*d)(int,int));
+extern void new_mgivenname(struct monst *, int);
+extern void free_mgivenname(struct monst *);
+extern void new_oname(struct obj *, int);
+extern void free_oname(struct obj *);
+extern const char *safe_oname(struct obj *);
+extern struct monst *christen_monst(struct monst *, const char *);
+extern struct obj *oname(struct obj *, const char *);
+extern boolean objtyp_is_callable(int);
+extern int docallcmd(void);
+extern void docall(struct obj *);
+extern const char *rndghostname(void);
+extern char *x_monnam(struct monst *, int, const char *, int, boolean);
+extern char *l_monnam(struct monst *);
+extern char *mon_nam(struct monst *);
+extern char *noit_mon_nam(struct monst *);
+extern char *Monnam(struct monst *);
+extern char *noit_Monnam(struct monst *);
+extern char *noname_monnam(struct monst *, int);
+extern char *m_monnam(struct monst *);
+extern char *y_monnam(struct monst *);
+extern char *Adjmonnam(struct monst *, const char *);
+extern char *Amonnam(struct monst *);
+extern char *a_monnam(struct monst *);
+extern char *distant_monnam(struct monst *, int, char *);
+extern char *mon_nam_too(struct monst *, struct monst *);
+extern char *monverbself(struct monst *, char *, const char *, const char *);
+extern char *minimal_monnam(struct monst *, boolean);
+extern char *bogusmon(char *, char *);
+extern char *rndmonnam(char *);
+extern const char *hcolor(const char *);
+extern const char *rndcolor(void);
+extern const char *hliquid(const char *);
+extern const char *roguename(void);
+extern struct obj *realloc_obj(struct obj *, int, genericptr_t, int,
+ const char *);
+extern char *coyotename(struct monst *, char *);
+extern char *rndorcname(char *);
+extern struct monst *christen_orc(struct monst *, const char *, const char *);
+extern const char *noveltitle(int *);
+extern const char *lookup_novel(const char *, int *);
#ifndef PMNAME_MACROS
-E int FDECL(Mgender, (struct monst *));
-E const char *FDECL(pmname, (struct permonst *, int));
-#endif /* PMNAME_MACROS */
+extern int Mgender(struct monst *);
+extern const char *pmname(struct permonst *, int);
+#endif
/* ### do_wear.c ### */
-E const char *FDECL(fingers_or_gloves, (BOOLEAN_P));
-E void FDECL(off_msg, (struct obj *));
-E void FDECL(toggle_displacement, (struct obj *, long, BOOLEAN_P));
-E void FDECL(set_wear, (struct obj *));
-E boolean FDECL(donning, (struct obj *));
-E boolean FDECL(doffing, (struct obj *));
-E void FDECL(cancel_doff, (struct obj *, long));
-E void NDECL(cancel_don);
-E int FDECL(stop_donning, (struct obj *));
-E int NDECL(Armor_off);
-E int NDECL(Armor_gone);
-E int NDECL(Helmet_off);
-E int NDECL(Gloves_off);
-E int NDECL(Boots_on);
-E int NDECL(Boots_off);
-E int NDECL(Cloak_off);
-E int NDECL(Shield_off);
-E int NDECL(Shirt_off);
-E void NDECL(Amulet_off);
-E void FDECL(Ring_on, (struct obj *));
-E void FDECL(Ring_off, (struct obj *));
-E void FDECL(Ring_gone, (struct obj *));
-E void FDECL(Blindf_on, (struct obj *));
-E void FDECL(Blindf_off, (struct obj *));
-E int NDECL(dotakeoff);
-E int NDECL(doremring);
-E int FDECL(cursed, (struct obj *));
-E int FDECL(armoroff, (struct obj *));
-E int FDECL(canwearobj, (struct obj *, long *, BOOLEAN_P));
-E int NDECL(dowear);
-E int NDECL(doputon);
-E void NDECL(find_ac);
-E void NDECL(glibr);
-E struct obj *FDECL(some_armor, (struct monst *));
-E struct obj *FDECL(stuck_ring, (struct obj *, int));
-E struct obj *NDECL(unchanger);
-E void NDECL(reset_remarm);
-E int NDECL(doddoremarm);
-E int FDECL(destroy_arm, (struct obj *));
-E void FDECL(adj_abon, (struct obj *, SCHAR_P));
-E boolean
-FDECL(inaccessible_equipment, (struct obj *, const char *, BOOLEAN_P));
+extern const char *fingers_or_gloves(boolean);
+extern void off_msg(struct obj *);
+extern void toggle_displacement(struct obj *, long, boolean);
+extern void set_wear(struct obj *);
+extern boolean donning(struct obj *);
+extern boolean doffing(struct obj *);
+extern void cancel_doff(struct obj *, long);
+extern void cancel_don(void);
+extern int stop_donning(struct obj *);
+extern int Armor_off(void);
+extern int Armor_gone(void);
+extern int Helmet_off(void);
+extern int Gloves_off(void);
+extern int Boots_on(void);
+extern int Boots_off(void);
+extern int Cloak_off(void);
+extern int Shield_off(void);
+extern int Shirt_off(void);
+extern void Amulet_off(void);
+extern void Ring_on(struct obj *);
+extern void Ring_off(struct obj *);
+extern void Ring_gone(struct obj *);
+extern void Blindf_on(struct obj *);
+extern void Blindf_off(struct obj *);
+extern int dotakeoff(void);
+extern int doremring(void);
+extern int cursed(struct obj *);
+extern int armoroff(struct obj *);
+extern int canwearobj(struct obj *, long *, boolean);
+extern int dowear(void);
+extern int doputon(void);
+extern void find_ac(void);
+extern void glibr(void);
+extern struct obj *some_armor(struct monst *);
+extern struct obj *stuck_ring(struct obj *, int);
+extern struct obj *unchanger(void);
+extern void reset_remarm(void);
+extern int doddoremarm(void);
+extern int destroy_arm(struct obj *);
+extern void adj_abon(struct obj *, schar);
+extern boolean inaccessible_equipment(struct obj *, const char *, boolean);
/* ### dog.c ### */
-E void FDECL(newedog, (struct monst *));
-E void FDECL(free_edog, (struct monst *));
-E void FDECL(initedog, (struct monst *));
-E struct monst *FDECL(make_familiar,
- (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E struct monst *NDECL(makedog);
-E void NDECL(update_mlstmv);
-E void NDECL(losedogs);
-E void FDECL(mon_arrive, (struct monst *, BOOLEAN_P));
-E void FDECL(mon_catchup_elapsed_time, (struct monst *, long));
-E void FDECL(keepdogs, (BOOLEAN_P));
-E void FDECL(migrate_to_level, (struct monst *, XCHAR_P, XCHAR_P, coord *));
-E int FDECL(dogfood, (struct monst *, struct obj *));
-E boolean FDECL(tamedog, (struct monst *, struct obj *));
-E void FDECL(abuse_dog, (struct monst *));
-E void FDECL(wary_dog, (struct monst *, BOOLEAN_P));
+extern void newedog(struct monst *);
+extern void free_edog(struct monst *);
+extern void initedog(struct monst *);
+extern struct monst *make_familiar(struct obj *, xchar, xchar, boolean);
+extern struct monst *makedog(void);
+extern void update_mlstmv(void);
+extern void losedogs(void);
+extern void mon_arrive(struct monst *, boolean);
+extern void mon_catchup_elapsed_time(struct monst *, long);
+extern void keepdogs(boolean);
+extern void migrate_to_level(struct monst *, xchar, xchar, coord *);
+extern int dogfood(struct monst *, struct obj *);
+extern boolean tamedog(struct monst *, struct obj *);
+extern void abuse_dog(struct monst *);
+extern void wary_dog(struct monst *, boolean);
/* ### dogmove.c ### */
-E boolean FDECL(cursed_object_at, (int, int));
-E struct obj *FDECL(droppables, (struct monst *));
-E int FDECL(dog_nutrition, (struct monst *, struct obj *));
-E int FDECL(dog_eat, (struct monst *, struct obj *, int, int, BOOLEAN_P));
-E int FDECL(dog_move, (struct monst *, int));
-E void FDECL(finish_meating, (struct monst *));
+extern boolean cursed_object_at(int, int);
+extern struct obj *droppables(struct monst *);
+extern int dog_nutrition(struct monst *, struct obj *);
+extern int dog_eat(struct monst *, struct obj *, int, int, boolean);
+extern int dog_move(struct monst *, int);
+extern void finish_meating(struct monst *);
/* ### dokick.c ### */
-E boolean FDECL(ghitm, (struct monst *, struct obj *));
-E void FDECL(container_impact_dmg, (struct obj *, XCHAR_P, XCHAR_P));
-E int NDECL(dokick);
-E boolean FDECL(ship_object, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(obj_delivery, (BOOLEAN_P));
-E void FDECL(deliver_obj_to_mon, (struct monst *mtmp, int, unsigned long));
-E schar FDECL(down_gate, (XCHAR_P, XCHAR_P));
-E void FDECL(impact_drop, (struct obj *, XCHAR_P, XCHAR_P, XCHAR_P));
+extern boolean ghitm(struct monst *, struct obj *);
+extern void container_impact_dmg(struct obj *, xchar, xchar);
+extern int dokick(void);
+extern boolean ship_object(struct obj *, xchar, xchar, boolean);
+extern void obj_delivery(boolean);
+extern void deliver_obj_to_mon(struct monst *mtmp, int, unsigned long);
+extern schar down_gate(xchar, xchar);
+extern void impact_drop(struct obj *, xchar, xchar, xchar);
/* ### dothrow.c ### */
-E int FDECL(multishot_class_bonus, (int, struct obj *, struct obj *));
-E int NDECL(dothrow);
-E int NDECL(dofire);
-E void FDECL(endmultishot, (BOOLEAN_P));
-E void FDECL(hitfloor, (struct obj *, BOOLEAN_P));
-E void FDECL(hurtle, (int, int, int, BOOLEAN_P));
-E void FDECL(mhurtle, (struct monst *, int, int, int));
-E boolean FDECL(throwing_weapon, (struct obj *));
-E void FDECL(throwit, (struct obj *, long, BOOLEAN_P, struct obj *));
-E int FDECL(omon_adj, (struct monst *, struct obj *, BOOLEAN_P));
-E int FDECL(thitmonst, (struct monst *, struct obj *));
-E int FDECL(hero_breaks, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E int FDECL(breaks, (struct obj *, XCHAR_P, XCHAR_P));
-E void FDECL(release_camera_demon, (struct obj *, XCHAR_P, XCHAR_P));
-E void FDECL(breakobj, (struct obj *, XCHAR_P, XCHAR_P, BOOLEAN_P, BOOLEAN_P));
-E boolean FDECL(breaktest, (struct obj *));
-E boolean FDECL(walk_path, (coord *, coord *,
- boolean (*)(genericptr, int, int), genericptr_t));
-E boolean FDECL(hurtle_jump, (genericptr_t, int, int));
-E boolean FDECL(hurtle_step, (genericptr_t, int, int));
+extern int multishot_class_bonus(int, struct obj *, struct obj *);
+extern int dothrow(void);
+extern int dofire(void);
+extern void endmultishot(boolean);
+extern void hitfloor(struct obj *, boolean);
+extern void hurtle(int, int, int, boolean);
+extern void mhurtle(struct monst *, int, int, int);
+extern boolean throwing_weapon(struct obj *);
+extern void throwit(struct obj *, long, boolean, struct obj *);
+extern int omon_adj(struct monst *, struct obj *, boolean);
+extern int thitmonst(struct monst *, struct obj *);
+extern int hero_breaks(struct obj *, xchar, xchar, boolean);
+extern int breaks(struct obj *, xchar, xchar);
+extern void release_camera_demon(struct obj *, xchar, xchar);
+extern void breakobj(struct obj *, xchar, xchar, boolean, boolean);
+extern boolean breaktest(struct obj *);
+extern boolean walk_path(coord *, coord *, boolean(*)(void *, int, int),
+ genericptr_t);
+extern boolean hurtle_jump(genericptr_t, int, int);
+extern boolean hurtle_step(genericptr_t, int, int);
/* ### drawing.c ### */
-E int FDECL(def_char_to_objclass, (CHAR_P));
-E int FDECL(def_char_to_monclass, (CHAR_P));
-E int FDECL(def_char_is_furniture, (CHAR_P));
+extern int def_char_to_objclass(char);
+extern int def_char_to_monclass(char);
+extern int def_char_is_furniture(char);
/* ### dungeon.c ### */
-E void FDECL(save_dungeon, (NHFILE *, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(restore_dungeon, (NHFILE *));
-E void FDECL(insert_branch, (branch *, BOOLEAN_P));
-E void NDECL(init_dungeons);
-E s_level *FDECL(find_level, (const char *));
-E s_level *FDECL(Is_special, (d_level *));
-E branch *FDECL(Is_branchlev, (d_level *));
-E boolean FDECL(builds_up, (d_level *));
-E xchar FDECL(ledger_no, (d_level *));
-E xchar NDECL(maxledgerno);
-E schar FDECL(depth, (d_level *));
-E xchar FDECL(dunlev, (d_level *));
-E xchar FDECL(dunlevs_in_dungeon, (d_level *));
-E xchar FDECL(ledger_to_dnum, (XCHAR_P));
-E xchar FDECL(ledger_to_dlev, (XCHAR_P));
-E xchar FDECL(deepest_lev_reached, (BOOLEAN_P));
-E boolean FDECL(on_level, (d_level *, d_level *));
-E void FDECL(next_level, (BOOLEAN_P));
-E void FDECL(prev_level, (BOOLEAN_P));
-E void FDECL(u_on_newpos, (int, int));
-E void FDECL(u_on_rndspot, (int));
-E void FDECL(stairway_add, (int,int, BOOLEAN_P, BOOLEAN_P, d_level *));
-E void NDECL(stairway_print);
-E void NDECL(stairway_free_all);
-E stairway *FDECL(stairway_at, (int, int));
-E stairway *FDECL(stairway_find, (d_level *));
-E stairway *FDECL(stairway_find_from, (d_level *, BOOLEAN_P));
-E stairway *FDECL(stairway_find_dir, (BOOLEAN_P));
-E stairway *FDECL(stairway_find_type_dir, (BOOLEAN_P, BOOLEAN_P));
-E stairway *FDECL(stairway_find_special_dir, (BOOLEAN_P));
-E void FDECL(u_on_sstairs, (int));
-E void NDECL(u_on_upstairs);
-E void NDECL(u_on_dnstairs);
-E boolean FDECL(On_stairs, (XCHAR_P, XCHAR_P));
-E boolean FDECL(On_ladder, (XCHAR_P, XCHAR_P));
-E boolean FDECL(On_stairs_up, (XCHAR_P, XCHAR_P));
-E boolean FDECL(On_stairs_dn, (XCHAR_P, XCHAR_P));
-E void FDECL(get_level, (d_level *, int));
-E boolean FDECL(Is_botlevel, (d_level *));
-E boolean FDECL(Can_fall_thru, (d_level *));
-E boolean FDECL(Can_dig_down, (d_level *));
-E boolean FDECL(Can_rise_up, (int, int, d_level *));
-E boolean FDECL(has_ceiling, (d_level *));
-E boolean FDECL(In_quest, (d_level *));
-E boolean FDECL(In_mines, (d_level *));
-E branch *FDECL(dungeon_branch, (const char *));
-E boolean FDECL(at_dgn_entrance, (const char *));
-E boolean FDECL(In_hell, (d_level *));
-E boolean FDECL(In_V_tower, (d_level *));
-E boolean FDECL(On_W_tower_level, (d_level *));
-E boolean FDECL(In_W_tower, (int, int, d_level *));
-E void FDECL(find_hell, (d_level *));
-E void FDECL(goto_hell, (BOOLEAN_P, BOOLEAN_P));
-E void FDECL(assign_level, (d_level *, d_level *));
-E void FDECL(assign_rnd_level, (d_level *, d_level *, int));
-E int FDECL(induced_align, (int));
-E boolean FDECL(Invocation_lev, (d_level *));
-E xchar NDECL(level_difficulty);
-E schar FDECL(lev_by_name, (const char *));
-E schar FDECL(print_dungeon, (BOOLEAN_P, schar *, xchar *));
-E char *FDECL(get_annotation, (d_level *));
-E int NDECL(donamelevel);
-E int NDECL(dooverview);
-E void FDECL(show_overview, (int, int));
-E void FDECL(rm_mapseen, (int));
-E void FDECL(init_mapseen, (d_level *));
-E void NDECL(recalc_mapseen);
-E void FDECL(mapseen_temple, (struct monst *));
-E void FDECL(room_discovered, (int));
-E void FDECL(recbranch_mapseen, (d_level *, d_level *));
-E void FDECL(overview_stats, (winid, const char *, long *, long *));
-E void FDECL(remdun_mapseen, (int));
-E const char *FDECL(endgamelevelname, (char *, int));
+extern void save_dungeon(NHFILE *, boolean, boolean);
+extern void restore_dungeon(NHFILE *);
+extern void insert_branch(branch *, boolean);
+extern void init_dungeons(void);
+extern s_level *find_level(const char *);
+extern s_level *Is_special(d_level *);
+extern branch *Is_branchlev(d_level *);
+extern boolean builds_up(d_level *);
+extern xchar ledger_no(d_level *);
+extern xchar maxledgerno(void);
+extern schar depth(d_level *);
+extern xchar dunlev(d_level *);
+extern xchar dunlevs_in_dungeon(d_level *);
+extern xchar ledger_to_dnum(xchar);
+extern xchar ledger_to_dlev(xchar);
+extern xchar deepest_lev_reached(boolean);
+extern boolean on_level(d_level *, d_level *);
+extern void next_level(boolean);
+extern void prev_level(boolean);
+extern void u_on_newpos(int, int);
+extern void u_on_rndspot(int);
+extern void stairway_add(int,int, boolean, boolean, d_level *);
+extern void stairway_print(void);
+extern void stairway_free_all(void);
+extern stairway *stairway_at(int, int);
+extern stairway *stairway_find(d_level *);
+extern stairway *stairway_find_from(d_level *, boolean);
+extern stairway *stairway_find_dir(boolean);
+extern stairway *stairway_find_type_dir(boolean, boolean);
+extern stairway *stairway_find_special_dir(boolean);
+extern void u_on_sstairs(int);
+extern void u_on_upstairs(void);
+extern void u_on_dnstairs(void);
+extern boolean On_stairs(xchar, xchar);
+extern boolean On_ladder(xchar, xchar);
+extern boolean On_stairs_up(xchar, xchar);
+extern boolean On_stairs_dn(xchar, xchar);
+extern void get_level(d_level *, int);
+extern boolean Is_botlevel(d_level *);
+extern boolean Can_fall_thru(d_level *);
+extern boolean Can_dig_down(d_level *);
+extern boolean Can_rise_up(int, int, d_level *);
+extern boolean has_ceiling(d_level *);
+extern boolean In_quest(d_level *);
+extern boolean In_mines(d_level *);
+extern branch *dungeon_branch(const char *);
+extern boolean at_dgn_entrance(const char *);
+extern boolean In_hell(d_level *);
+extern boolean In_V_tower(d_level *);
+extern boolean On_W_tower_level(d_level *);
+extern boolean In_W_tower(int, int, d_level *);
+extern void find_hell(d_level *);
+extern void goto_hell(boolean, boolean);
+extern void assign_level(d_level *, d_level *);
+extern void assign_rnd_level(d_level *, d_level *, int);
+extern int induced_align(int);
+extern boolean Invocation_lev(d_level *);
+extern xchar level_difficulty(void);
+extern schar lev_by_name(const char *);
+extern schar print_dungeon(boolean, schar *, xchar *);
+extern char *get_annotation(d_level *);
+extern int donamelevel(void);
+extern int dooverview(void);
+extern void show_overview(int, int);
+extern void rm_mapseen(int);
+extern void init_mapseen(d_level *);
+extern void recalc_mapseen(void);
+extern void mapseen_temple(struct monst *);
+extern void room_discovered(int);
+extern void recbranch_mapseen(d_level *, d_level *);
+extern void overview_stats(winid, const char *, long *, long *);
+extern void remdun_mapseen(int);
+extern const char *endgamelevelname(char *, int);
/* ### eat.c ### */
-E void NDECL(eatmupdate);
-E boolean FDECL(is_edible, (struct obj *));
-E void NDECL(init_uhunger);
-E int NDECL(Hear_again);
-E void NDECL(reset_eat);
-E int NDECL(doeat);
-E int FDECL(use_tin_opener, (struct obj *));
-E void NDECL(gethungry);
-E void FDECL(morehungry, (int));
-E void FDECL(lesshungry, (int));
-E boolean NDECL(is_fainted);
-E void NDECL(reset_faint);
-E void NDECL(violated_vegetarian);
-E void FDECL(newuhs, (BOOLEAN_P));
-E struct obj *FDECL(floorfood, (const char *, int));
-E void NDECL(vomit);
-E int FDECL(eaten_stat, (int, struct obj *));
-E void FDECL(food_disappears, (struct obj *));
-E void FDECL(food_substitution, (struct obj *, struct obj *));
-E void FDECL(eating_conducts, (struct permonst *));
-E int FDECL(eat_brains, (struct monst *, struct monst *, BOOLEAN_P, int *));
-E void NDECL(fix_petrification);
-E void FDECL(consume_oeaten, (struct obj *, int));
-E boolean FDECL(maybe_finished_meal, (BOOLEAN_P));
-E void FDECL(set_tin_variety, (struct obj *, int));
-E int FDECL(tin_variety_txt, (char *, int *));
-E void FDECL(tin_details, (struct obj *, int, char *));
-E boolean FDECL(Popeye, (int));
+extern void eatmupdate(void);
+extern boolean is_edible(struct obj *);
+extern void init_uhunger(void);
+extern int Hear_again(void);
+extern void reset_eat(void);
+extern int doeat(void);
+extern int use_tin_opener(struct obj *);
+extern void gethungry(void);
+extern void morehungry(int);
+extern void lesshungry(int);
+extern boolean is_fainted(void);
+extern void reset_faint(void);
+extern void violated_vegetarian(void);
+extern void newuhs(boolean);
+extern struct obj *floorfood(const char *, int);
+extern void vomit(void);
+extern int eaten_stat(int, struct obj *);
+extern void food_disappears(struct obj *);
+extern void food_substitution(struct obj *, struct obj *);
+extern void eating_conducts(struct permonst *);
+extern int eat_brains(struct monst *, struct monst *, boolean, int *);
+extern void fix_petrification(void);
+extern void consume_oeaten(struct obj *, int);
+extern boolean maybe_finished_meal(boolean);
+extern void set_tin_variety(struct obj *, int);
+extern int tin_variety_txt(char *, int *);
+extern void tin_details(struct obj *, int, char *);
+extern boolean Popeye(int);
/* ### end.c ### */
-E void FDECL(done1, (int));
-E int NDECL(done2);
-E void FDECL(done_in_by, (struct monst *, int));
+extern void done1(int);
+extern int done2(void);
+extern void done_in_by(struct monst *, int);
#endif /* !MAKEDEFS_C && MDLIB_C */
-E void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2) NORETURN;
+extern void panic(const char *, ...) NORETURN;
#if !defined(MAKEDEFS_C) && !defined(MDLIB_C)
-E void FDECL(done, (int));
-E void FDECL(container_contents, (struct obj *, BOOLEAN_P,
- BOOLEAN_P, BOOLEAN_P));
-E void FDECL(nh_terminate, (int)) NORETURN;
-E void FDECL(delayed_killer, (int, int, const char *));
-E struct kinfo *FDECL(find_delayed_killer, (int));
-E void FDECL(dealloc_killer, (struct kinfo *));
-E void FDECL(save_killers, (NHFILE *));
-E void FDECL(restore_killers, (NHFILE *));
-E char *FDECL(build_english_list, (char *));
+extern void done(int);
+extern void container_contents(struct obj *, boolean, boolean, boolean);
+extern void nh_terminate(int) NORETURN;
+extern void delayed_killer(int, int, const char *);
+extern struct kinfo *find_delayed_killer(int);
+extern void dealloc_killer(struct kinfo *);
+extern void save_killers(NHFILE *);
+extern void restore_killers(NHFILE *);
+extern char *build_english_list(char *);
#if defined(PANICTRACE) && !defined(NO_SIGNAL)
-E void FDECL(panictrace_setsignals, (BOOLEAN_P));
+extern void panictrace_setsignals(boolean);
#endif
/* ### engrave.c ### */
-E char *FDECL(random_engraving, (char *));
-E void FDECL(wipeout_text, (char *, int, unsigned));
-E boolean FDECL(can_reach_floor, (BOOLEAN_P));
-E void FDECL(cant_reach_floor, (int, int, BOOLEAN_P, BOOLEAN_P));
-E const char *FDECL(surface, (int, int));
-E const char *FDECL(ceiling, (int, int));
-E struct engr *FDECL(engr_at, (XCHAR_P, XCHAR_P));
-E int FDECL(sengr_at, (const char *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(u_wipe_engr, (int));
-E void FDECL(wipe_engr_at, (XCHAR_P, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(read_engr_at, (int, int));
-E void FDECL(make_engr_at, (int, int, const char *, long, XCHAR_P));
-E void FDECL(del_engr_at, (int, int));
-E int NDECL(freehand);
-E int NDECL(doengrave);
-E void NDECL(sanitize_engravings);
-E void FDECL(save_engravings, (NHFILE *));
-E void FDECL(rest_engravings, (NHFILE *));
-E void FDECL(engr_stats, (const char *, char *, long *, long *));
-E void FDECL(del_engr, (struct engr *));
-E void FDECL(rloc_engr, (struct engr *));
-E void FDECL(make_grave, (int, int, const char *));
+extern char *random_engraving(char *);
+extern void wipeout_text(char *, int, unsigned);
+extern boolean can_reach_floor(boolean);
+extern void cant_reach_floor(int, int, boolean, boolean);
+extern const char *surface(int, int);
+extern const char *ceiling(int, int);
+extern struct engr *engr_at(xchar, xchar);
+extern int sengr_at(const char *, xchar, xchar, boolean);
+extern void u_wipe_engr(int);
+extern void wipe_engr_at(xchar, xchar, xchar, boolean);
+extern void read_engr_at(int, int);
+extern void make_engr_at(int, int, const char *, long, xchar);
+extern void del_engr_at(int, int);
+extern int freehand(void);
+extern int doengrave(void);
+extern void sanitize_engravings(void);
+extern void save_engravings(NHFILE *);
+extern void rest_engravings(NHFILE *);
+extern void engr_stats(const char *, char *, long *, long *);
+extern void del_engr(struct engr *);
+extern void rloc_engr(struct engr *);
+extern void make_grave(int, int, const char *);
/* ### exper.c ### */
-E long FDECL(newuexp, (int));
-E int NDECL(newpw);
-E int FDECL(experience, (struct monst *, int));
-E void FDECL(more_experienced, (int, int));
-E void FDECL(losexp, (const char *));
-E void NDECL(newexplevel);
-E void FDECL(pluslvl, (BOOLEAN_P));
-E long FDECL(rndexp, (BOOLEAN_P));
+extern long newuexp(int);
+extern int newpw(void);
+extern int experience(struct monst *, int);
+extern void more_experienced(int, int);
+extern void losexp(const char *);
+extern void newexplevel(void);
+extern void pluslvl(boolean);
+extern long rndexp(boolean);
/* ### explode.c ### */
-E void FDECL(explode, (int, int, int, int, CHAR_P, int));
-E long FDECL(scatter, (int, int, int, unsigned int, struct obj *));
-E void FDECL(splatter_burning_oil, (int, int, BOOLEAN_P));
-E void FDECL(explode_oil, (struct obj *, int, int));
+extern void explode(int, int, int, int, char, int);
+extern long scatter(int, int, int, unsigned int, struct obj *);
+extern void splatter_burning_oil(int, int, boolean);
+extern void explode_oil(struct obj *, int, int);
/* ### extralev.c ### */
-E void NDECL(makeroguerooms);
-E void FDECL(corr, (int, int));
-E void NDECL(makerogueghost);
+extern void makeroguerooms(void);
+extern void corr(int, int);
+extern void makerogueghost(void);
/* ### files.c ### */
-E char *FDECL(fname_encode, (const char *, CHAR_P, char *, char *, int));
-E char *FDECL(fname_decode, (CHAR_P, char *, char *, int));
-E const char *FDECL(fqname, (const char *, int, int));
-E FILE *FDECL(fopen_datafile, (const char *, const char *, int));
-E void FDECL(zero_nhfile, (NHFILE *));
-E void FDECL(close_nhfile, (NHFILE *));
-E void FDECL(rewind_nhfile, (NHFILE *));
-E void FDECL(set_levelfile_name, (char *, int));
-E NHFILE *FDECL(create_levelfile, (int, char *));
-E NHFILE *FDECL(open_levelfile, (int, char *));
-E void FDECL(delete_levelfile, (int));
-E void NDECL(clearlocks);
-E NHFILE *FDECL(create_bonesfile, (d_level *, char **, char *));
-E void FDECL(commit_bonesfile, (d_level *));
-E NHFILE *FDECL(open_bonesfile, (d_level *, char **));
-E int FDECL(delete_bonesfile, (d_level *));
-E void NDECL(compress_bonesfile);
-E void FDECL(set_savefile_name, (BOOLEAN_P));
+extern char *fname_encode(const char *, char, char *, char *, int);
+extern char *fname_decode(char, char *, char *, int);
+extern const char *fqname(const char *, int, int);
+extern FILE *fopen_datafile(const char *, const char *, int);
+extern void zero_nhfile(NHFILE *);
+extern void close_nhfile(NHFILE *);
+extern void rewind_nhfile(NHFILE *);
+extern void set_levelfile_name(char *, int);
+extern NHFILE *create_levelfile(int, char *);
+extern NHFILE *open_levelfile(int, char *);
+extern void delete_levelfile(int);
+extern void clearlocks(void);
+extern NHFILE *create_bonesfile(d_level *, char **, char *);
+extern void commit_bonesfile(d_level *);
+extern NHFILE *open_bonesfile(d_level *, char **);
+extern int delete_bonesfile(d_level *);
+extern void compress_bonesfile(void);
+extern void set_savefile_name(boolean);
#ifdef INSURANCE
-E void FDECL(save_savefile_name, (NHFILE *));
+extern void save_savefile_name(NHFILE *);
#endif
#ifndef MICRO
-E void NDECL(set_error_savefile);
-#endif
-E NHFILE *NDECL(create_savefile);
-E NHFILE *NDECL(open_savefile);
-E int NDECL(delete_savefile);
-E NHFILE *NDECL(restore_saved_game);
-E void FDECL(nh_compress, (const char *));
-E void FDECL(nh_uncompress, (const char *));
-E boolean FDECL(lock_file, (const char *, int, int));
-E void FDECL(unlock_file, (const char *));
+extern void set_error_savefile(void);
+#endif
+extern NHFILE *create_savefile(void);
+extern NHFILE *open_savefile(void);
+extern int delete_savefile(void);
+extern NHFILE *restore_saved_game(void);
+extern void nh_compress(const char *);
+extern void nh_uncompress(const char *);
+extern boolean lock_file(const char *, int, int);
+extern void unlock_file(const char *);
#ifdef USER_SOUNDS
-E boolean FDECL(can_read_file, (const char *));
-#endif
-E void FDECL(config_error_init, (BOOLEAN_P, const char *, BOOLEAN_P));
-E void FDECL(config_erradd, (const char *));
-E int NDECL(config_error_done);
-E boolean FDECL(read_config_file, (const char *, int));
-E void FDECL(check_recordfile, (const char *));
-E void NDECL(read_wizkit);
-E int FDECL(read_sym_file, (int));
-E int FDECL(parse_sym_line, (char *, int));
-E void FDECL(paniclog, (const char *, const char *));
-E void FDECL(testinglog, (const char *, const char *, const char *));
-E int FDECL(validate_prefix_locations, (char *));
+extern boolean can_read_file(const char *);
+#endif
+extern void config_error_init(boolean, const char *, boolean);
+extern void config_erradd(const char *);
+extern int config_error_done(void);
+extern boolean read_config_file(const char *, int);
+extern void check_recordfile(const char *);
+extern void read_wizkit(void);
+extern int read_sym_file(int);
+extern int parse_sym_line(char *, int);
+extern void paniclog(const char *, const char *);
+extern void testinglog(const char *, const char *, const char *);
+extern int validate_prefix_locations(char *);
#ifdef SELECTSAVED
-E char *FDECL(plname_from_file, (const char *));
+extern char *plname_from_file(const char *);
#endif
-E char **NDECL(get_saved_games);
-E void FDECL(free_saved_games, (char **));
+extern char **get_saved_games(void);
+extern void free_saved_games(char **);
#ifdef SELF_RECOVER
-E boolean NDECL(recover_savefile);
+extern boolean recover_savefile(void);
+extern void assure_syscf_file(void);
#endif
#ifdef SYSCF_FILE
-E void NDECL(assure_syscf_file);
+extern void assure_syscf_file(void);
#endif
-E int FDECL(nhclose, (int));
+extern int nhclose(int);
#ifdef DEBUG
-E boolean FDECL(debugcore, (const char *, BOOLEAN_P));
+extern boolean debugcore(const char *, boolean);
#endif
-E void NDECL(reveal_paths);
-E boolean FDECL(read_tribute, (const char *, const char *, int,
- char *, int, unsigned));
-E boolean FDECL(Death_quote, (char *, int));
+extern void reveal_paths(void);
+extern boolean read_tribute(const char *, const char *, int, char *, int,
+ unsigned);
+extern boolean Death_quote(char *, int);
/* ### fountain.c ### */
-E void FDECL(floating_above, (const char *));
-E void FDECL(dogushforth, (int));
-E void FDECL(dryup, (XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void NDECL(drinkfountain);
-E void FDECL(dipfountain, (struct obj *));
-E void FDECL(breaksink, (int, int));
-E void NDECL(drinksink);
+extern void floating_above(const char *);
+extern void dogushforth(int);
+extern void dryup(xchar, xchar, boolean);
+extern void drinkfountain(void);
+extern void dipfountain(struct obj *);
+extern void breaksink(int, int);
+extern void drinksink(void);
/* ### hack.c ### */
-E boolean FDECL(is_valid_travelpt, (int,int));
-E anything *FDECL(uint_to_any, (unsigned));
-E anything *FDECL(long_to_any, (long));
-E anything *FDECL(monst_to_any, (struct monst *));
-E anything *FDECL(obj_to_any, (struct obj *));
-E boolean FDECL(revive_nasty, (int, int, const char *));
-E int FDECL(still_chewing, (XCHAR_P, XCHAR_P));
-E void FDECL(movobj, (struct obj *, XCHAR_P, XCHAR_P));
-E boolean FDECL(may_dig, (XCHAR_P, XCHAR_P));
-E boolean FDECL(may_passwall, (XCHAR_P, XCHAR_P));
-E boolean FDECL(bad_rock, (struct permonst *, XCHAR_P, XCHAR_P));
-E int FDECL(cant_squeeze_thru, (struct monst *));
-E boolean FDECL(invocation_pos, (XCHAR_P, XCHAR_P));
-E boolean FDECL(test_move, (int, int, int, int, int));
+extern boolean is_valid_travelpt(int,int);
+extern anything *uint_to_any(unsigned);
+extern anything *long_to_any(long);
+extern anything *monst_to_any(struct monst *);
+extern anything *obj_to_any(struct obj *);
+extern boolean revive_nasty(int, int, const char *);
+extern int still_chewing(xchar, xchar);
+extern void movobj(struct obj *, xchar, xchar);
+extern boolean may_dig(xchar, xchar);
+extern boolean may_passwall(xchar, xchar);
+extern boolean bad_rock(struct permonst *, xchar, xchar);
+extern int cant_squeeze_thru(struct monst *);
+extern boolean invocation_pos(xchar, xchar);
+extern boolean test_move(int, int, int, int, int);
#ifdef DEBUG
-E int NDECL(wiz_debug_cmd_traveldisplay);
-#endif
-E boolean NDECL(u_rooted);
-E void NDECL(domove);
-E void NDECL(overexert_hp);
-E boolean NDECL(overexertion);
-E void NDECL(invocation_message);
-E void NDECL(switch_terrain);
-E void FDECL(set_uinwater, (int));
-E boolean FDECL(pooleffects, (BOOLEAN_P));
-E void FDECL(spoteffects, (BOOLEAN_P));
-E char *FDECL(in_rooms, (XCHAR_P, XCHAR_P, int));
-E boolean FDECL(in_town, (int, int));
-E void FDECL(check_special_room, (BOOLEAN_P));
-E int NDECL(dopickup);
-E void NDECL(lookaround);
-E boolean FDECL(crawl_destination, (int, int));
-E int NDECL(monster_nearby);
-E void FDECL(end_running, (BOOLEAN_P));
-E void FDECL(nomul, (int));
-E void FDECL(unmul, (const char *));
-E void FDECL(losehp, (int, const char *, BOOLEAN_P));
-E int NDECL(weight_cap);
-E int NDECL(inv_weight);
-E int NDECL(near_capacity);
-E int FDECL(calc_capacity, (int));
-E int NDECL(max_capacity);
-E boolean FDECL(check_capacity, (const char *));
-E int FDECL(inv_cnt, (BOOLEAN_P));
-E long FDECL(money_cnt, (struct obj *));
+extern int wiz_debug_cmd_traveldisplay(void);
+#endif
+extern boolean u_rooted(void);
+extern void domove(void);
+extern void overexert_hp(void);
+extern boolean overexertion(void);
+extern void invocation_message(void);
+extern void switch_terrain(void);
+extern void set_uinwater(int);
+extern boolean pooleffects(boolean);
+extern void spoteffects(boolean);
+extern char *in_rooms(xchar, xchar, int);
+extern boolean in_town(int, int);
+extern void check_special_room(boolean);
+extern int dopickup(void);
+extern void lookaround(void);
+extern boolean crawl_destination(int, int);
+extern int monster_nearby(void);
+extern void end_running(boolean);
+extern void nomul(int);
+extern void unmul(const char *);
+extern void losehp(int, const char *, boolean);
+extern int weight_cap(void);
+extern int inv_weight(void);
+extern int near_capacity(void);
+extern int calc_capacity(int);
+extern int max_capacity(void);
+extern boolean check_capacity(const char *);
+extern int inv_cnt(boolean);
+extern long money_cnt(struct obj *);
/* ### hacklib.c ### */
-E boolean FDECL(digit, (CHAR_P));
-E boolean FDECL(letter, (CHAR_P));
-E char FDECL(highc, (CHAR_P));
-E char FDECL(lowc, (CHAR_P));
-E char *FDECL(lcase, (char *));
-E char *FDECL(ucase, (char *));
-E char *FDECL(upstart, (char *));
-E char *FDECL(mungspaces, (char *));
-E char *FDECL(trimspaces, (char *));
-E char *FDECL(strip_newline, (char *));
-E char *FDECL(stripchars, (char *, const char *, const char *));
-E char *FDECL(stripdigits, (char *));
-E char *FDECL(eos, (char *));
-E boolean FDECL(str_end_is, (const char *, const char *));
-E int FDECL(str_lines_maxlen, (const char *));
-E char *FDECL(strkitten, (char *, CHAR_P));
-E void FDECL(copynchars, (char *, const char *, int));
-E char FDECL(chrcasecpy, (int, int));
-E char *FDECL(strcasecpy, (char *, const char *));
-E char *FDECL(s_suffix, (const char *));
-E char *FDECL(ing_suffix, (const char *));
-E char *FDECL(xcrypt, (const char *, char *));
-E boolean FDECL(onlyspace, (const char *));
-E char *FDECL(tabexpand, (char *));
-E char *FDECL(visctrl, (CHAR_P));
-E char *FDECL(strsubst, (char *, const char *, const char *));
-E int FDECL(strNsubst, (char *, const char *, const char *, int));
-E const char *FDECL(ordin, (int));
-E char *FDECL(sitoa, (int));
-E int FDECL(sgn, (int));
-E int FDECL(rounddiv, (long, int));
-E int FDECL(dist2, (int, int, int, int));
-E int FDECL(isqrt, (int));
-E int FDECL(distmin, (int, int, int, int));
-E boolean FDECL(online2, (int, int, int, int));
-E boolean FDECL(pmatch, (const char *, const char *));
-E boolean FDECL(pmatchi, (const char *, const char *));
-E boolean FDECL(pmatchz, (const char *, const char *));
+extern boolean digit(char);
+extern boolean letter(char);
+extern char highc(char);
+extern char lowc(char);
+extern char *lcase(char *);
+extern char *ucase(char *);
+extern char *upstart(char *);
+extern char *mungspaces(char *);
+extern char *trimspaces(char *);
+extern char *strip_newline(char *);
+extern char *stripchars(char *, const char *, const char *);
+extern char *stripdigits(char *);
+extern char *eos(char *);
+extern boolean str_end_is(const char *, const char *);
+extern int str_lines_maxlen(const char *);
+extern char *strkitten(char *, char);
+extern void copynchars(char *, const char *, int);
+extern char chrcasecpy(int, int);
+extern char *strcasecpy(char *, const char *);
+extern char *s_suffix(const char *);
+extern char *ing_suffix(const char *);
+extern char *xcrypt(const char *, char *);
+extern boolean onlyspace(const char *);
+extern char *tabexpand(char *);
+extern char *visctrl(char);
+extern char *strsubst(char *, const char *, const char *);
+extern int strNsubst(char *, const char *, const char *, int);
+extern const char *ordin(int);
+extern char *sitoa(int);
+extern int sgn(int);
+extern int rounddiv(long, int);
+extern int dist2(int, int, int, int);
+extern int isqrt(int);
+extern int distmin(int, int, int, int);
+extern boolean online2(int, int, int, int);
+extern boolean pmatch(const char *, const char *);
+extern boolean pmatchi(const char *, const char *);
+extern boolean pmatchz(const char *, const char *);
#ifndef STRNCMPI
-E int FDECL(strncmpi, (const char *, const char *, int));
+extern int strncmpi(const char *, const char *, int);
#endif
#ifndef STRSTRI
-E char *FDECL(strstri, (const char *, const char *));
-#endif
-E boolean
-FDECL(fuzzymatch, (const char *, const char *, const char *, BOOLEAN_P));
-E void FDECL(init_random, (int FDECL((*fn), (int))));
-E void FDECL(reseed_random, (int FDECL((*fn), (int))));
-E time_t NDECL(getnow);
-E int NDECL(getyear);
+extern char *strstri(const char *, const char *);
+#endif
+extern boolean fuzzymatch(const char *, const char *, const char *, boolean);
+extern void init_random(int(*fn)(int));
+extern void reseed_random(int(*fn)(int));
+extern time_t getnow(void);
+extern int getyear(void);
#if 0
-E char *FDECL(yymmdd, (time_t));
-#endif
-E long FDECL(yyyymmdd, (time_t));
-E long FDECL(hhmmss, (time_t));
-E char *FDECL(yyyymmddhhmmss, (time_t));
-E time_t FDECL(time_from_yyyymmddhhmmss, (char *));
-E int NDECL(phase_of_the_moon);
-E boolean NDECL(friday_13th);
-E int NDECL(night);
-E int NDECL(midnight);
-E void FDECL(strbuf_init, (strbuf_t *));
-E void FDECL(strbuf_append, (strbuf_t *, const char *));
-E void FDECL(strbuf_reserve, (strbuf_t *, int));
-E void FDECL(strbuf_empty, (strbuf_t *));
-E void FDECL(strbuf_nl_to_crlf, (strbuf_t *));
-E char *FDECL(nonconst, (const char *, char *));
-E int FDECL(swapbits, (int, int, int));
-E void FDECL(shuffle_int_array, (int *, int));
+extern char *yymmdd(time_t);
+#endif
+extern long yyyymmdd(time_t);
+extern long hhmmss(time_t);
+extern char *yyyymmddhhmmss(time_t);
+extern time_t time_from_yyyymmddhhmmss(char *);
+extern int phase_of_the_moon(void);
+extern boolean friday_13th(void);
+extern int night(void);
+extern int midnight(void);
+extern void strbuf_init(strbuf_t *);
+extern void strbuf_append(strbuf_t *, const char *);
+extern void strbuf_reserve(strbuf_t *, int);
+extern void strbuf_empty(strbuf_t *);
+extern void strbuf_nl_to_crlf(strbuf_t *);
+extern char *nonconst(const char *, char *);
+extern int swapbits(int, int, int);
+extern void shuffle_int_array(int *, int);
/* note: the snprintf CPP wrapper includes the "fmt" argument in "..."
(__VA_ARGS__) to allow for zero arguments after fmt */
#define Snprintf(str, size, ...) \
/* ### insight.c ### */
-E int NDECL(doattributes);
-E void FDECL(enlightenment, (int, int));
-E void FDECL(youhiding, (BOOLEAN_P, int));
-E char *FDECL(trap_predicament, (char *, int, BOOLEAN_P));
-E int NDECL(doconduct);
-E void FDECL(show_conduct, (int));
-E void FDECL(record_achievement, (SCHAR_P));
-E boolean FDECL(remove_achievement, (SCHAR_P));
-E int NDECL(count_achievements);
-E schar FDECL(achieve_rank, (int));
-E boolean NDECL(sokoban_in_play);
-E int NDECL(dovanquished);
-E int NDECL(doborn);
-E void FDECL(list_vanquished, (CHAR_P, BOOLEAN_P));
-E int NDECL(num_genocides);
-E void FDECL(list_genocided, (CHAR_P, BOOLEAN_P));
-E const char *FDECL(align_str, (ALIGNTYP_P));
-E char *FDECL(piousness, (BOOLEAN_P, const char *));
-E void FDECL(mstatusline, (struct monst *));
-E void NDECL(ustatusline);
+extern int doattributes(void);
+extern void enlightenment(int, int);
+extern void youhiding(boolean, int);
+extern char *trap_predicament(char *, int, boolean);
+extern int doconduct(void);
+extern void show_conduct(int);
+extern void record_achievement(schar);
+extern boolean remove_achievement(schar);
+extern int count_achievements(void);
+extern schar achieve_rank(int);
+extern boolean sokoban_in_play(void);
+extern int dovanquished(void);
+extern int doborn(void);
+extern void list_vanquished(char, boolean);
+extern int num_genocides(void);
+extern void list_genocided(char, boolean);
+extern const char *align_str(aligntyp);
+extern char *piousness(boolean, const char *);
+extern void mstatusline(struct monst *);
+extern void ustatusline(void);
/* ### invent.c ### */
-E void FDECL(loot_classify, (Loot *, struct obj *));
-E Loot *FDECL(sortloot, (struct obj **, unsigned, BOOLEAN_P,
- boolean (*)(OBJ_P)));
-E void FDECL(unsortloot, (Loot **));
-E void FDECL(assigninvlet, (struct obj *));
-E struct obj *FDECL(merge_choice, (struct obj *, struct obj *));
-E int FDECL(merged, (struct obj **, struct obj **));
-E void FDECL(addinv_core1, (struct obj *));
-E void FDECL(addinv_core2, (struct obj *));
-E struct obj *FDECL(addinv, (struct obj *));
-E struct obj *FDECL(addinv_before, (struct obj *, struct obj *));
-E struct obj *FDECL(hold_another_object, (struct obj *, const char *,
- const char *, const char *));
-E void FDECL(useupall, (struct obj *));
-E void FDECL(useup, (struct obj *));
-E void FDECL(consume_obj_charge, (struct obj *, BOOLEAN_P));
-E void FDECL(freeinv_core, (struct obj *));
-E void FDECL(freeinv, (struct obj *));
-E void FDECL(delallobj, (int, int));
-E void FDECL(delobj, (struct obj *));
-E struct obj *FDECL(sobj_at, (int, int, int));
-E struct obj *FDECL(nxtobj, (struct obj *, int, BOOLEAN_P));
-E struct obj *FDECL(carrying, (int));
-E boolean NDECL(have_lizard);
-E struct obj *NDECL(u_carried_gloves);
-E struct obj *NDECL(u_have_novel);
-E struct obj *FDECL(o_on, (unsigned int, struct obj *));
-E boolean FDECL(obj_here, (struct obj *, int, int));
-E boolean NDECL(wearing_armor);
-E boolean FDECL(is_worn, (struct obj *));
-E struct obj *FDECL(g_at, (int, int));
-E boolean FDECL(splittable, (struct obj *));
-E int FDECL(any_obj_ok, (struct obj *));
-E struct obj *FDECL(getobj, (const char *, int (*)(OBJ_P), unsigned int));
-E int FDECL(ggetobj, (const char *, int (*)(OBJ_P), int,
- BOOLEAN_P, unsigned *));
-E int FDECL(askchain, (struct obj **, const char *, int, int (*)(OBJ_P),
- int (*)(OBJ_P), int, const char *));
-E void FDECL(set_cknown_lknown, (struct obj *));
-E void FDECL(fully_identify_obj, (struct obj *));
-E int FDECL(identify, (struct obj *));
-E int FDECL(count_unidentified, (struct obj *));
-E void FDECL(identify_pack, (int, BOOLEAN_P));
-E void NDECL(learn_unseen_invent);
-E void NDECL(update_inventory);
-E void FDECL(prinv, (const char *, struct obj *, long));
-E char *FDECL(xprname,
- (struct obj *, const char *, CHAR_P, BOOLEAN_P, long, long));
-E int NDECL(ddoinv);
-E char FDECL(display_inventory, (const char *, BOOLEAN_P));
-E int FDECL(display_binventory, (int, int, BOOLEAN_P));
-E struct obj *FDECL(display_cinventory, (struct obj *));
-E struct obj *FDECL(display_minventory, (struct monst *, int, char *));
-E int NDECL(dotypeinv);
-E const char *FDECL(dfeature_at, (int, int, char *));
-E int FDECL(look_here, (int, unsigned));
-E int NDECL(dolook);
-E boolean FDECL(will_feel_cockatrice, (struct obj *, BOOLEAN_P));
-E void FDECL(feel_cockatrice, (struct obj *, BOOLEAN_P));
-E void FDECL(stackobj, (struct obj *));
-E boolean FDECL(mergable, (struct obj *, struct obj *));
-E int NDECL(doprgold);
-E int NDECL(doprwep);
-E int NDECL(doprarm);
-E int NDECL(doprring);
-E int NDECL(dopramulet);
-E int NDECL(doprtool);
-E int NDECL(doprinuse);
-E void FDECL(useupf, (struct obj *, long));
-E char *FDECL(let_to_name, (CHAR_P, BOOLEAN_P, BOOLEAN_P));
-E void NDECL(free_invbuf);
-E void NDECL(reassign);
-E int NDECL(doorganize);
-E void NDECL(free_pickinv_cache);
-E int FDECL(count_unpaid, (struct obj *));
-E int FDECL(count_buc, (struct obj *, int, boolean (*)(OBJ_P)));
-E void FDECL(tally_BUCX, (struct obj *, BOOLEAN_P,
- int *, int *, int *, int *, int *));
-E long FDECL(count_contents, (struct obj *,
- BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(carry_obj_effects, (struct obj *));
-E const char *FDECL(currency, (long));
-E void FDECL(silly_thing, (const char *, struct obj *));
+extern void loot_classify(Loot *, struct obj *);
+extern Loot *sortloot(struct obj **, unsigned, boolean,
+ boolean(*)(struct obj *));
+extern void unsortloot(Loot **);
+extern void assigninvlet(struct obj *);
+extern struct obj *merge_choice(struct obj *, struct obj *);
+extern int merged(struct obj **, struct obj **);
+extern void addinv_core1(struct obj *);
+extern void addinv_core2(struct obj *);
+extern struct obj *addinv(struct obj *);
+extern struct obj *addinv_before(struct obj *, struct obj *);
+extern struct obj *hold_another_object(struct obj *, const char *,
+ const char *, const char *);
+extern void useupall(struct obj *);
+extern void useup(struct obj *);
+extern void consume_obj_charge(struct obj *, boolean);
+extern void freeinv_core(struct obj *);
+extern void freeinv(struct obj *);
+extern void delallobj(int, int);
+extern void delobj(struct obj *);
+extern struct obj *sobj_at(int, int, int);
+extern struct obj *nxtobj(struct obj *, int, boolean);
+extern struct obj *carrying(int);
+extern boolean have_lizard(void);
+extern struct obj *u_carried_gloves(void);
+extern struct obj *u_have_novel(void);
+extern struct obj *o_on(unsigned int, struct obj *);
+extern boolean obj_here(struct obj *, int, int);
+extern boolean wearing_armor(void);
+extern boolean is_worn(struct obj *);
+extern struct obj *g_at(int, int);
+extern boolean splittable(struct obj *);
+extern int any_obj_ok(struct obj *);
+extern struct obj *getobj(const char *, int(*)(struct obj *), unsigned int);
+extern int ggetobj(const char *, int(*)(struct obj *), int, boolean,
+ unsigned *);
+extern int askchain(struct obj **, const char *, int, int(*)(struct obj *),
+ int(*)(struct obj *), int, const char *);
+extern void set_cknown_lknown(struct obj *);
+extern void fully_identify_obj(struct obj *);
+extern int identify(struct obj *);
+extern int count_unidentified(struct obj *);
+extern void identify_pack(int, boolean);
+extern void learn_unseen_invent(void);
+extern void update_inventory(void);
+extern void prinv(const char *, struct obj *, long);
+extern char *xprname(struct obj *, const char *, char, boolean, long, long);
+extern int ddoinv(void);
+extern char display_inventory(const char *, boolean);
+extern int display_binventory(int, int, boolean);
+extern struct obj *display_cinventory(struct obj *);
+extern struct obj *display_minventory(struct monst *, int, char *);
+extern int dotypeinv(void);
+extern const char *dfeature_at(int, int, char *);
+extern int look_here(int, unsigned);
+extern int dolook(void);
+extern boolean will_feel_cockatrice(struct obj *, boolean);
+extern void feel_cockatrice(struct obj *, boolean);
+extern void stackobj(struct obj *);
+extern boolean mergable(struct obj *, struct obj *);
+extern int doprgold(void);
+extern int doprwep(void);
+extern int doprarm(void);
+extern int doprring(void);
+extern int dopramulet(void);
+extern int doprtool(void);
+extern int doprinuse(void);
+extern void useupf(struct obj *, long);
+extern char *let_to_name(char, boolean, boolean);
+extern void free_invbuf(void);
+extern void reassign(void);
+extern int doorganize(void);
+extern void free_pickinv_cache(void);
+extern int count_unpaid(struct obj *);
+extern int count_buc(struct obj *, int, boolean(*)(struct obj *));
+extern void tally_BUCX(struct obj *, boolean, int *, int *, int *, int *,
+ int *);
+extern long count_contents(struct obj *, boolean, boolean, boolean, boolean);
+extern void carry_obj_effects(struct obj *);
+extern const char *currency(long);
+extern void silly_thing(const char *, struct obj *);
/* ### ioctl.c ### */
#if defined(UNIX) || defined(__BEOS__)
-E void NDECL(getwindowsz);
-E void NDECL(getioctls);
-E void NDECL(setioctls);
+extern void getwindowsz(void);
+extern void getioctls(void);
+extern void setioctls(void);
#ifdef SUSPEND
-E int NDECL(dosuspend);
+extern int dosuspend(void);
#endif /* SUSPEND */
#endif /* UNIX || __BEOS__ */
/* ### light.c ### */
-E void FDECL(new_light_source, (XCHAR_P, XCHAR_P, int, int, ANY_P *));
-E void FDECL(del_light_source, (int, ANY_P *));
-E void FDECL(do_light_sources, (xchar **));
-E void FDECL(show_transient_light, (struct obj *, int, int));
-E void NDECL(transient_light_cleanup);
-E struct monst *FDECL(find_mid, (unsigned, unsigned));
-E void FDECL(save_light_sources, (NHFILE *, int));
-E void FDECL(restore_light_sources, (NHFILE *));
-E void FDECL(light_stats, (const char *, char *, long *, long *));
-E void FDECL(relink_light_sources, (BOOLEAN_P));
-E void NDECL(light_sources_sanity_check);
-E void FDECL(obj_move_light_source, (struct obj *, struct obj *));
-E boolean NDECL(any_light_source);
-E void FDECL(snuff_light_source, (int, int));
-E boolean FDECL(obj_sheds_light, (struct obj *));
-E boolean FDECL(obj_is_burning, (struct obj *));
-E void FDECL(obj_split_light_source, (struct obj *, struct obj *));
-E void FDECL(obj_merge_light_sources, (struct obj *, struct obj *));
-E void FDECL(obj_adjust_light_radius, (struct obj *, int));
-E int FDECL(candle_light_range, (struct obj *));
-E int FDECL(arti_light_radius, (struct obj *));
-E const char *FDECL(arti_light_description, (struct obj *));
-E int NDECL(wiz_light_sources);
+extern void new_light_source(xchar, xchar, int, int, union any *);
+extern void del_light_source(int, union any *);
+extern void do_light_sources(xchar **);
+extern void show_transient_light(struct obj *, int, int);
+extern void transient_light_cleanup(void);
+extern struct monst *find_mid(unsigned, unsigned);
+extern void save_light_sources(NHFILE *, int);
+extern void restore_light_sources(NHFILE *);
+extern void light_stats(const char *, char *, long *, long *);
+extern void relink_light_sources(boolean);
+extern void light_sources_sanity_check(void);
+extern void obj_move_light_source(struct obj *, struct obj *);
+extern boolean any_light_source(void);
+extern void snuff_light_source(int, int);
+extern boolean obj_sheds_light(struct obj *);
+extern boolean obj_is_burning(struct obj *);
+extern void obj_split_light_source(struct obj *, struct obj *);
+extern void obj_merge_light_sources(struct obj *, struct obj *);
+extern void obj_adjust_light_radius(struct obj *, int);
+extern int candle_light_range(struct obj *);
+extern int arti_light_radius(struct obj *);
+extern const char *arti_light_description(struct obj *);
+extern int wiz_light_sources(void);
/* ### lock.c ### */
-E boolean FDECL(picking_lock, (int *, int *));
-E boolean FDECL(picking_at, (int, int));
-E void FDECL(breakchestlock, (struct obj *, BOOLEAN_P));
-E void NDECL(reset_pick);
-E void FDECL(maybe_reset_pick, (struct obj *));
-E struct obj *FDECL(autokey, (BOOLEAN_P));
-E int FDECL(pick_lock, (struct obj *, XCHAR_P, XCHAR_P, struct obj *));
-E int NDECL(doforce);
-E boolean FDECL(boxlock, (struct obj *, struct obj *));
-E boolean FDECL(doorlock, (struct obj *, int, int));
-E int NDECL(doopen);
-E boolean FDECL(stumble_on_door_mimic, (int, int));
-E int FDECL(doopen_indir, (int, int));
-E int NDECL(doclose);
+extern boolean picking_lock(int *, int *);
+extern boolean picking_at(int, int);
+extern void breakchestlock(struct obj *, boolean);
+extern void reset_pick(void);
+extern void maybe_reset_pick(struct obj *);
+extern struct obj *autokey(boolean);
+extern int pick_lock(struct obj *, xchar, xchar, struct obj *);
+extern int doforce(void);
+extern boolean boxlock(struct obj *, struct obj *);
+extern boolean doorlock(struct obj *, int, int);
+extern int doopen(void);
+extern boolean stumble_on_door_mimic(int, int);
+extern int doopen_indir(int, int);
+extern int doclose(void);
#ifdef MAC
-/* These declarations are here because the main code calls them. */
-
+/* outdated functions removed */
/* ### macfile.c ### */
-
-E int FDECL(maccreat, (const char *, long));
-E int FDECL(macopen, (const char *, int, long));
-E int FDECL(macclose, (int));
-E int FDECL(macread, (int, void *, unsigned));
-E int FDECL(macwrite, (int, void *, unsigned));
-E long FDECL(macseek, (int, long, short));
-E int FDECL(macunlink, (const char *));
-
/* ### macmain.c ### */
-
-E boolean NDECL(authorize_wizard_mode);
-
/* ### macunix.c ### */
-
-E void FDECL(regularize, (char *));
-E void NDECL(getlock);
-
/* ### macwin.c ### */
-
-E void FDECL(lock_mouse_cursor, (Boolean));
-E int NDECL(SanePositions);
-
/* ### mttymain.c ### */
-
-E void FDECL(getreturn, (char *));
-E void VDECL(msmsg, (const char *, ...));
-E void NDECL(gettty);
-E void NDECL(setftty);
-E void FDECL(settty, (const char *));
-E int NDECL(tgetch);
-E void FDECL(cmov, (int x, int y));
-E void FDECL(nocmov, (int x, int y));
-
-#endif /* MAC */
+#endif
/* ### mail.c ### */
#ifdef MAIL
#ifdef UNIX
-E void NDECL(free_maildata);
-E void NDECL(getmailstatus);
-E void NDECL(ck_server_admin_msg);
+extern void free_maildata(void);
+extern void getmailstatus(void);
+extern void ck_server_admin_msg(void);
#endif
-E void NDECL(ckmailstatus);
-E void FDECL(readmail, (struct obj *));
+extern void ckmailstatus(void);
+extern void readmail(struct obj *);
#endif /* MAIL */
/* ### makemon.c ### */
-E void FDECL(dealloc_monst, (struct monst *));
-E boolean FDECL(is_home_elemental, (struct permonst *));
-E struct monst *FDECL(clone_mon, (struct monst *, XCHAR_P, XCHAR_P));
-E int FDECL(monhp_per_lvl, (struct monst *));
-E void FDECL(newmonhp, (struct monst *, int));
-E struct mextra *NDECL(newmextra);
-E void FDECL(copy_mextra, (struct monst *, struct monst *));
-E void FDECL(dealloc_mextra, (struct monst *));
-E struct monst *FDECL(makemon, (struct permonst *, int, int, long));
-E struct monst *FDECL(unmakemon, (struct monst *, long));
-E boolean FDECL(create_critters, (int, struct permonst *, BOOLEAN_P));
-E struct permonst *NDECL(rndmonst);
-E struct permonst *FDECL(mkclass, (CHAR_P, int));
-E struct permonst *FDECL(mkclass_aligned, (CHAR_P, int, ALIGNTYP_P));
-E int FDECL(mkclass_poly, (int));
-E int FDECL(adj_lev, (struct permonst *));
-E struct permonst *FDECL(grow_up, (struct monst *, struct monst *));
-E struct obj* FDECL(mongets, (struct monst *, int));
-E int FDECL(golemhp, (int));
-E boolean FDECL(peace_minded, (struct permonst *));
-E void FDECL(set_malign, (struct monst *));
-E void FDECL(newmcorpsenm, (struct monst *));
-E void FDECL(freemcorpsenm, (struct monst *));
-E void FDECL(set_mimic_sym, (struct monst *));
-E int FDECL(mbirth_limit, (int));
-E void FDECL(mimic_hit_msg, (struct monst *, SHORT_P));
-E void FDECL(mkmonmoney, (struct monst *, long));
-E int FDECL(bagotricks, (struct obj *, BOOLEAN_P, int *));
-E boolean FDECL(propagate, (int, BOOLEAN_P, BOOLEAN_P));
-E boolean FDECL(usmellmon, (struct permonst *));
+extern void dealloc_monst(struct monst *);
+extern boolean is_home_elemental(struct permonst *);
+extern struct monst *clone_mon(struct monst *, xchar, xchar);
+extern int monhp_per_lvl(struct monst *);
+extern void newmonhp(struct monst *, int);
+extern struct mextra *newmextra(void);
+extern void copy_mextra(struct monst *, struct monst *);
+extern void dealloc_mextra(struct monst *);
+extern struct monst *makemon(struct permonst *, int, int, long);
+extern struct monst *unmakemon(struct monst *, long);
+extern boolean create_critters(int, struct permonst *, boolean);
+extern struct permonst *rndmonst(void);
+extern struct permonst *mkclass(char, int);
+extern struct permonst *mkclass_aligned(char, int, aligntyp);
+extern int mkclass_poly(int);
+extern int adj_lev(struct permonst *);
+extern struct permonst *grow_up(struct monst *, struct monst *);
+extern struct obj* mongets(struct monst *, int);
+extern int golemhp(int);
+extern boolean peace_minded(struct permonst *);
+extern void set_malign(struct monst *);
+extern void newmcorpsenm(struct monst *);
+extern void freemcorpsenm(struct monst *);
+extern void set_mimic_sym(struct monst *);
+extern int mbirth_limit(int);
+extern void mimic_hit_msg(struct monst *, short);
+extern void mkmonmoney(struct monst *, long);
+extern int bagotricks(struct obj *, boolean, int *);
+extern boolean propagate(int, boolean, boolean);
+extern boolean usmellmon(struct permonst *);
/* ### mcastu.c ### */
-E int FDECL(castmu, (struct monst *, struct attack *, BOOLEAN_P, BOOLEAN_P));
-E int FDECL(buzzmu, (struct monst *, struct attack *));
+extern int castmu(struct monst *, struct attack *, boolean, boolean);
+extern int buzzmu(struct monst *, struct attack *);
/* ### mdlib.c ### */
-E void NDECL(runtime_info_init);
-E const char *FDECL(do_runtime_info, (int *));
+extern void runtime_info_init(void);
+extern const char *do_runtime_info(int *);
/* ### mhitm.c ### */
-E int FDECL(fightm, (struct monst *));
-E int FDECL(mdisplacem, (struct monst *, struct monst *, BOOLEAN_P));
-E int FDECL(mattackm, (struct monst *, struct monst *));
-E boolean FDECL(engulf_target, (struct monst *, struct monst *));
-E int FDECL(mon_poly, (struct monst *, struct monst *, int));
-E void FDECL(paralyze_monst, (struct monst *, int));
-E int FDECL(sleep_monst, (struct monst *, int, int));
-E void FDECL(slept_monst, (struct monst *));
-E void FDECL(xdrainenergym, (struct monst *, BOOLEAN_P));
-E long FDECL(attk_protection, (int));
-E void FDECL(rustm, (struct monst *, struct obj *));
+extern int fightm(struct monst *);
+extern int mdisplacem(struct monst *, struct monst *, boolean);
+extern int mattackm(struct monst *, struct monst *);
+extern boolean engulf_target(struct monst *, struct monst *);
+extern int mon_poly(struct monst *, struct monst *, int);
+extern void paralyze_monst(struct monst *, int);
+extern int sleep_monst(struct monst *, int, int);
+extern void slept_monst(struct monst *);
+extern void xdrainenergym(struct monst *, boolean);
+extern long attk_protection(int);
+extern void rustm(struct monst *, struct obj *);
/* ### mhitu.c ### */
-E void FDECL(hitmsg, (struct monst *, struct attack *));
-E const char *FDECL(mpoisons_subj, (struct monst *, struct attack *));
-E void NDECL(u_slow_down);
-E struct monst *NDECL(cloneu);
-E void FDECL(expels, (struct monst *, struct permonst *, BOOLEAN_P));
-E struct attack *FDECL(getmattk, (struct monst *, struct monst *,
- int, int *, struct attack *));
-E int FDECL(mattacku, (struct monst *));
-boolean FDECL(diseasemu, (struct permonst *));
-boolean FDECL(u_slip_free, (struct monst *, struct attack *));
-E int FDECL(magic_negation, (struct monst *));
-E boolean NDECL(gulp_blnd_check);
-E int FDECL(gazemu, (struct monst *, struct attack *));
-E void FDECL(mdamageu, (struct monst *, int));
-E int FDECL(could_seduce, (struct monst *, struct monst *, struct attack *));
-E int FDECL(doseduce, (struct monst *));
+extern void hitmsg(struct monst *, struct attack *);
+extern const char *mpoisons_subj(struct monst *, struct attack *);
+extern void u_slow_down(void);
+extern struct monst *cloneu(void);
+extern void expels(struct monst *, struct permonst *, boolean);
+extern struct attack *getmattk(struct monst *, struct monst *, int, int *,
+ struct attack *);
+extern int mattacku(struct monst *);
+boolean diseasemu(struct permonst *);
+boolean u_slip_free(struct monst *, struct attack *);
+extern int magic_negation(struct monst *);
+extern boolean gulp_blnd_check(void);
+extern int gazemu(struct monst *, struct attack *);
+extern void mdamageu(struct monst *, int);
+extern int could_seduce(struct monst *, struct monst *, struct attack *);
+extern int doseduce(struct monst *);
/* ### minion.c ### */
-E void FDECL(newemin, (struct monst *));
-E void FDECL(free_emin, (struct monst *));
-E int FDECL(monster_census, (BOOLEAN_P));
-E int FDECL(msummon, (struct monst *));
-E void FDECL(summon_minion, (ALIGNTYP_P, BOOLEAN_P));
-E int FDECL(demon_talk, (struct monst *));
-E long FDECL(bribe, (struct monst *));
-E int FDECL(dprince, (ALIGNTYP_P));
-E int FDECL(dlord, (ALIGNTYP_P));
-E int NDECL(llord);
-E int FDECL(ndemon, (ALIGNTYP_P));
-E int NDECL(lminion);
-E void FDECL(lose_guardian_angel, (struct monst *));
-E void NDECL(gain_guardian_angel);
+extern void newemin(struct monst *);
+extern void free_emin(struct monst *);
+extern int monster_census(boolean);
+extern int msummon(struct monst *);
+extern void summon_minion(aligntyp, boolean);
+extern int demon_talk(struct monst *);
+extern long bribe(struct monst *);
+extern int dprince(aligntyp);
+extern int dlord(aligntyp);
+extern int llord(void);
+extern int ndemon(aligntyp);
+extern int lminion(void);
+extern void lose_guardian_angel(struct monst *);
+extern void gain_guardian_angel(void);
/* ### mklev.c ### */
-E void NDECL(sort_rooms);
-E void FDECL(add_room, (int, int, int, int, BOOLEAN_P, SCHAR_P, BOOLEAN_P));
-E void FDECL(add_subroom, (struct mkroom *, int, int, int, int, BOOLEAN_P,
- SCHAR_P, BOOLEAN_P));
-E void FDECL(free_luathemes, (BOOLEAN_P));
-E void NDECL(makecorridors);
-E void FDECL(add_door, (int, int, struct mkroom *));
-E void NDECL(clear_level_structures);
-E void NDECL(mklev);
+extern void sort_rooms(void);
+extern void add_room(int, int, int, int, boolean, schar, boolean);
+extern void add_subroom(struct mkroom *, int, int, int, int, boolean, schar,
+ boolean);
+extern void free_luathemes(boolean);
+extern void makecorridors(void);
+extern void add_door(int, int, struct mkroom *);
+extern void clear_level_structures(void);
+extern void mklev(void);
#ifdef SPECIALIZATION
-E void FDECL(topologize, (struct mkroom *, BOOLEAN_P));
+extern void topologize(struct mkroom *, boolean));
#else
-E void FDECL(topologize, (struct mkroom *));
+extern void topologize(struct mkroom *);
#endif
-E void FDECL(place_branch, (branch *, XCHAR_P, XCHAR_P));
-E boolean FDECL(occupied, (XCHAR_P, XCHAR_P));
-E int FDECL(okdoor, (XCHAR_P, XCHAR_P));
-E void FDECL(dodoor, (int, int, struct mkroom *));
-E void FDECL(mktrap, (int, int, struct mkroom *, coord *));
-E void FDECL(mkstairs, (XCHAR_P, XCHAR_P, CHAR_P, struct mkroom *));
-E void NDECL(mkinvokearea);
-E void FDECL(mineralize, (int, int, int, int, BOOLEAN_P));
+extern void place_branch(branch *, xchar, xchar);
+extern boolean occupied(xchar, xchar);
+extern int okdoor(xchar, xchar);
+extern void dodoor(int, int, struct mkroom *);
+extern void mktrap(int, int, struct mkroom *, coord *);
+extern void mkstairs(xchar, xchar, char, struct mkroom *);
+extern void mkinvokearea(void);
+extern void mineralize(int, int, int, int, boolean);
/* ### mkmap.c ### */
-E void FDECL(flood_fill_rm, (int, int, int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(remove_rooms, (int, int, int, int));
-E boolean FDECL(litstate_rnd, (int));
-/* E void FDECL(mkmap, (lev_init *)); -- need sp_lev.h for lev_init */
+extern void flood_fill_rm(int, int, int, boolean, boolean);
+extern void remove_rooms(int, int, int, int);
+extern boolean litstate_rnd(int);
/* ### mkmaze.c ### */
-E void FDECL(create_maze, (int, int, BOOLEAN_P));
-E void FDECL(wallification, (int, int, int, int));
-E void FDECL(fix_wall_spines, (int, int, int, int));
-E void FDECL(walkfrom, (int, int, SCHAR_P));
-E void FDECL(makemaz, (const char *));
-E void FDECL(mazexy, (coord *));
-E void FDECL(get_level_extends, (int *, int *, int *, int *));
-E void NDECL(bound_digging);
-E void FDECL(mkportal, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P));
-E boolean FDECL(bad_location, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P));
-E void FDECL(place_lregion, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, d_level *));
-E void NDECL(fixup_special);
-E void NDECL(fumaroles);
-E void NDECL(movebubbles);
-E void NDECL(water_friction);
-E void FDECL(save_waterlevel, (NHFILE *));
-E void FDECL(restore_waterlevel, (NHFILE *));
-E const char *FDECL(waterbody_name, (XCHAR_P, XCHAR_P));
+extern void create_maze(int, int, boolean);
+extern void wallification(int, int, int, int);
+extern void fix_wall_spines(int, int, int, int);
+extern void walkfrom(int, int, schar);
+extern void makemaz(const char *);
+extern void mazexy(coord *);
+extern void get_level_extends(int *, int *, int *, int *);
+extern void bound_digging(void);
+extern void mkportal(xchar, xchar, xchar, xchar);
+extern boolean bad_location(xchar, xchar, xchar, xchar, xchar, xchar);
+extern void place_lregion(xchar, xchar, xchar, xchar, xchar, xchar, xchar,
+ xchar, xchar, d_level *);
+extern void fixup_special(void);
+extern void fumaroles(void);
+extern void movebubbles(void);
+extern void water_friction(void);
+extern void save_waterlevel(NHFILE *);
+extern void restore_waterlevel(NHFILE *);
+extern const char *waterbody_name(xchar, xchar);
/* ### mkobj.c ### */
-E struct oextra *NDECL(newoextra);
-E void FDECL(copy_oextra, (struct obj *, struct obj *));
-E void FDECL(dealloc_oextra, (struct obj *));
-E void FDECL(newomonst, (struct obj *));
-E void FDECL(free_omonst, (struct obj *));
-E void FDECL(newomid, (struct obj *));
-E void FDECL(free_omid, (struct obj *));
-E void FDECL(newolong, (struct obj *));
-E void FDECL(free_olong, (struct obj *));
-E void FDECL(new_omailcmd, (struct obj *, const char *));
-E void FDECL(free_omailcmd, (struct obj *));
-E struct obj *FDECL(mkobj_at, (CHAR_P, int, int, BOOLEAN_P));
-E struct obj *FDECL(mksobj_at, (int, int, int, BOOLEAN_P, BOOLEAN_P));
-E struct obj *FDECL(mksobj_migr_to_species, (int, unsigned,
- BOOLEAN_P, BOOLEAN_P));
-E struct obj *FDECL(mkobj, (int, BOOLEAN_P));
-E int NDECL(rndmonnum);
-E boolean FDECL(bogon_is_pname, (CHAR_P));
-E struct obj *FDECL(splitobj, (struct obj *, long));
-E struct obj *FDECL(unsplitobj, (struct obj *));
-E void NDECL(clear_splitobjs);
-E void FDECL(replace_object, (struct obj *, struct obj *));
-E struct obj *FDECL(unknwn_contnr_contents, (struct obj *));
-E void FDECL(bill_dummy_object, (struct obj *));
-E void FDECL(costly_alteration, (struct obj *, int));
-E struct obj *FDECL(mksobj, (int, BOOLEAN_P, BOOLEAN_P));
-E int FDECL(bcsign, (struct obj *));
-E int FDECL(weight, (struct obj *));
-E struct obj *FDECL(mkgold, (long, int, int));
-E struct obj *FDECL(mkcorpstat, (int, struct monst *, struct permonst *, int,
- int, unsigned));
-E int FDECL(corpse_revive_type, (struct obj *));
-E struct obj *FDECL(obj_attach_mid, (struct obj *, unsigned));
-E struct monst *FDECL(get_mtraits, (struct obj *, BOOLEAN_P));
-E struct obj *FDECL(mk_tt_object, (int, int, int));
-E struct obj *FDECL(mk_named_object,
- (int, struct permonst *, int, int, const char *));
-E struct obj *FDECL(rnd_treefruit_at, (int, int));
-E void FDECL(set_corpsenm, (struct obj *, int));
-E long FDECL(rider_revival_time, (struct obj *, BOOLEAN_P));
-E void FDECL(start_corpse_timeout, (struct obj *));
-E void FDECL(bless, (struct obj *));
-E void FDECL(unbless, (struct obj *));
-E void FDECL(curse, (struct obj *));
-E void FDECL(uncurse, (struct obj *));
-E void FDECL(blessorcurse, (struct obj *, int));
-E void FDECL(set_bknown, (struct obj *, unsigned));
-E boolean FDECL(is_flammable, (struct obj *));
-E boolean FDECL(is_rottable, (struct obj *));
-E void FDECL(place_object, (struct obj *, int, int));
-E void FDECL(remove_object, (struct obj *));
-E void FDECL(discard_minvent, (struct monst *, BOOLEAN_P));
-E void FDECL(obj_extract_self, (struct obj *));
-E void FDECL(extract_nobj, (struct obj *, struct obj **));
-E void FDECL(extract_nexthere, (struct obj *, struct obj **));
-E int FDECL(add_to_minv, (struct monst *, struct obj *));
-E struct obj *FDECL(add_to_container, (struct obj *, struct obj *));
-E void FDECL(add_to_migration, (struct obj *));
-E void FDECL(add_to_buried, (struct obj *));
-E void FDECL(dealloc_obj, (struct obj *));
-E void FDECL(obj_ice_effects, (int, int, BOOLEAN_P));
-E long FDECL(peek_at_iced_corpse_age, (struct obj *));
-E int FDECL(hornoplenty, (struct obj *, BOOLEAN_P));
-E void NDECL(obj_sanity_check);
-E struct obj *FDECL(obj_nexto, (struct obj *));
-E struct obj *FDECL(obj_nexto_xy, (struct obj *, int, int, BOOLEAN_P));
-E struct obj *FDECL(obj_absorb, (struct obj **, struct obj **));
-E struct obj *FDECL(obj_meld, (struct obj **, struct obj **));
-E void FDECL(pudding_merge_message, (struct obj *, struct obj *));
-E struct obj *FDECL(init_dummyobj, (struct obj *, SHORT_P, long));
+extern struct oextra *newoextra(void);
+extern void copy_oextra(struct obj *, struct obj *);
+extern void dealloc_oextra(struct obj *);
+extern void newomonst(struct obj *);
+extern void free_omonst(struct obj *);
+extern void newomid(struct obj *);
+extern void free_omid(struct obj *);
+extern void newolong(struct obj *);
+extern void free_olong(struct obj *);
+extern void new_omailcmd(struct obj *, const char *);
+extern void free_omailcmd(struct obj *);
+extern struct obj *mkobj_at(char, int, int, boolean);
+extern struct obj *mksobj_at(int, int, int, boolean, boolean);
+extern struct obj *mksobj_migr_to_species(int, unsigned, boolean, boolean);
+extern struct obj *mkobj(int, boolean);
+extern int rndmonnum(void);
+extern boolean bogon_is_pname(char);
+extern struct obj *splitobj(struct obj *, long);
+extern struct obj *unsplitobj(struct obj *);
+extern void clear_splitobjs(void);
+extern void replace_object(struct obj *, struct obj *);
+extern struct obj *unknwn_contnr_contents(struct obj *);
+extern void bill_dummy_object(struct obj *);
+extern void costly_alteration(struct obj *, int);
+extern struct obj *mksobj(int, boolean, boolean);
+extern int bcsign(struct obj *);
+extern int weight(struct obj *);
+extern struct obj *mkgold(long, int, int);
+extern struct obj *mkcorpstat(int, struct monst *, struct permonst *, int,
+ int, unsigned);
+extern int corpse_revive_type(struct obj *);
+extern struct obj *obj_attach_mid(struct obj *, unsigned);
+extern struct monst *get_mtraits(struct obj *, boolean);
+extern struct obj *mk_tt_object(int, int, int);
+extern struct obj *mk_named_object(int, struct permonst *, int, int,
+ const char *);
+extern struct obj *rnd_treefruit_at(int, int);
+extern void set_corpsenm(struct obj *, int);
+extern long rider_revival_time(struct obj *, boolean);
+extern void start_corpse_timeout(struct obj *);
+extern void bless(struct obj *);
+extern void unbless(struct obj *);
+extern void curse(struct obj *);
+extern void uncurse(struct obj *);
+extern void blessorcurse(struct obj *, int);
+extern void set_bknown(struct obj *, unsigned);
+extern boolean is_flammable(struct obj *);
+extern boolean is_rottable(struct obj *);
+extern void place_object(struct obj *, int, int);
+extern void remove_object(struct obj *);
+extern void discard_minvent(struct monst *, boolean);
+extern void obj_extract_self(struct obj *);
+extern void extract_nobj(struct obj *, struct obj **);
+extern void extract_nexthere(struct obj *, struct obj **);
+extern int add_to_minv(struct monst *, struct obj *);
+extern struct obj *add_to_container(struct obj *, struct obj *);
+extern void add_to_migration(struct obj *);
+extern void add_to_buried(struct obj *);
+extern void dealloc_obj(struct obj *);
+extern void obj_ice_effects(int, int, boolean);
+extern long peek_at_iced_corpse_age(struct obj *);
+extern int hornoplenty(struct obj *, boolean);
+extern void obj_sanity_check(void);
+extern struct obj *obj_nexto(struct obj *);
+extern struct obj *obj_nexto_xy(struct obj *, int, int, boolean);
+extern struct obj *obj_absorb(struct obj **, struct obj **);
+extern struct obj *obj_meld(struct obj **, struct obj **);
+extern void pudding_merge_message(struct obj *, struct obj *);
+extern struct obj *init_dummyobj(struct obj *, short, long);
/* ### mkroom.c ### */
-E void FDECL(mkroom, (int));
-E void FDECL(fill_zoo, (struct mkroom *));
-E struct permonst *NDECL(antholemon);
-E boolean FDECL(nexttodoor, (int, int));
-E boolean FDECL(has_dnstairs, (struct mkroom *));
-E boolean FDECL(has_upstairs, (struct mkroom *));
-E int FDECL(somex, (struct mkroom *));
-E int FDECL(somey, (struct mkroom *));
-E boolean FDECL(inside_room, (struct mkroom *, XCHAR_P, XCHAR_P));
-E boolean FDECL(somexy, (struct mkroom *, coord *));
-E boolean FDECL(somexyspace, (struct mkroom *, coord *));
-E void FDECL(mkundead, (coord *, BOOLEAN_P, int));
-E struct permonst *NDECL(courtmon);
-E void FDECL(save_rooms, (NHFILE *));
-E void FDECL(rest_rooms, (NHFILE *));
-E struct mkroom *FDECL(search_special, (SCHAR_P));
-E int FDECL(cmap_to_type, (int));
+extern void mkroom(int);
+extern void fill_zoo(struct mkroom *);
+extern struct permonst *antholemon(void);
+extern boolean nexttodoor(int, int);
+extern boolean has_dnstairs(struct mkroom *);
+extern boolean has_upstairs(struct mkroom *);
+extern int somex(struct mkroom *);
+extern int somey(struct mkroom *);
+extern boolean inside_room(struct mkroom *, xchar, xchar);
+extern boolean somexy(struct mkroom *, coord *);
+extern boolean somexyspace(struct mkroom *, coord *);
+extern void mkundead(coord *, boolean, int);
+extern struct permonst *courtmon(void);
+extern void save_rooms(NHFILE *);
+extern void rest_rooms(NHFILE *);
+extern struct mkroom *search_special(schar);
+extern int cmap_to_type(int);
/* ### mon.c ### */
-E void NDECL(mon_sanity_check);
-E boolean FDECL(zombie_maker, (struct permonst *));
-E int FDECL(zombie_form, (struct permonst *));
-E int FDECL(m_poisongas_ok, (struct monst *));
-E int FDECL(undead_to_corpse, (int));
-E int FDECL(genus, (int, int));
-E int FDECL(pm_to_cham, (int));
-E int FDECL(minliquid, (struct monst *));
-E int NDECL(movemon);
-E int FDECL(meatmetal, (struct monst *));
-E int FDECL(meatobj, (struct monst *));
-E int FDECL(meatcorpse, (struct monst *));
-E void FDECL(mpickgold, (struct monst *));
-E boolean FDECL(mpickstuff, (struct monst *, const char *));
-E int FDECL(curr_mon_load, (struct monst *));
-E int FDECL(max_mon_load, (struct monst *));
-E int FDECL(can_carry, (struct monst *, struct obj *));
-E long FDECL(mon_allowflags, (struct monst *));
-E int FDECL(mfndpos, (struct monst *, coord *, long *, long));
-E boolean FDECL(monnear, (struct monst *, int, int));
-E void NDECL(dmonsfree);
-E void FDECL(elemental_clog, (struct monst *));
-E int FDECL(mcalcmove, (struct monst *, BOOLEAN_P));
-E void NDECL(mcalcdistress);
-E void FDECL(replmon, (struct monst *, struct monst *));
-E void FDECL(relmon, (struct monst *, struct monst **));
-E struct obj *FDECL(mlifesaver, (struct monst *));
-E boolean FDECL(corpse_chance, (struct monst *, struct monst *, BOOLEAN_P));
-E void FDECL(mondead, (struct monst *));
-E void FDECL(mondied, (struct monst *));
-E void FDECL(mongone, (struct monst *));
-E void FDECL(monstone, (struct monst *));
-E void FDECL(monkilled, (struct monst *, const char *, int));
-E void FDECL(set_ustuck, (struct monst *));
-E void FDECL(unstuck, (struct monst *));
-E void FDECL(killed, (struct monst *));
-E void FDECL(xkilled, (struct monst *, int));
-E void FDECL(mon_to_stone, (struct monst *));
-E void FDECL(m_into_limbo, (struct monst *));
-E void FDECL(mnexto, (struct monst *));
-E void FDECL(maybe_mnexto, (struct monst *));
-E int FDECL(mnearto, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(m_respond, (struct monst *));
-E void FDECL(setmangry, (struct monst *, BOOLEAN_P));
-E void FDECL(wakeup, (struct monst *, BOOLEAN_P));
-E void NDECL(wake_nearby);
-E void FDECL(wake_nearto, (int, int, int));
-E void FDECL(seemimic, (struct monst *));
-E void NDECL(rescham);
-E void NDECL(restartcham);
-E void FDECL(restore_cham, (struct monst *));
-E void FDECL(maybe_unhide_at, (XCHAR_P, XCHAR_P));
-E boolean FDECL(hideunder, (struct monst *));
-E void FDECL(hide_monst, (struct monst *));
-E void FDECL(mon_animal_list, (BOOLEAN_P));
-E boolean FDECL(valid_vampshiftform, (int, int));
-E boolean FDECL(validvamp, (struct monst *, int *, int));
-E int FDECL(select_newcham_form, (struct monst *));
-E void FDECL(mgender_from_permonst, (struct monst *, struct permonst *));
-E int FDECL(newcham, (struct monst *, struct permonst *, BOOLEAN_P,
- BOOLEAN_P));
-E int FDECL(can_be_hatched, (int));
-E int FDECL(egg_type_from_parent, (int, BOOLEAN_P));
-E boolean FDECL(dead_species, (int, BOOLEAN_P));
-E void NDECL(kill_genocided_monsters);
-E void FDECL(golemeffects, (struct monst *, int, int));
-E boolean FDECL(angry_guards, (BOOLEAN_P));
-E void NDECL(pacify_guards);
-E void FDECL(decide_to_shapeshift, (struct monst *, int));
-E boolean FDECL(vamp_stone, (struct monst *));
+extern void mon_sanity_check(void);
+extern boolean zombie_maker(struct permonst *);
+extern int zombie_form(struct permonst *);
+extern int m_poisongas_ok(struct monst *);
+extern int undead_to_corpse(int);
+extern int genus(int, int);
+extern int pm_to_cham(int);
+extern int minliquid(struct monst *);
+extern int movemon(void);
+extern int meatmetal(struct monst *);
+extern int meatobj(struct monst *);
+extern int meatcorpse(struct monst *);
+extern void mpickgold(struct monst *);
+extern boolean mpickstuff(struct monst *, const char *);
+extern int curr_mon_load(struct monst *);
+extern int max_mon_load(struct monst *);
+extern int can_carry(struct monst *, struct obj *);
+extern long mon_allowflags(struct monst *);
+extern int mfndpos(struct monst *, coord *, long *, long);
+extern boolean monnear(struct monst *, int, int);
+extern void dmonsfree(void);
+extern void elemental_clog(struct monst *);
+extern int mcalcmove(struct monst *, boolean);
+extern void mcalcdistress(void);
+extern void replmon(struct monst *, struct monst *);
+extern void relmon(struct monst *, struct monst **);
+extern struct obj *mlifesaver(struct monst *);
+extern boolean corpse_chance(struct monst *, struct monst *, boolean);
+extern void mondead(struct monst *);
+extern void mondied(struct monst *);
+extern void mongone(struct monst *);
+extern void monstone(struct monst *);
+extern void monkilled(struct monst *, const char *, int);
+extern void set_ustuck(struct monst *);
+extern void unstuck(struct monst *);
+extern void killed(struct monst *);
+extern void xkilled(struct monst *, int);
+extern void mon_to_stone(struct monst *);
+extern void m_into_limbo(struct monst *);
+extern void mnexto(struct monst *);
+extern void maybe_mnexto(struct monst *);
+extern int mnearto(struct monst *, xchar, xchar, boolean);
+extern void m_respond(struct monst *);
+extern void setmangry(struct monst *, boolean);
+extern void wakeup(struct monst *, boolean);
+extern void wake_nearby(void);
+extern void wake_nearto(int, int, int);
+extern void seemimic(struct monst *);
+extern void rescham(void);
+extern void restartcham(void);
+extern void restore_cham(struct monst *);
+extern void maybe_unhide_at(xchar, xchar);
+extern boolean hideunder(struct monst *);
+extern void hide_monst(struct monst *);
+extern void mon_animal_list(boolean);
+extern boolean valid_vampshiftform(int, int);
+extern boolean validvamp(struct monst *, int *, int);
+extern int select_newcham_form(struct monst *);
+extern void mgender_from_permonst(struct monst *, struct permonst *);
+extern int newcham(struct monst *, struct permonst *, boolean, boolean);
+extern int can_be_hatched(int);
+extern int egg_type_from_parent(int, boolean);
+extern boolean dead_species(int, boolean);
+extern void kill_genocided_monsters(void);
+extern void golemeffects(struct monst *, int, int);
+extern boolean angry_guards(boolean);
+extern void pacify_guards(void);
+extern void decide_to_shapeshift(struct monst *, int);
+extern boolean vamp_stone(struct monst *);
/* ### mondata.c ### */
-E void FDECL(set_mon_data, (struct monst *, struct permonst *));
-E struct attack *FDECL(attacktype_fordmg, (struct permonst *, int, int));
-E boolean FDECL(attacktype, (struct permonst *, int));
-E boolean FDECL(noattacks, (struct permonst *));
-E boolean FDECL(poly_when_stoned, (struct permonst *));
-E boolean FDECL(resists_drli, (struct monst *));
-E boolean FDECL(resists_magm, (struct monst *));
-E boolean FDECL(resists_blnd, (struct monst *));
-E boolean FDECL(can_blnd, (struct monst *, struct monst *,
- UCHAR_P, struct obj *));
-E boolean FDECL(ranged_attk, (struct permonst *));
-E boolean FDECL(hates_silver, (struct permonst *));
-E boolean FDECL(mon_hates_silver, (struct monst *));
-E boolean FDECL(mon_hates_light, (struct monst *));
-E boolean FDECL(passes_bars, (struct permonst *));
-E boolean FDECL(can_blow, (struct monst *));
-E boolean FDECL(can_chant, (struct monst *));
-E boolean FDECL(can_be_strangled, (struct monst *));
-E boolean FDECL(can_track, (struct permonst *));
-E boolean FDECL(breakarm, (struct permonst *));
-E boolean FDECL(sliparm, (struct permonst *));
-E boolean FDECL(sticks, (struct permonst *));
-E boolean FDECL(cantvomit, (struct permonst *));
-E int FDECL(num_horns, (struct permonst *));
-/* E boolean FDECL(canseemon, (struct monst *)); */
-E struct attack *FDECL(dmgtype_fromattack, (struct permonst *, int, int));
-E boolean FDECL(dmgtype, (struct permonst *, int));
-E int FDECL(max_passive_dmg, (struct monst *, struct monst *));
-E boolean FDECL(same_race, (struct permonst *, struct permonst *));
-E int FDECL(monsndx, (struct permonst *));
-E int FDECL(name_to_mon, (const char *, int *));
-E int FDECL(name_to_monplus, (const char *, const char **, int *));
-E int FDECL(name_to_monclass, (const char *, int *));
-E int FDECL(gender, (struct monst *));
-E int FDECL(pronoun_gender, (struct monst *, unsigned));
-E boolean FDECL(levl_follower, (struct monst *));
-E int FDECL(little_to_big, (int));
-E int FDECL(big_to_little, (int));
-E boolean FDECL(big_little_match, (int, int));
-E const char *FDECL(locomotion, (const struct permonst *, const char *));
-E const char *FDECL(stagger, (const struct permonst *, const char *));
-E const char *FDECL(on_fire, (struct permonst *, struct attack *));
-E const struct permonst *FDECL(raceptr, (struct monst *));
-E boolean FDECL(olfaction, (struct permonst *));
+extern void set_mon_data(struct monst *, struct permonst *);
+extern struct attack *attacktype_fordmg(struct permonst *, int, int);
+extern boolean attacktype(struct permonst *, int);
+extern boolean noattacks(struct permonst *);
+extern boolean poly_when_stoned(struct permonst *);
+extern boolean resists_drli(struct monst *);
+extern boolean resists_magm(struct monst *);
+extern boolean resists_blnd(struct monst *);
+extern boolean can_blnd(struct monst *, struct monst *, uchar, struct obj *);
+extern boolean ranged_attk(struct permonst *);
+extern boolean hates_silver(struct permonst *);
+extern boolean mon_hates_silver(struct monst *);
+extern boolean mon_hates_light(struct monst *);
+extern boolean passes_bars(struct permonst *);
+extern boolean can_blow(struct monst *);
+extern boolean can_chant(struct monst *);
+extern boolean can_be_strangled(struct monst *);
+extern boolean can_track(struct permonst *);
+extern boolean breakarm(struct permonst *);
+extern boolean sliparm(struct permonst *);
+extern boolean sticks(struct permonst *);
+extern boolean cantvomit(struct permonst *);
+extern int num_horns(struct permonst *);
+extern struct attack *dmgtype_fromattack(struct permonst *, int, int);
+extern boolean dmgtype(struct permonst *, int);
+extern int max_passive_dmg(struct monst *, struct monst *);
+extern boolean same_race(struct permonst *, struct permonst *);
+extern int monsndx(struct permonst *);
+extern int name_to_mon(const char *, int *);
+extern int name_to_monplus(const char *, const char **, int *);
+extern int name_to_monclass(const char *, int *);
+extern int gender(struct monst *);
+extern int pronoun_gender(struct monst *, unsigned);
+extern boolean levl_follower(struct monst *);
+extern int little_to_big(int);
+extern int big_to_little(int);
+extern boolean big_little_match(int, int);
+extern const char *locomotion(const struct permonst *, const char *);
+extern const char *stagger(const struct permonst *, const char *);
+extern const char *on_fire(struct permonst *, struct attack *);
+extern const struct permonst *raceptr(struct monst *);
+extern boolean olfaction(struct permonst *);
/* ### monmove.c ### */
-E boolean FDECL(itsstuck, (struct monst *));
-E boolean FDECL(mb_trapped, (struct monst *));
-E boolean FDECL(monhaskey, (struct monst *, BOOLEAN_P));
-E void FDECL(mon_regen, (struct monst *, BOOLEAN_P));
-E int FDECL(dochugw, (struct monst *));
-E boolean FDECL(onscary, (int, int, struct monst *));
-E struct monst *FDECL(find_pmmonst, (int));
-E int FDECL(bee_eat_jelly, (struct monst *, struct obj *));
-E void FDECL(monflee, (struct monst *, int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(mon_yells, (struct monst *, const char *));
-E int FDECL(dochug, (struct monst *));
-E boolean FDECL(m_digweapon_check, (struct monst *, XCHAR_P, XCHAR_P));
-E int FDECL(m_move, (struct monst *, int));
-E int FDECL(m_move_aggress, (struct monst *, XCHAR_P, XCHAR_P));
-E void FDECL(dissolve_bars, (int, int));
-E boolean FDECL(closed_door, (int, int));
-E boolean FDECL(accessible, (int, int));
-E void FDECL(set_apparxy, (struct monst *));
-E boolean FDECL(can_ooze, (struct monst *));
-E boolean FDECL(can_fog, (struct monst *));
-E boolean FDECL(should_displace,
- (struct monst *, coord *, long *, int, XCHAR_P, XCHAR_P));
-E boolean FDECL(undesirable_disp, (struct monst *, XCHAR_P, XCHAR_P));
+extern boolean itsstuck(struct monst *);
+extern boolean mb_trapped(struct monst *);
+extern boolean monhaskey(struct monst *, boolean);
+extern void mon_regen(struct monst *, boolean);
+extern int dochugw(struct monst *);
+extern boolean onscary(int, int, struct monst *);
+extern struct monst *find_pmmonst(int);
+extern int bee_eat_jelly(struct monst *, struct obj *);
+extern void monflee(struct monst *, int, boolean, boolean);
+extern void mon_yells(struct monst *, const char *);
+extern int dochug(struct monst *);
+extern boolean m_digweapon_check(struct monst *, xchar, xchar);
+extern int m_move(struct monst *, int);
+extern int m_move_aggress(struct monst *, xchar, xchar);
+extern void dissolve_bars(int, int);
+extern boolean closed_door(int, int);
+extern boolean accessible(int, int);
+extern void set_apparxy(struct monst *);
+extern boolean can_ooze(struct monst *);
+extern boolean can_fog(struct monst *);
+extern boolean should_displace(struct monst *, coord *, long *, int, xchar,
+ xchar);
+extern boolean undesirable_disp(struct monst *, xchar, xchar);
/* ### monst.c ### */
-E void NDECL(monst_globals_init);
+extern void monst_globals_init(void);
/* ### mplayer.c ### */
-E struct monst *FDECL(mk_mplayer,
- (struct permonst *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(create_mplayers, (int, BOOLEAN_P));
-E void FDECL(mplayer_talk, (struct monst *));
+extern struct monst *mk_mplayer(struct permonst *, xchar, xchar, boolean);
+extern void create_mplayers(int, boolean);
+extern void mplayer_talk(struct monst *);
#if defined(MICRO) || defined(WIN32)
/* ### msdos.c,os2.c,tos.c,winnt.c ### */
#ifndef WIN32
-E int NDECL(tgetch);
+extern int tgetch(void);
#endif
#ifndef TOS
-E char NDECL(switchar);
+extern char switchar(void);
#endif
#ifndef __GO32__
-E long FDECL(freediskspace, (char *));
+extern long freediskspace(char *);
#ifdef MSDOS
-E int FDECL(findfirst_file, (char *));
-E int NDECL(findnext_file);
-E long FDECL(filesize_nh, (char *));
+extern int findfirst_file(char *);
+extern int findnext_file(void);
+extern long filesize_nh(char *);
#else
-E int FDECL(findfirst, (char *));
-E int NDECL(findnext);
-E long FDECL(filesize, (char *));
+extern int findfirst(char *);
+extern int findnext(void);
+extern long filesize(char *);
#endif /* MSDOS */
-E char *NDECL(foundfile_buffer);
+extern char *foundfile_buffer(void);
#endif /* __GO32__ */
-E void FDECL(chdrive, (char *));
+extern void chdrive(char *);
#ifndef TOS
-E void NDECL(disable_ctrlP);
-E void NDECL(enable_ctrlP);
+extern void disable_ctrlP(void);
+extern void enable_ctrlP(void);
#endif
#if defined(MICRO) && !defined(WINNT)
-E void NDECL(get_scr_size);
+extern void get_scr_size(void);
#ifndef TOS
-E void FDECL(gotoxy, (int, int));
+extern void gotoxy(int, int);
#endif
#endif
#ifdef TOS
-E int FDECL(_copyfile, (char *, char *));
-E int NDECL(kbhit);
-E void NDECL(set_colors);
-E void NDECL(restore_colors);
+extern int _copyfile(char *, char *);
+extern int kbhit(void);
+extern void set_colors(void);
+extern void restore_colors(void);
#ifdef SUSPEND
-E int NDECL(dosuspend);
+extern int dosuspend(void);
#endif
#endif /* TOS */
#ifdef WIN32
-E char *FDECL(get_username, (int *));
-E void FDECL(nt_regularize, (char *));
-E int NDECL((*nt_kbhit));
-E void FDECL(Delay, (int));
+extern char *get_username(int *);
+extern void nt_regularize(char *);
+extern int(*nt_kbhit)(void);
+extern void Delay(int);
#endif /* WIN32 */
+
#endif /* MICRO || WIN32 */
/* ### mthrowu.c ### */
-E boolean FDECL(m_has_launcher_and_ammo, (struct monst *));
-E int FDECL(thitu, (int, int, struct obj **, const char *));
-E int FDECL(ohitmon, (struct monst *, struct obj *, int, BOOLEAN_P));
-E void FDECL(thrwmu, (struct monst *));
-E int FDECL(spitmu, (struct monst *, struct attack *));
-E int FDECL(breamu, (struct monst *, struct attack *));
-E boolean FDECL(linedup_callback, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, boolean FDECL((*), (int,int))));
-E boolean FDECL(linedup, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, int));
-E boolean FDECL(lined_up, (struct monst *));
-E struct obj *FDECL(m_carrying, (struct monst *, int));
-E int FDECL(thrwmm, (struct monst *, struct monst *));
-E int FDECL(spitmm, (struct monst *, struct attack *, struct monst *));
-E int FDECL(breamm, (struct monst *, struct attack *, struct monst *));
-E void FDECL(m_useupall, (struct monst *, struct obj *));
-E void FDECL(m_useup, (struct monst *, struct obj *));
-E void FDECL(m_throw, (struct monst *, int, int, int, int, int, struct obj *));
-E void FDECL(hit_bars, (struct obj **, int, int, int, int,
- BOOLEAN_P, BOOLEAN_P));
-E boolean FDECL(hits_bars, (struct obj **, int, int, int, int, int, int));
+extern boolean m_has_launcher_and_ammo(struct monst *);
+extern int thitu(int, int, struct obj **, const char *);
+extern int ohitmon(struct monst *, struct obj *, int, boolean);
+extern void thrwmu(struct monst *);
+extern int spitmu(struct monst *, struct attack *);
+extern int breamu(struct monst *, struct attack *);
+extern boolean linedup_callback(xchar, xchar, xchar, xchar,
+ boolean(*)(int,int));
+extern boolean linedup(xchar, xchar, xchar, xchar, int);
+extern boolean lined_up(struct monst *);
+extern struct obj *m_carrying(struct monst *, int);
+extern int thrwmm(struct monst *, struct monst *);
+extern int spitmm(struct monst *, struct attack *, struct monst *);
+extern int breamm(struct monst *, struct attack *, struct monst *);
+extern void m_useupall(struct monst *, struct obj *);
+extern void m_useup(struct monst *, struct obj *);
+extern void m_throw(struct monst *, int, int, int, int, int, struct obj *);
+extern void hit_bars(struct obj **, int, int, int, int, boolean, boolean);
+extern boolean hits_bars(struct obj **, int, int, int, int, int, int);
/* ### muse.c ### */
-E boolean FDECL(find_defensive, (struct monst *));
-E int FDECL(use_defensive, (struct monst *));
-E int FDECL(rnd_defensive_item, (struct monst *));
-E boolean FDECL(find_offensive, (struct monst *));
-E int FDECL(use_offensive, (struct monst *));
-E int FDECL(rnd_offensive_item, (struct monst *));
-E boolean FDECL(find_misc, (struct monst *));
-E int FDECL(use_misc, (struct monst *));
-E int FDECL(rnd_misc_item, (struct monst *));
-E boolean FDECL(searches_for_item, (struct monst *, struct obj *));
-E boolean FDECL(mon_reflects, (struct monst *, const char *));
-E boolean FDECL(ureflects, (const char *, const char *));
-E void FDECL(mcureblindness, (struct monst *, BOOLEAN_P));
-E boolean FDECL(munstone, (struct monst *, BOOLEAN_P));
-E boolean FDECL(munslime, (struct monst *, BOOLEAN_P));
+extern boolean find_defensive(struct monst *);
+extern int use_defensive(struct monst *);
+extern int rnd_defensive_item(struct monst *);
+extern boolean find_offensive(struct monst *);
+extern int use_offensive(struct monst *);
+extern int rnd_offensive_item(struct monst *);
+extern boolean find_misc(struct monst *);
+extern int use_misc(struct monst *);
+extern int rnd_misc_item(struct monst *);
+extern boolean searches_for_item(struct monst *, struct obj *);
+extern boolean mon_reflects(struct monst *, const char *);
+extern boolean ureflects(const char *, const char *);
+extern void mcureblindness(struct monst *, boolean);
+extern boolean munstone(struct monst *, boolean);
+extern boolean munslime(struct monst *, boolean);
/* ### music.c ### */
-E void FDECL(awaken_soldiers, (struct monst *));
-E int FDECL(do_play_instrument, (struct obj *));
+extern void awaken_soldiers(struct monst *);
+extern int do_play_instrument(struct obj *);
/* ### nhlan.c ### */
+
#ifdef LAN_FEATURES
-E void NDECL(init_lan_features);
-E char *NDECL(lan_username);
+extern void init_lan_features(void);
+extern char *lan_username(void);
#endif
/* ### nhlsel.c ### */
+
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
-E struct selectionvar *FDECL(l_selection_check, (lua_State *, int));
-E int FDECL(l_selection_register, (lua_State *));
+extern struct selectionvar *l_selection_check(lua_State *, int);
+extern int l_selection_register(lua_State *);
+extern void nhl_push_obj(lua_State *, struct obj *);
+extern int nhl_obj_u_giveobj(lua_State *);
+extern int l_obj_register(lua_State *);
#endif
/* ### nhlobj.c ### */
+
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
-E void FDECL(nhl_push_obj, (lua_State *, struct obj *));
-E int FDECL(nhl_obj_u_giveobj, (lua_State *));
-E int FDECL(l_obj_register, (lua_State *));
+extern void nhl_push_obj(lua_State *, struct obj *);
+extern int nhl_obj_u_giveobj(lua_State *);
+extern int l_obj_register(lua_State *);
#endif
/* ### nhlua.c ### */
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
-E lua_State * NDECL(nhl_init);
-E boolean FDECL(nhl_loadlua, (lua_State *, const char *));
-E boolean FDECL(load_lua, (const char *));
-E void FDECL(nhl_error, (lua_State *, const char *)) NORETURN;
-E void FDECL(lcheck_param_table, (lua_State *));
-E schar FDECL(get_table_mapchr, (lua_State *, const char *));
-E schar FDECL(get_table_mapchr_opt, (lua_State *, const char *, SCHAR_P));
-E void FDECL(nhl_add_table_entry_int, (lua_State *, const char *, int));
-E void FDECL(nhl_add_table_entry_char, (lua_State *, const char *, CHAR_P));
-E void FDECL(nhl_add_table_entry_str, (lua_State *, const char *, const char *));
-E schar FDECL(splev_chr2typ, (CHAR_P));
-E schar FDECL(check_mapchr, (const char *));
-E int FDECL(get_table_int, (lua_State *, const char *));
-E int FDECL(get_table_int_opt, (lua_State *, const char *, int));
-E char *FDECL(get_table_str, (lua_State *, const char *));
-E char *FDECL(get_table_str_opt, (lua_State *, const char *, char *));
-E int FDECL(get_table_boolean, (lua_State *, const char *));
-E int FDECL(get_table_boolean_opt, (lua_State *, const char *, int));
-E int FDECL(get_table_option, (lua_State *, const char *, const char *, const char *const *));
-E int FDECL(str_lines_max_width, (const char *));
-E char *FDECL(stripdigits, (char *));
-E const char *NDECL(get_lua_version);
+extern lua_State * nhl_init(void);
+extern boolean nhl_loadlua(lua_State *, const char *);
+extern boolean load_lua(const char *);
+extern void nhl_error(lua_State *, const char *) NORETURN;
+extern void lcheck_param_table(lua_State *);
+extern schar get_table_mapchr(lua_State *, const char *);
+extern schar get_table_mapchr_opt(lua_State *, const char *, schar);
+extern void nhl_add_table_entry_int(lua_State *, const char *, int);
+extern void nhl_add_table_entry_char(lua_State *, const char *, char);
+extern void nhl_add_table_entry_str(lua_State *, const char *, const char *);
+extern schar splev_chr2typ(char);
+extern schar check_mapchr(const char *);
+extern int get_table_int(lua_State *, const char *);
+extern int get_table_int_opt(lua_State *, const char *, int);
+extern char *get_table_str(lua_State *, const char *);
+extern char *get_table_str_opt(lua_State *, const char *, char *);
+extern int get_table_boolean(lua_State *, const char *);
+extern int get_table_boolean_opt(lua_State *, const char *, int);
+extern int get_table_option(lua_State *, const char *, const char *,
+ const char *const *);
+extern int str_lines_max_width(const char *);
+extern char *stripdigits(char *);
+extern const char *get_lua_version(void);
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
/* ### nhregex.c ### */
-E struct nhregex *NDECL(regex_init);
-E boolean FDECL(regex_compile, (const char *, struct nhregex *));
-E const char *FDECL(regex_error_desc, (struct nhregex *));
-E boolean FDECL(regex_match, (const char *, struct nhregex *));
-E void FDECL(regex_free, (struct nhregex *));
+extern struct nhregex *regex_init(void);
+extern boolean regex_compile(const char *, struct nhregex *);
+extern const char *regex_error_desc(struct nhregex *);
+extern boolean regex_match(const char *, struct nhregex *);
+extern void regex_free(struct nhregex *);
/* ### nttty.c ### */
#ifdef WIN32
-E void NDECL(get_scr_size);
-E int NDECL(nttty_kbhit);
-E void FDECL(nttty_open, (int));
-E void NDECL(nttty_rubout);
-E int NDECL(tgetch);
-E int FDECL(ntposkey, (int *, int *, int *));
-E void FDECL(set_output_mode, (int));
-E void NDECL(synch_cursor);
-E void NDECL(nethack_enter_nttty);
-E void NDECL(nttty_exit);
-#endif
+extern void get_scr_size(void);
+extern int nttty_kbhit(void);
+extern void nttty_open(int);
+extern void nttty_rubout(void);
+extern int tgetch(void);
+extern int ntposkey(int *, int *, int *);
+extern void set_output_mode(int);
+extern void synch_cursor(void);
+extern void nethack_enter_nttty(void);
+extern void nttty_exit(void);
+#endif /* WIN32 */
/* ### o_init.c ### */
-E void NDECL(init_objects);
-E void FDECL(obj_shuffle_range, (int, int *, int *));
-E int NDECL(find_skates);
-E boolean FDECL(objdescr_is, (struct obj *, const char *));
-E void NDECL(oinit);
-E void FDECL(savenames, (NHFILE *));
-E void FDECL(restnames, (NHFILE *));
-E void FDECL(discover_object, (int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(undiscover_object, (int));
-E int FDECL(choose_disco_sort, (int));
-E int NDECL(dodiscovered);
-E int NDECL(doclassdisco);
-E void NDECL(rename_disco);
+extern void init_objects(void);
+extern void obj_shuffle_range(int, int *, int *);
+extern int find_skates(void);
+extern boolean objdescr_is(struct obj *, const char *);
+extern void oinit(void);
+extern void savenames(NHFILE *);
+extern void restnames(NHFILE *);
+extern void discover_object(int, boolean, boolean);
+extern void undiscover_object(int);
+extern int choose_disco_sort(int);
+extern int dodiscovered(void);
+extern int doclassdisco(void);
+extern void rename_disco(void);
/* ### objects.c ### */
-E void NDECL(objects_globals_init);
+extern void objects_globals_init(void);
/* ### objnam.c ### */
-E char *FDECL(obj_typename, (int));
-E char *FDECL(simple_typename, (int));
-E char *FDECL(safe_typename, (int));
-E boolean FDECL(obj_is_pname, (struct obj *));
-E char *FDECL(distant_name, (struct obj *, char *(*)(OBJ_P)));
-E char *FDECL(fruitname, (BOOLEAN_P));
-E struct fruit *FDECL(fruit_from_indx, (int));
-E struct fruit *FDECL(fruit_from_name, (const char *, BOOLEAN_P, int *));
-E void FDECL(reorder_fruit, (BOOLEAN_P));
-E char *FDECL(xname, (struct obj *));
-E char *FDECL(mshot_xname, (struct obj *));
-E boolean FDECL(the_unique_obj, (struct obj *));
-E boolean FDECL(the_unique_pm, (struct permonst *));
-E boolean FDECL(erosion_matters, (struct obj *));
-E char *FDECL(doname, (struct obj *));
-E char *FDECL(doname_with_price, (struct obj *));
-E char *FDECL(doname_vague_quan, (struct obj *));
-E boolean FDECL(not_fully_identified, (struct obj *));
-E char *FDECL(corpse_xname, (struct obj *, const char *, unsigned));
-E char *FDECL(cxname, (struct obj *));
-E char *FDECL(cxname_singular, (struct obj *));
-E char *FDECL(killer_xname, (struct obj *));
-E char *FDECL(short_oname,
- (struct obj *, char *(*)(OBJ_P), char *(*)(OBJ_P), unsigned));
-E const char *FDECL(singular, (struct obj *, char *(*)(OBJ_P)));
-E char *FDECL(just_an, (char *, const char *));
-E char *FDECL(an, (const char *));
-E char *FDECL(An, (const char *));
-E char *FDECL(The, (const char *));
-E char *FDECL(the, (const char *));
-E char *FDECL(aobjnam, (struct obj *, const char *));
-E char *FDECL(yobjnam, (struct obj *, const char *));
-E char *FDECL(Yobjnam2, (struct obj *, const char *));
-E char *FDECL(Tobjnam, (struct obj *, const char *));
-E char *FDECL(otense, (struct obj *, const char *));
-E char *FDECL(vtense, (const char *, const char *));
-E char *FDECL(Doname2, (struct obj *));
-E char *FDECL(yname, (struct obj *));
-E char *FDECL(Yname2, (struct obj *));
-E char *FDECL(ysimple_name, (struct obj *));
-E char *FDECL(Ysimple_name2, (struct obj *));
-E char *FDECL(simpleonames, (struct obj *));
-E char *FDECL(ansimpleoname, (struct obj *));
-E char *FDECL(thesimpleoname, (struct obj *));
-E char *FDECL(bare_artifactname, (struct obj *));
-E char *FDECL(makeplural, (const char *));
-E char *FDECL(makesingular, (const char *));
-E struct obj *FDECL(readobjnam, (char *, struct obj *));
-E int FDECL(rnd_class, (int, int));
-E const char *FDECL(suit_simple_name, (struct obj *));
-E const char *FDECL(cloak_simple_name, (struct obj *));
-E const char *FDECL(helm_simple_name, (struct obj *));
-E const char *FDECL(gloves_simple_name, (struct obj *));
-E const char *FDECL(boots_simple_name, (struct obj *));
-E const char *FDECL(shield_simple_name, (struct obj *));
-E const char *FDECL(shirt_simple_name, (struct obj *));
-E const char *FDECL(mimic_obj_name, (struct monst *));
-E char *FDECL(safe_qbuf, (char *, const char *, const char *, struct obj *,
- char *(*)(OBJ_P), char *(*)(OBJ_P), const char *));
-E int FDECL(shiny_obj, (CHAR_P));
+extern char *obj_typename(int);
+extern char *simple_typename(int);
+extern char *safe_typename(int);
+extern boolean obj_is_pname(struct obj *);
+extern char *distant_name(struct obj *, char *(*)(struct obj *));
+extern char *fruitname(boolean);
+extern struct fruit *fruit_from_indx(int);
+extern struct fruit *fruit_from_name(const char *, boolean, int *);
+extern void reorder_fruit(boolean);
+extern char *xname(struct obj *);
+extern char *mshot_xname(struct obj *);
+extern boolean the_unique_obj(struct obj *);
+extern boolean the_unique_pm(struct permonst *);
+extern boolean erosion_matters(struct obj *);
+extern char *doname(struct obj *);
+extern char *doname_with_price(struct obj *);
+extern char *doname_vague_quan(struct obj *);
+extern boolean not_fully_identified(struct obj *);
+extern char *corpse_xname(struct obj *, const char *, unsigned);
+extern char *cxname(struct obj *);
+extern char *cxname_singular(struct obj *);
+extern char *killer_xname(struct obj *);
+extern char *short_oname(struct obj *, char *(*)(struct obj *),
+ char *(*)(struct obj *), unsigned);
+extern const char *singular(struct obj *, char *(*)(struct obj *));
+extern char *just_an(char *, const char *);
+extern char *an(const char *);
+extern char *An(const char *);
+extern char *The(const char *);
+extern char *the(const char *);
+extern char *aobjnam(struct obj *, const char *);
+extern char *yobjnam(struct obj *, const char *);
+extern char *Yobjnam2(struct obj *, const char *);
+extern char *Tobjnam(struct obj *, const char *);
+extern char *otense(struct obj *, const char *);
+extern char *vtense(const char *, const char *);
+extern char *Doname2(struct obj *);
+extern char *yname(struct obj *);
+extern char *Yname2(struct obj *);
+extern char *ysimple_name(struct obj *);
+extern char *Ysimple_name2(struct obj *);
+extern char *simpleonames(struct obj *);
+extern char *ansimpleoname(struct obj *);
+extern char *thesimpleoname(struct obj *);
+extern char *bare_artifactname(struct obj *);
+extern char *makeplural(const char *);
+extern char *makesingular(const char *);
+extern struct obj *readobjnam(char *, struct obj *);
+extern int rnd_class(int, int);
+extern const char *suit_simple_name(struct obj *);
+extern const char *cloak_simple_name(struct obj *);
+extern const char *helm_simple_name(struct obj *);
+extern const char *gloves_simple_name(struct obj *);
+extern const char *boots_simple_name(struct obj *);
+extern const char *shield_simple_name(struct obj *);
+extern const char *shirt_simple_name(struct obj *);
+extern const char *mimic_obj_name(struct monst *);
+extern char *safe_qbuf(char *, const char *, const char *, struct obj *,
+ char *(*)(struct obj *), char *(*)(struct obj *),
+ const char *);
+extern int shiny_obj(char);
/* ### options.c ### */
-E boolean FDECL(match_optname, (const char *, const char *, int, BOOLEAN_P));
-E void NDECL(initoptions);
-E void NDECL(initoptions_init);
-E void NDECL(initoptions_finish);
-E boolean FDECL(parseoptions, (char *, BOOLEAN_P, BOOLEAN_P));
-E int NDECL(doset);
-E int NDECL(dotogglepickup);
-E void NDECL(option_help);
-E void FDECL(next_opt, (winid, const char *));
-E int FDECL(fruitadd, (char *, struct fruit *));
-E int FDECL(choose_classes_menu, (const char *, int, BOOLEAN_P,
- char *, char *));
-E boolean FDECL(parsebindings, (char *));
-E void FDECL(oc_to_str, (char *, char *));
-E void FDECL(add_menu_cmd_alias, (CHAR_P, CHAR_P));
-E char FDECL(get_menu_cmd_key, (CHAR_P));
-E char FDECL(map_menu_cmd, (CHAR_P));
-E void FDECL(show_menu_controls, (winid, BOOLEAN_P));
-E void FDECL(assign_warnings, (uchar *));
-E char *FDECL(nh_getenv, (const char *));
-E void NDECL(reset_duplicate_opt_detection);
-E void FDECL(set_wc_option_mod_status, (unsigned long, int));
-E void FDECL(set_wc2_option_mod_status, (unsigned long, int));
-E void FDECL(set_option_mod_status, (const char *, int));
-E int FDECL(add_autopickup_exception, (const char *));
-E void NDECL(free_autopickup_exceptions);
-E int FDECL(load_symset, (const char *, int));
-E void NDECL(free_symsets);
-E boolean FDECL(parsesymbols, (char *, int));
-E struct symparse *FDECL(match_sym, (char *));
-E void NDECL(set_playmode);
-E int FDECL(sym_val, (const char *));
-E int FDECL(query_color, (const char *));
-E int FDECL(query_attr, (const char *));
-E const char *FDECL(clr2colorname, (int));
-E int FDECL(match_str2clr, (char *));
-E int FDECL(match_str2attr, (const char *, BOOLEAN_P));
-E boolean FDECL(add_menu_coloring, (char *));
-E boolean FDECL(get_menu_coloring, (const char *, int *, int *));
-E void NDECL(free_menu_coloring);
-E boolean FDECL(msgtype_parse_add, (char *));
-E int FDECL(msgtype_type, (const char *, BOOLEAN_P));
-E void FDECL(hide_unhide_msgtypes, (BOOLEAN_P, int));
-E void NDECL(msgtype_free);
+extern boolean match_optname(const char *, const char *, int, boolean);
+extern void initoptions(void);
+extern void initoptions_init(void);
+extern void initoptions_finish(void);
+extern boolean parseoptions(char *, boolean, boolean);
+extern int doset(void);
+extern int dotogglepickup(void);
+extern void option_help(void);
+extern void next_opt(winid, const char *);
+extern int fruitadd(char *, struct fruit *);
+extern int choose_classes_menu(const char *, int, boolean, char *, char *);
+extern boolean parsebindings(char *);
+extern void oc_to_str(char *, char *);
+extern void add_menu_cmd_alias(char, char);
+extern char get_menu_cmd_key(char);
+extern char map_menu_cmd(char);
+extern void show_menu_controls(winid, boolean);
+extern void assign_warnings(uchar *);
+extern char *nh_getenv(const char *);
+extern void reset_duplicate_opt_detection(void);
+extern void set_wc_option_mod_status(unsigned long, int);
+extern void set_wc2_option_mod_status(unsigned long, int);
+extern void set_option_mod_status(const char *, int);
+extern int add_autopickup_exception(const char *);
+extern void free_autopickup_exceptions(void);
+extern int load_symset(const char *, int);
+extern void free_symsets(void);
+extern boolean parsesymbols(char *, int);
+extern struct symparse *match_sym(char *);
+extern void set_playmode(void);
+extern int sym_val(const char *);
+extern int query_color(const char *);
+extern int query_attr(const char *);
+extern const char *clr2colorname(int);
+extern int match_str2clr(char *);
+extern int match_str2attr(const char *, boolean);
+extern boolean add_menu_coloring(char *);
+extern boolean get_menu_coloring(const char *, int *, int *);
+extern void free_menu_coloring(void);
+extern boolean msgtype_parse_add(char *);
+extern int msgtype_type(const char *, boolean);
+extern void hide_unhide_msgtypes(boolean, int);
+extern void msgtype_free(void);
/* ### pager.c ### */
-E char *FDECL(self_lookat, (char *));
-E char *FDECL(monhealthdescr, (struct monst *mon, BOOLEAN_P, char *));
-E void FDECL(mhidden_description, (struct monst *, BOOLEAN_P, char *));
-E boolean FDECL(object_from_map, (int,int,int,struct obj **));
-E int FDECL(do_screen_description, (coord, BOOLEAN_P, int, char *,
- const char **, struct permonst **));
-E int FDECL(do_look, (int, coord *));
-E int NDECL(dowhatis);
-E int NDECL(doquickwhatis);
-E int NDECL(doidtrap);
-E int NDECL(dowhatdoes);
-E char *FDECL(dowhatdoes_core, (CHAR_P, char *));
-E int NDECL(dohelp);
-E int NDECL(dohistory);
+extern char *self_lookat(char *);
+extern char *monhealthdescr(struct monst *mon, boolean, char *);
+extern void mhidden_description(struct monst *, boolean, char *);
+extern boolean object_from_map(int,int,int,struct obj **);
+extern int do_screen_description(coord, boolean, int, char *, const char **,
+ struct permonst **);
+extern int do_look(int, coord *);
+extern int dowhatis(void);
+extern int doquickwhatis(void);
+extern int doidtrap(void);
+extern int dowhatdoes(void);
+extern char *dowhatdoes_core(char, char *);
+extern int dohelp(void);
+extern int dohistory(void);
/* ### xxmain.c ### */
#if defined(MICRO) || defined(WIN32)
#ifdef CHDIR
-E void FDECL(chdirx, (char *, BOOLEAN_P));
+extern void chdirx(char *, boolean);
#endif /* CHDIR */
-E boolean NDECL(authorize_wizard_mode);
-#endif /* MICRO || WIN32 */
+extern boolean authorize_wizard_mode(void);
+#endif
#if defined(WIN32)
-E int NDECL(getlock);
-E const char *NDECL(get_portable_device);
+extern int getlock(void);
+extern const char *get_portable_device(void);
#endif
/* ### pcsys.c ### */
#if defined(MICRO) || defined(WIN32)
-E void NDECL(flushout);
-E int NDECL(dosh);
-E void FDECL(append_slash, (char *));
-E void FDECL(getreturn, (const char *));
+extern void flushout(void);
+extern int dosh(void);
+extern void append_slash(char *);
+extern void getreturn(const char *);
#ifndef AMIGA
-E void VDECL(msmsg, (const char *, ...));
+extern void msmsg(const char *, ...);
#endif
-E FILE *FDECL(fopenp, (const char *, const char *));
-#endif /* MICRO || WIN32 */
+/* E FILE *fopenp(const char *, const char *); */
+#endif /* MICRO || WIN2 */
/* ### pctty.c ### */
#if defined(MICRO) || defined(WIN32)
-E void NDECL(gettty);
-E void FDECL(settty, (const char *));
-E void NDECL(setftty);
-E void VDECL(error, (const char *, ...));
+extern void gettty(void);
+extern void settty(const char *);
+extern void setftty(void);
+extern void error(const char *, ...);
#if defined(TIMED_DELAY) && defined(_MSC_VER)
-E void FDECL(msleep, (unsigned));
+extern void msleep(unsigned);
#endif
#endif /* MICRO || WIN32 */
/* ### pcunix.c ### */
-
#if defined(MICRO)
-E void FDECL(regularize, (char *));
+extern void regularize(char *);
#if defined(PC_LOCKING)
-E void NDECL(getlock);
+extern void getlock(void);
#endif
#endif /* MICRO */
/* ### pickup.c ### */
-E int FDECL(collect_obj_classes, (char *, struct obj *, BOOLEAN_P,
- boolean FDECL((*), (OBJ_P)), int *));
-E boolean FDECL(rider_corpse_revival, (struct obj *, BOOLEAN_P));
-E void FDECL(deferred_decor, (BOOLEAN_P));
-E boolean FDECL(menu_class_present, (int));
-E void FDECL(add_valid_menu_class, (int));
-E boolean FDECL(allow_all, (struct obj *));
-E boolean FDECL(allow_category, (struct obj *));
-E boolean FDECL(is_worn_by_type, (struct obj *));
-E int FDECL(ck_bag, (struct obj *));
-E void FDECL(removed_from_icebox, (struct obj *));
-E int FDECL(pickup, (int));
-E int FDECL(pickup_object, (struct obj *, long, BOOLEAN_P));
-E int FDECL(query_category, (const char *, struct obj *, int,
- menu_item **, int));
-E int FDECL(query_objlist, (const char *, struct obj **, int,
- menu_item **, int, boolean (*)(OBJ_P)));
-E struct obj *FDECL(pick_obj, (struct obj *));
-E int NDECL(encumber_msg);
-E int FDECL(container_at, (int, int, BOOLEAN_P));
-E int NDECL(doloot);
-E void FDECL(observe_quantum_cat, (struct obj *, BOOLEAN_P, BOOLEAN_P));
-E boolean FDECL(container_gone, (int (*)(OBJ_P)));
-E boolean NDECL(u_handsy);
-E int FDECL(use_container, (struct obj **, int, BOOLEAN_P));
-E int FDECL(loot_mon, (struct monst *, int *, boolean *));
-E int NDECL(dotip);
-E struct autopickup_exception *FDECL(check_autopickup_exceptions, (struct obj *));
-E boolean FDECL(autopick_testobj, (struct obj *, BOOLEAN_P));
+extern int collect_obj_classes(char *, struct obj *, boolean,
+ boolean(*)(struct obj *), int *);
+extern boolean rider_corpse_revival(struct obj *, boolean);
+extern void deferred_decor(boolean);
+extern boolean menu_class_present(int);
+extern void add_valid_menu_class(int);
+extern boolean allow_all(struct obj *);
+extern boolean allow_category(struct obj *);
+extern boolean is_worn_by_type(struct obj *);
+extern int ck_bag(struct obj *);
+extern void removed_from_icebox(struct obj *);
+extern int pickup(int);
+extern int pickup_object(struct obj *, long, boolean);
+extern int query_category(const char *, struct obj *, int, menu_item **, int);
+extern int query_objlist(const char *, struct obj **, int, menu_item **, int,
+ boolean(*)(struct obj *));
+extern struct obj *pick_obj(struct obj *);
+extern int encumber_msg(void);
+extern int container_at(int, int, boolean);
+extern int doloot(void);
+extern void observe_quantum_cat(struct obj *, boolean, boolean);
+extern boolean container_gone(int(*)(struct obj *));
+extern boolean u_handsy(void);
+extern int use_container(struct obj **, int, boolean);
+extern int loot_mon(struct monst *, int *, boolean *);
+extern int dotip(void);
+extern struct autopickup_exception *check_autopickup_exceptions(struct obj *);
+extern boolean autopick_testobj(struct obj *, boolean);
/* ### pline.c ### */
#ifdef DUMPLOG
-E void FDECL(dumplogmsg, (const char *));
-E void NDECL(dumplogfreemessages);
-#endif
-E void VDECL(pline, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(custompline, (unsigned, const char *, ...)) PRINTF_F(2, 3);
-E void VDECL(Norep, (const char *, ...)) PRINTF_F(1, 2);
-E void NDECL(free_youbuf);
-E void VDECL(You, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(Your, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(You_feel, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(You_cant, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(You_hear, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(You_see, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(pline_The, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(There, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(verbalize, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(raw_printf, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(impossible, (const char *, ...)) PRINTF_F(1, 2);
-E void VDECL(config_error_add, (const char *, ...)) PRINTF_F(1, 2);
-E void FDECL(nhassert_failed, (const char *, const char *, int));
+extern void dumplogmsg(const char *);
+extern void dumplogfreemessages(void);
+#endif
+extern void pline(const char *, ...);
+extern void custompline(unsigned, const char *, ...);
+extern void Norep(const char *, ...);
+extern void free_youbuf(void);
+extern void You(const char *, ...);
+extern void Your(const char *, ...);
+extern void You_feel(const char *, ...);
+extern void You_cant(const char *, ...);
+extern void You_hear(const char *, ...);
+extern void You_see(const char *, ...);
+extern void pline_The(const char *, ...);
+extern void There(const char *, ...);
+extern void verbalize(const char *, ...);
+extern void raw_printf(const char *, ...);
+extern void impossible(const char *, ...);
+extern void config_error_add(const char *, ...);
+extern void nhassert_failed(const char *, const char *, int);
/* ### polyself.c ### */
-E void NDECL(set_uasmon);
-E void NDECL(float_vs_flight);
-E void NDECL(change_sex);
-E void FDECL(polyself, (int));
-E int FDECL(polymon, (int));
-E void NDECL(rehumanize);
-E int NDECL(dobreathe);
-E int NDECL(dospit);
-E int NDECL(doremove);
-E int NDECL(dospinweb);
-E int NDECL(dosummon);
-E int NDECL(dogaze);
-E int NDECL(dohide);
-E int NDECL(dopoly);
-E int NDECL(domindblast);
-E void NDECL(uunstick);
-E void FDECL(skinback, (BOOLEAN_P));
-E const char *FDECL(mbodypart, (struct monst *, int));
-E const char *FDECL(body_part, (int));
-E int NDECL(poly_gender);
-E void FDECL(ugolemeffects, (int, int));
-E boolean NDECL(ugenocided);
-E const char *NDECL(udeadinside);
+extern void set_uasmon(void);
+extern void float_vs_flight(void);
+extern void change_sex(void);
+extern void polyself(int);
+extern int polymon(int);
+extern void rehumanize(void);
+extern int dobreathe(void);
+extern int dospit(void);
+extern int doremove(void);
+extern int dospinweb(void);
+extern int dosummon(void);
+extern int dogaze(void);
+extern int dohide(void);
+extern int dopoly(void);
+extern int domindblast(void);
+extern void uunstick(void);
+extern void skinback(boolean);
+extern const char *mbodypart(struct monst *, int);
+extern const char *body_part(int);
+extern int poly_gender(void);
+extern void ugolemeffects(int, int);
+extern boolean ugenocided(void);
+extern const char *udeadinside(void);
/* ### potion.c ### */
-E void FDECL(set_itimeout, (long *, long));
-E void FDECL(incr_itimeout, (long *, int));
-E void FDECL(make_confused, (long, BOOLEAN_P));
-E void FDECL(make_stunned, (long, BOOLEAN_P));
-E void FDECL(make_sick, (long, const char *, BOOLEAN_P, int));
-E void FDECL(make_slimed, (long, const char *));
-E void FDECL(make_stoned, (long, const char *, int, const char *));
-E void FDECL(make_vomiting, (long, BOOLEAN_P));
-E void FDECL(make_blinded, (long, BOOLEAN_P));
-E void NDECL(toggle_blindness);
-E boolean FDECL(make_hallucinated, (long, BOOLEAN_P, long));
-E void FDECL(make_deaf, (long, BOOLEAN_P));
-E void FDECL(make_glib, (int));
-E void NDECL(self_invis_message);
-E int NDECL(dodrink);
-E int FDECL(dopotion, (struct obj *));
-E int FDECL(peffects, (struct obj *));
-E void FDECL(healup, (int, int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(strange_feeling, (struct obj *, const char *));
-E void FDECL(potionhit, (struct monst *, struct obj *, int));
-E void FDECL(potionbreathe, (struct obj *));
-E int NDECL(dodip);
-E void FDECL(mongrantswish, (struct monst **));
-E void FDECL(djinni_from_bottle, (struct obj *));
-E struct monst *FDECL(split_mon, (struct monst *, struct monst *));
-E const char *NDECL(bottlename);
+extern void set_itimeout(long *, long);
+extern void incr_itimeout(long *, int);
+extern void make_confused(long, boolean);
+extern void make_stunned(long, boolean);
+extern void make_sick(long, const char *, boolean, int);
+extern void make_slimed(long, const char *);
+extern void make_stoned(long, const char *, int, const char *);
+extern void make_vomiting(long, boolean);
+extern void make_blinded(long, boolean);
+extern void toggle_blindness(void);
+extern boolean make_hallucinated(long, boolean, long);
+extern void make_deaf(long, boolean);
+extern void make_glib(int);
+extern void self_invis_message(void);
+extern int dodrink(void);
+extern int dopotion(struct obj *);
+extern int peffects(struct obj *);
+extern void healup(int, int, boolean, boolean);
+extern void strange_feeling(struct obj *, const char *);
+extern void potionhit(struct monst *, struct obj *, int);
+extern void potionbreathe(struct obj *);
+extern int dodip(void);
+extern void mongrantswish(struct monst **);
+extern void djinni_from_bottle(struct obj *);
+extern struct monst *split_mon(struct monst *, struct monst *);
+extern const char *bottlename(void);
/* ### pray.c ### */
-E boolean FDECL(critically_low_hp, (BOOLEAN_P));
-E boolean NDECL(stuck_in_wall);
-E int NDECL(dosacrifice);
-E boolean FDECL(can_pray, (BOOLEAN_P));
-E int NDECL(dopray);
-E const char *NDECL(u_gname);
-E int NDECL(doturn);
-E int FDECL(altarmask_at, (int, int));
-E const char *NDECL(a_gname);
-E const char *FDECL(a_gname_at, (XCHAR_P x, XCHAR_P y));
-E const char *FDECL(align_gname, (ALIGNTYP_P));
-E const char *FDECL(halu_gname, (ALIGNTYP_P));
-E const char *FDECL(align_gtitle, (ALIGNTYP_P));
-E void FDECL(altar_wrath, (int, int));
+extern boolean critically_low_hp(boolean);
+extern boolean stuck_in_wall(void);
+extern int dosacrifice(void);
+extern boolean can_pray(boolean);
+extern int dopray(void);
+extern const char *u_gname(void);
+extern int doturn(void);
+extern int altarmask_at(int, int);
+extern const char *a_gname(void);
+extern const char *a_gname_at(xchar x, xchar y);
+extern const char *align_gname(aligntyp);
+extern const char *halu_gname(aligntyp);
+extern const char *align_gtitle(aligntyp);
+extern void altar_wrath(int, int);
/* ### priest.c ### */
-E int FDECL(move_special, (struct monst *, BOOLEAN_P, SCHAR_P, BOOLEAN_P,
- BOOLEAN_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P));
-E char FDECL(temple_occupied, (char *));
-E boolean FDECL(inhistemple, (struct monst *));
-E int FDECL(pri_move, (struct monst *));
-E void FDECL(priestini, (d_level *, struct mkroom *, int, int, BOOLEAN_P));
-E aligntyp FDECL(mon_aligntyp, (struct monst *));
-E char *FDECL(priestname, (struct monst *, char *));
-E boolean FDECL(p_coaligned, (struct monst *));
-E struct monst *FDECL(findpriest, (CHAR_P));
-E void FDECL(intemple, (int));
-E void FDECL(forget_temple_entry, (struct monst *));
-E void FDECL(priest_talk, (struct monst *));
-E struct monst *FDECL(mk_roamer, (struct permonst *, ALIGNTYP_P, XCHAR_P,
- XCHAR_P, BOOLEAN_P));
-E void FDECL(reset_hostility, (struct monst *));
-E boolean FDECL(in_your_sanctuary, (struct monst *, XCHAR_P, XCHAR_P));
-E void FDECL(ghod_hitsu, (struct monst *));
-E void NDECL(angry_priest);
-E void NDECL(clearpriests);
-E void FDECL(restpriest, (struct monst *, BOOLEAN_P));
-E void FDECL(newepri, (struct monst *));
-E void FDECL(free_epri, (struct monst *));
+extern int move_special(struct monst *, boolean, schar, boolean, boolean,
+ xchar, xchar, xchar, xchar);
+extern char temple_occupied(char *);
+extern boolean inhistemple(struct monst *);
+extern int pri_move(struct monst *);
+extern void priestini(d_level *, struct mkroom *, int, int, boolean);
+extern aligntyp mon_aligntyp(struct monst *);
+extern char *priestname(struct monst *, char *);
+extern boolean p_coaligned(struct monst *);
+extern struct monst *findpriest(char);
+extern void intemple(int);
+extern void forget_temple_entry(struct monst *);
+extern void priest_talk(struct monst *);
+extern struct monst *mk_roamer(struct permonst *, aligntyp, xchar, xchar,
+ boolean);
+extern void reset_hostility(struct monst *);
+extern boolean in_your_sanctuary(struct monst *, xchar, xchar);
+extern void ghod_hitsu(struct monst *);
+extern void angry_priest(void);
+extern void clearpriests(void);
+extern void restpriest(struct monst *, boolean);
+extern void newepri(struct monst *);
+extern void free_epri(struct monst *);
/* ### quest.c ### */
-E void NDECL(onquest);
-E void NDECL(nemdead);
-E void FDECL(artitouch, (struct obj *));
-E boolean NDECL(ok_to_quest);
-E void FDECL(leader_speaks, (struct monst *));
-E void NDECL(nemesis_speaks);
-E void FDECL(quest_chat, (struct monst *));
-E void FDECL(quest_talk, (struct monst *));
-E void FDECL(quest_stat_check, (struct monst *));
-E void FDECL(finish_quest, (struct obj *));
+extern void onquest(void);
+extern void nemdead(void);
+extern void artitouch(struct obj *);
+extern boolean ok_to_quest(void);
+extern void leader_speaks(struct monst *);
+extern void nemesis_speaks(void);
+extern void quest_chat(struct monst *);
+extern void quest_talk(struct monst *);
+extern void quest_stat_check(struct monst *);
+extern void finish_quest(struct obj *);
/* ### questpgr.c ### */
-E void NDECL(load_qtlist);
-E void NDECL(unload_qtlist);
-E short FDECL(quest_info, (int));
-E const char *NDECL(ldrname);
-E boolean FDECL(is_quest_artifact, (struct obj *));
-E struct obj *FDECL(find_quest_artifact, (unsigned));
-E void FDECL(com_pager, (const char *));
-E void FDECL(qt_pager, (const char *));
-E struct permonst *NDECL(qt_montype);
-E void NDECL(deliver_splev_message);
-
+extern void load_qtlist(void);
+extern void unload_qtlist(void);
+extern short quest_info(int);
+extern const char *ldrname(void);
+extern boolean is_quest_artifact(struct obj *);
+extern struct obj *find_quest_artifact(unsigned);
+extern void com_pager(const char *);
+extern void qt_pager(const char *);
+extern struct permonst *qt_montype(void);
+extern void deliver_splev_message(void);
/* ### random.c ### */
#if defined(RANDOM) && !defined(__GO32__) /* djgpp has its own random */
#ifndef CROSS_TO_AMIGA
-E void FDECL(srandom, (unsigned));
-E char *FDECL(initstate, (unsigned, char *, int));
-E char *FDECL(setstate, (char *));
-E long NDECL(random);
-#endif
+extern void srandom(unsigned);
+extern char *initstate(unsigned, char *, int);
+extern char *setstate(char *);
+extern long random(void);
+#endif /* CROSS_TO_AMIGA */
#endif /* RANDOM */
/* ### read.c ### */
-E void FDECL(learnscroll, (struct obj *));
-E char *FDECL(tshirt_text, (struct obj *, char *));
-E char *FDECL(apron_text, (struct obj *, char *));
-E const char *FDECL(candy_wrapper_text, (struct obj *));
-E void FDECL(assign_candy_wrapper, (struct obj *));
-E int NDECL(doread);
-E int FDECL(charge_ok, (struct obj *));
-E void FDECL(recharge, (struct obj *, int));
-E int FDECL(seffects, (struct obj *));
-E void FDECL(drop_boulder_on_player,
- (BOOLEAN_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-E boolean FDECL(drop_boulder_on_monster, (int, int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(wand_explode, (struct obj *, int));
-E void FDECL(litroom, (BOOLEAN_P, struct obj *));
-E void FDECL(do_genocide, (int));
-E void FDECL(punish, (struct obj *));
-E void NDECL(unpunish);
-E boolean FDECL(cant_revive, (int *, BOOLEAN_P, struct obj *));
-E boolean NDECL(create_particular);
+extern void learnscroll(struct obj *);
+extern char *tshirt_text(struct obj *, char *);
+extern char *apron_text(struct obj *, char *);
+extern const char *candy_wrapper_text(struct obj *);
+extern void assign_candy_wrapper(struct obj *);
+extern int doread(void);
+extern int charge_ok(struct obj *);
+extern void recharge(struct obj *, int);
+extern int seffects(struct obj *);
+extern void drop_boulder_on_player(boolean, boolean, boolean, boolean);
+extern boolean drop_boulder_on_monster(int, int, boolean, boolean);
+extern void wand_explode(struct obj *, int);
+extern void litroom(boolean, struct obj *);
+extern void do_genocide(int);
+extern void punish(struct obj *);
+extern void unpunish(void);
+extern boolean cant_revive(int *, boolean, struct obj *);
+extern boolean create_particular(void);
/* ### rect.c ### */
-E void NDECL(init_rect);
-E NhRect *FDECL(get_rect, (NhRect *));
-E NhRect *NDECL(rnd_rect);
-E void FDECL(remove_rect, (NhRect *));
-E void FDECL(add_rect, (NhRect *));
-E void FDECL(split_rects, (NhRect *, NhRect *));
+extern void init_rect(void);
+extern NhRect *get_rect(NhRect *);
+extern NhRect *rnd_rect(void);
+extern void remove_rect(NhRect *);
+extern void add_rect(NhRect *);
+extern void split_rects(NhRect *, NhRect *);
/* ## region.c ### */
-E void NDECL(clear_regions);
-E void NDECL(run_regions);
-E boolean FDECL(in_out_region, (XCHAR_P, XCHAR_P));
-E boolean FDECL(m_in_out_region, (struct monst *, XCHAR_P, XCHAR_P));
-E void NDECL(update_player_regions);
-E void FDECL(update_monster_region, (struct monst *));
-E NhRegion *FDECL(visible_region_at, (XCHAR_P, XCHAR_P));
-E void FDECL(show_region, (NhRegion *, XCHAR_P, XCHAR_P));
-E void FDECL(save_regions, (NHFILE *));
-E void FDECL(rest_regions, (NHFILE *));
-E void FDECL(region_stats, (const char *, char *, long *, long *));
-E NhRegion *FDECL(create_gas_cloud, (XCHAR_P, XCHAR_P, int, int));
-E boolean NDECL(region_danger);
-E void NDECL(region_safety);
+
+extern void clear_regions(void);
+extern void run_regions(void);
+extern boolean in_out_region(xchar, xchar);
+extern boolean m_in_out_region(struct monst *, xchar, xchar);
+extern void update_player_regions(void);
+extern void update_monster_region(struct monst *);
+extern NhRegion *visible_region_at(xchar, xchar);
+extern void show_region(NhRegion *, xchar, xchar);
+extern void save_regions(NHFILE *);
+extern void rest_regions(NHFILE *);
+extern void region_stats(const char *, char *, long *, long *);
+extern NhRegion *create_gas_cloud(xchar, xchar, int, int);
+extern boolean region_danger(void);
+extern void region_safety(void);
/* ### restore.c ### */
-E void FDECL(inven_inuse, (BOOLEAN_P));
-E int FDECL(dorecover, (NHFILE *));
-E void FDECL(restcemetery, (NHFILE *, struct cemetery **));
-E void FDECL(trickery, (char *));
-E void FDECL(getlev, (NHFILE *, int, XCHAR_P));
-E void FDECL(get_plname_from_file, (NHFILE *, char *));
+extern void inven_inuse(boolean);
+extern int dorecover(NHFILE *);
+extern void restcemetery(NHFILE *, struct cemetery **);
+extern void trickery(char *);
+extern void getlev(NHFILE *, int, xchar);
+extern void get_plname_from_file(NHFILE *, char *);
#ifdef SELECTSAVED
-E int FDECL(restore_menu, (winid));
+extern int restore_menu(winid);
#endif
-E void NDECL(minit);
-E boolean FDECL(lookup_id_mapping, (unsigned, unsigned *));
-E int FDECL(validate, (NHFILE *, const char *));
-E void NDECL(reset_restpref);
-E void FDECL(set_restpref, (const char *));
-E void FDECL(set_savepref, (const char *));
+extern void minit(void);
+extern boolean lookup_id_mapping(unsigned, unsigned *);
+extern int validate(NHFILE *, const char *);
+extern void reset_restpref(void);
+extern void set_restpref(const char *);
+extern void set_savepref(const char *);
/* ### rip.c ### */
-E void FDECL(genl_outrip, (winid, int, time_t));
+extern void genl_outrip(winid, int, time_t);
/* ### rnd.c ### */
#ifdef USE_ISAAC64
-E void FDECL(init_isaac64, (unsigned long, int FDECL((*fn), (int))));
-E long NDECL(nhrand);
+extern void init_isaac64(unsigned long, int(*fn)(int));
+extern long nhrand(void);
#endif
-E int FDECL(rn2, (int));
-E int FDECL(rn2_on_display_rng, (int));
-E int FDECL(rnl, (int));
-E int FDECL(rnd, (int));
-E int FDECL(d, (int, int));
-E int FDECL(rne, (int));
-E int FDECL(rnz, (int));
+extern int rn2(int);
+extern int rn2_on_display_rng(int);
+extern int rnl(int);
+extern int rnd(int);
+extern int d(int, int);
+extern int rne(int);
+extern int rnz(int);
/* ### role.c ### */
-E boolean FDECL(validrole, (int));
-E boolean FDECL(validrace, (int, int));
-E boolean FDECL(validgend, (int, int, int));
-E boolean FDECL(validalign, (int, int, int));
-E int FDECL(randrole, (BOOLEAN_P));
-E int FDECL(randrace, (int));
-E int FDECL(randgend, (int, int));
-E int FDECL(randalign, (int, int));
-E int FDECL(str2role, (const char *));
-E int FDECL(str2race, (const char *));
-E int FDECL(str2gend, (const char *));
-E int FDECL(str2align, (const char *));
-E boolean FDECL(ok_role, (int, int, int, int));
-E int FDECL(pick_role, (int, int, int, int));
-E boolean FDECL(ok_race, (int, int, int, int));
-E int FDECL(pick_race, (int, int, int, int));
-E boolean FDECL(ok_gend, (int, int, int, int));
-E int FDECL(pick_gend, (int, int, int, int));
-E boolean FDECL(ok_align, (int, int, int, int));
-E int FDECL(pick_align, (int, int, int, int));
-E void NDECL(rigid_role_checks);
-E boolean FDECL(setrolefilter, (const char *));
-E boolean NDECL(gotrolefilter);
-E void NDECL(clearrolefilter);
-E char *FDECL(build_plselection_prompt, (char *, int, int, int, int, int));
-E char *FDECL(root_plselection_prompt, (char *, int, int, int, int, int));
-E void NDECL(plnamesuffix);
-E void FDECL(role_selection_prolog, (int, winid));
-E void FDECL(role_menu_extra, (int, winid, BOOLEAN_P));
-E void NDECL(role_init);
-E const char *FDECL(Hello, (struct monst *));
-E const char *NDECL(Goodbye);
+extern boolean validrole(int);
+extern boolean validrace(int, int);
+extern boolean validgend(int, int, int);
+extern boolean validalign(int, int, int);
+extern int randrole(boolean);
+extern int randrace(int);
+extern int randgend(int, int);
+extern int randalign(int, int);
+extern int str2role(const char *);
+extern int str2race(const char *);
+extern int str2gend(const char *);
+extern int str2align(const char *);
+extern boolean ok_role(int, int, int, int);
+extern int pick_role(int, int, int, int);
+extern boolean ok_race(int, int, int, int);
+extern int pick_race(int, int, int, int);
+extern boolean ok_gend(int, int, int, int);
+extern int pick_gend(int, int, int, int);
+extern boolean ok_align(int, int, int, int);
+extern int pick_align(int, int, int, int);
+extern void rigid_role_checks(void);
+extern boolean setrolefilter(const char *);
+extern boolean gotrolefilter(void);
+extern void clearrolefilter(void);
+extern char *build_plselection_prompt(char *, int, int, int, int, int);
+extern char *root_plselection_prompt(char *, int, int, int, int, int);
+extern void plnamesuffix(void);
+extern void role_selection_prolog(int, winid);
+extern void role_menu_extra(int, winid, boolean);
+extern void role_init(void);
+extern const char *Hello(struct monst *);
+extern const char *Goodbye(void);
/* ### rumors.c ### */
-E char *FDECL(getrumor, (int, char *, BOOLEAN_P));
-E char *FDECL(get_rnd_text, (const char *, char *, int FDECL((*), (int))));
-E void FDECL(outrumor, (int, int));
-E void FDECL(outoracle, (BOOLEAN_P, BOOLEAN_P));
-E void FDECL(save_oracles, (NHFILE *));
-E void FDECL(restore_oracles, (NHFILE *));
-E int FDECL(doconsult, (struct monst *));
-E void NDECL(rumor_check);
+extern char *getrumor(int, char *, boolean);
+extern char *get_rnd_text(const char *, char *, int(*)(int));
+extern void outrumor(int, int);
+extern void outoracle(boolean, boolean);
+extern void save_oracles(NHFILE *);
+extern void restore_oracles(NHFILE *);
+extern int doconsult(struct monst *);
+extern void rumor_check(void);
/* ### save.c ### */
-E int NDECL(dosave);
-E int NDECL(dosave0);
-E boolean FDECL(tricked_fileremoved, (NHFILE *, char *));
+extern int dosave(void);
+extern int dosave0(void);
+extern boolean tricked_fileremoved(NHFILE *, char *);
#ifdef INSURANCE
-E void NDECL(savestateinlock);
-#endif
-E void FDECL(savelev, (NHFILE *, XCHAR_P));
-E genericptr_t FDECL(mon_to_buffer, (struct monst *, int *));
-E boolean FDECL(close_check, (int));
-E void FDECL(savecemetery, (NHFILE *, struct cemetery **));
-E void FDECL(savefruitchn, (NHFILE *));
-E void FDECL(store_plname_in_file, (NHFILE *));
-E void NDECL(free_dungeons);
-E void NDECL(freedynamicdata);
-E void FDECL(store_savefileinfo, (NHFILE *));
-E void FDECL(store_savefileinfo, (NHFILE *));
-E int NDECL(nhdatatypes_size);
-E void FDECL(assignlog, (char *, char*, int));
-E FILE *FDECL(getlog, (NHFILE *));
-E void FDECL(closelog, (NHFILE *));
-
+extern void savestateinlock(void);
+#endif
+extern void savelev(NHFILE *, xchar);
+extern genericptr_t mon_to_buffer(struct monst *, int *);
+extern boolean close_check(int);
+extern void savecemetery(NHFILE *, struct cemetery **);
+extern void savefruitchn(NHFILE *);
+extern void store_plname_in_file(NHFILE *);
+extern void free_dungeons(void);
+extern void freedynamicdata(void);
+extern void store_savefileinfo(NHFILE *);
+extern void store_savefileinfo(NHFILE *);
+extern int nhdatatypes_size(void);
+extern void assignlog(char *, char*, int);
+extern FILE *getlog(NHFILE *);
+extern void closelog(NHFILE *);
/* ### sfstruct.c ### */
-#ifndef TRACE_BUFFERING
-E void FDECL(newread, (NHFILE *, int, int, genericptr_t, unsigned int));
-E void FDECL(bufon, (int));
-E void FDECL(bufoff, (int));
-E void FDECL(bflush, (int));
-E void FDECL(bwrite, (int, genericptr_t, unsigned int));
-E void FDECL(mread, (int, genericptr_t, unsigned int));
-E void NDECL(minit);
-E void FDECL(bclose, (int));
+#ifndef TRACEBUFFERING
+extern void newread(NHFILE *, int, int, genericptr_t, unsigned int);
+extern void bufon(int);
+extern void bufoff(int);
+extern void bflush(int);
+extern void bwrite(int, genericptr_t, unsigned int);
+extern void mread(int, genericptr_t, unsigned int);
+extern void minit(void);
+extern void bclose(int);
#else
#define bufon(x) Bufon(x,__FUNCTION__, __LINE__)
#define bufoff(x) Bufoff(x,__FUNCTION__, __LINE__)
#define mread(x,y,z) Mread(x,y,z,__FUNCTION__, __LINE__)
#define minit() Minit(__FUNCTION__, __LINE__)
#endif
-E void FDECL(Bufon, (int, const char *, int));
-E void FDECL(Bufoff, (int, const char *, int));
-E void FDECL(Bflush, (int, const char *, int));
-E void FDECL(Bwrite, (int, genericptr_t, unsigned int, const char *, int));
-E void FDECL(Bread, (int, genericptr_t, unsigned int, const char *, int));
-E void FDECL(Binit,(const char *, int));
-E void FDECL(Bclose, (int, const char *, int));
-E void FDECL(Mread, (int, genericptr_t, unsigned int, const char *, int));
-E void FDECL(Minit, (const char *, int));
+extern void Bufon(int, const char *, int);
+extern void Bufoff(int, const char *, int);
+extern void Bflush(int, const char *, int);
+extern void Bwrite(int, genericptr_t, unsigned int, const char *, int);
+extern void Bread(int, genericptr_t, unsigned int, const char *, int);
+extern void Binit(const char *, int);
+extern void Bclose(int, const char *, int);
+extern void Mread(int, genericptr_t, unsigned int, const char *, int);
+extern void Minit(const char *, int);
#if defined(ZEROCOMP)
-E void FDECL(zerocomp_bclose, (int));
+extern void zerocomp_bclose(int);
#endif
/* ### shk.c ### */
-E void FDECL(setpaid, (struct monst *));
-E long FDECL(money2mon, (struct monst *, long));
-E void FDECL(money2u, (struct monst *, long));
-E void FDECL(shkgone, (struct monst *));
-E void FDECL(set_residency, (struct monst *, BOOLEAN_P));
-E void FDECL(replshk, (struct monst *, struct monst *));
-E void FDECL(restshk, (struct monst *, BOOLEAN_P));
-E char FDECL(inside_shop, (XCHAR_P, XCHAR_P));
-E void FDECL(u_left_shop, (char *, BOOLEAN_P));
-E void FDECL(remote_burglary, (XCHAR_P, XCHAR_P));
-E void FDECL(u_entered_shop, (char *));
-E void FDECL(pick_pick, (struct obj *));
-E boolean FDECL(same_price, (struct obj *, struct obj *));
-E void NDECL(shopper_financial_report);
-E int FDECL(inhishop, (struct monst *));
-E struct monst *FDECL(shop_keeper, (CHAR_P));
-E boolean FDECL(tended_shop, (struct mkroom *));
-E boolean FDECL(is_unpaid, (struct obj *));
-E void FDECL(delete_contents, (struct obj *));
-E void FDECL(obfree, (struct obj *, struct obj *));
-E void FDECL(home_shk, (struct monst *, BOOLEAN_P));
-E void FDECL(make_happy_shk, (struct monst *, BOOLEAN_P));
-E void FDECL(make_happy_shoppers, (BOOLEAN_P));
-E void FDECL(hot_pursuit, (struct monst *));
-E void FDECL(make_angry_shk, (struct monst *, XCHAR_P, XCHAR_P));
-E int NDECL(dopay);
-E boolean FDECL(paybill, (int, BOOLEAN_P));
-E void NDECL(finish_paybill);
-E struct obj *FDECL(find_oid, (unsigned));
-E long FDECL(contained_cost,
- (struct obj *, struct monst *, long, BOOLEAN_P, BOOLEAN_P));
-E long FDECL(contained_gold, (struct obj *, BOOLEAN_P));
-E void FDECL(picked_container, (struct obj *));
-E void FDECL(gem_learned, (int));
-E void FDECL(alter_cost, (struct obj *, long));
-E long FDECL(unpaid_cost, (struct obj *, BOOLEAN_P));
-E boolean FDECL(billable, (struct monst **, struct obj *, CHAR_P, BOOLEAN_P));
-E void FDECL(addtobill, (struct obj *, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(splitbill, (struct obj *, struct obj *));
-E void FDECL(subfrombill, (struct obj *, struct monst *));
-E long FDECL(stolen_value, (struct obj *, XCHAR_P, XCHAR_P,
- BOOLEAN_P, BOOLEAN_P));
-E void FDECL(donate_gold, (long, struct monst *, BOOLEAN_P));
-E void FDECL(sellobj_state, (int));
-E void FDECL(sellobj, (struct obj *, XCHAR_P, XCHAR_P));
-E int FDECL(doinvbill, (int));
-E struct monst *FDECL(shkcatch, (struct obj *, XCHAR_P, XCHAR_P));
-E void FDECL(add_damage, (XCHAR_P, XCHAR_P, long));
-E int FDECL(repair_damage, (struct monst *, struct damage *, int *,
- BOOLEAN_P));
-E int FDECL(shk_move, (struct monst *));
-E void FDECL(after_shk_move, (struct monst *));
-E boolean FDECL(is_fshk, (struct monst *));
-E void FDECL(shopdig, (int));
-E void FDECL(pay_for_damage, (const char *, BOOLEAN_P));
-E boolean FDECL(costly_spot, (XCHAR_P, XCHAR_P));
-E struct obj *FDECL(shop_object, (XCHAR_P, XCHAR_P));
-E void FDECL(price_quote, (struct obj *));
-E void FDECL(shk_chat, (struct monst *));
-E void FDECL(check_unpaid_usage, (struct obj *, BOOLEAN_P));
-E void FDECL(check_unpaid, (struct obj *));
-E void FDECL(costly_gold, (XCHAR_P, XCHAR_P, long));
-E long FDECL(get_cost_of_shop_item, (struct obj *, int *));
-E int FDECL(oid_price_adjustment, (struct obj *, unsigned));
-E boolean FDECL(block_door, (XCHAR_P, XCHAR_P));
-E boolean FDECL(block_entry, (XCHAR_P, XCHAR_P));
-E char *FDECL(shk_your, (char *, struct obj *));
-E char *FDECL(Shk_Your, (char *, struct obj *));
-E void FDECL(globby_bill_fixup, (struct obj *, struct obj *));
-E void FDECL(globby_donation, (struct obj *, struct obj *));
+extern void setpaid(struct monst *);
+extern long money2mon(struct monst *, long);
+extern void money2u(struct monst *, long);
+extern void shkgone(struct monst *);
+extern void set_residency(struct monst *, boolean);
+extern void replshk(struct monst *, struct monst *);
+extern void restshk(struct monst *, boolean);
+extern char inside_shop(xchar, xchar);
+extern void u_left_shop(char *, boolean);
+extern void remote_burglary(xchar, xchar);
+extern void u_entered_shop(char *);
+extern void pick_pick(struct obj *);
+extern boolean same_price(struct obj *, struct obj *);
+extern void shopper_financial_report(void);
+extern int inhishop(struct monst *);
+extern struct monst *shop_keeper(char);
+extern boolean tended_shop(struct mkroom *);
+extern boolean is_unpaid(struct obj *);
+extern void delete_contents(struct obj *);
+extern void obfree(struct obj *, struct obj *);
+extern void home_shk(struct monst *, boolean);
+extern void make_happy_shk(struct monst *, boolean);
+extern void make_happy_shoppers(boolean);
+extern void hot_pursuit(struct monst *);
+extern void make_angry_shk(struct monst *, xchar, xchar);
+extern int dopay(void);
+extern boolean paybill(int, boolean);
+extern void finish_paybill(void);
+extern struct obj *find_oid(unsigned);
+extern long contained_cost(struct obj *, struct monst *, long, boolean,
+ boolean);
+extern long contained_gold(struct obj *, boolean);
+extern void picked_container(struct obj *);
+extern void gem_learned(int);
+extern void alter_cost(struct obj *, long);
+extern long unpaid_cost(struct obj *, boolean);
+extern boolean billable(struct monst **, struct obj *, char, boolean);
+extern void addtobill(struct obj *, boolean, boolean, boolean);
+extern void splitbill(struct obj *, struct obj *);
+extern void subfrombill(struct obj *, struct monst *);
+extern long stolen_value(struct obj *, xchar, xchar, boolean, boolean);
+extern void donate_gold(long, struct monst *, boolean);
+extern void sellobj_state(int);
+extern void sellobj(struct obj *, xchar, xchar);
+extern int doinvbill(int);
+extern struct monst *shkcatch(struct obj *, xchar, xchar);
+extern void add_damage(xchar, xchar, long);
+extern int repair_damage(struct monst *, struct damage *, int *, boolean);
+extern int shk_move(struct monst *);
+extern void after_shk_move(struct monst *);
+extern boolean is_fshk(struct monst *);
+extern void shopdig(int);
+extern void pay_for_damage(const char *, boolean);
+extern boolean costly_spot(xchar, xchar);
+extern struct obj *shop_object(xchar, xchar);
+extern void price_quote(struct obj *);
+extern void shk_chat(struct monst *);
+extern void check_unpaid_usage(struct obj *, boolean);
+extern void check_unpaid(struct obj *);
+extern void costly_gold(xchar, xchar, long);
+extern long get_cost_of_shop_item(struct obj *, int *);
+extern int oid_price_adjustment(struct obj *, unsigned);
+extern boolean block_door(xchar, xchar);
+extern boolean block_entry(xchar, xchar);
+extern char *shk_your(char *, struct obj *);
+extern char *Shk_Your(char *, struct obj *);
+extern void globby_bill_fixup(struct obj *, struct obj *);
+extern void globby_donation(struct obj *, struct obj *);
/* ### shknam.c ### */
-E void FDECL(neweshk, (struct monst *));
-E void FDECL(free_eshk, (struct monst *));
-E void FDECL(stock_room, (int, struct mkroom *));
-E boolean FDECL(saleable, (struct monst *, struct obj *));
-E int FDECL(get_shop_item, (int));
-E char *FDECL(Shknam, (struct monst *));
-E char *FDECL(shkname, (struct monst *));
-E boolean FDECL(shkname_is_pname, (struct monst *));
-E boolean FDECL(is_izchak, (struct monst *, BOOLEAN_P));
+extern void neweshk(struct monst *);
+extern void free_eshk(struct monst *);
+extern void stock_room(int, struct mkroom *);
+extern boolean saleable(struct monst *, struct obj *);
+extern int get_shop_item(int);
+extern char *Shknam(struct monst *);
+extern char *shkname(struct monst *);
+extern boolean shkname_is_pname(struct monst *);
+extern boolean is_izchak(struct monst *, boolean);
/* ### sit.c ### */
-E void NDECL(take_gold);
-E int NDECL(dosit);
-E void NDECL(rndcurse);
-E void NDECL(attrcurse);
+extern void take_gold(void);
+extern int dosit(void);
+extern void rndcurse(void);
+extern void attrcurse(void);
/* ### sounds.c ### */
-E void NDECL(dosounds);
-E const char *FDECL(growl_sound, (struct monst *));
-E void FDECL(growl, (struct monst *));
-E void FDECL(yelp, (struct monst *));
-E void FDECL(whimper, (struct monst *));
-E void FDECL(beg, (struct monst *));
-E const char *FDECL(maybe_gasp, (struct monst *));
-E int NDECL(dotalk);
-E int NDECL(tiphat);
+extern void dosounds(void);
+extern const char *growl_sound(struct monst *);
+extern void growl(struct monst *);
+extern void yelp(struct monst *);
+extern void whimper(struct monst *);
+extern void beg(struct monst *);
+extern const char *maybe_gasp(struct monst *);
+extern int dotalk(void);
+extern int tiphat(void);
#ifdef USER_SOUNDS
-E int FDECL(add_sound_mapping, (const char *));
-E void FDECL(play_sound_for_message, (const char *));
-E void FDECL(maybe_play_sound, (const char *));
-E void NDECL(release_sound_mappings);
-#endif
+extern int add_sound_mapping(const char *);
+extern void play_sound_for_message(const char *);
+extern void maybe_play_sound(const char *);
+extern void release_sound_mappings(void);
+#endif /* USER SOUNDS */
/* ### sp_lev.c ### */
+
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
-E void NDECL(create_des_coder);
-E struct mapfragment *FDECL(mapfrag_fromstr, (char *));
-E void FDECL(mapfrag_free, (struct mapfragment **));
-E schar FDECL(mapfrag_get, (struct mapfragment *, int, int));
-E boolean FDECL(mapfrag_canmatch, (struct mapfragment *));
-E const char * FDECL(mapfrag_error, (struct mapfragment *));
-E boolean FDECL(mapfrag_match, (struct mapfragment *, int, int));
-E void FDECL(flip_level, (int, BOOLEAN_P));
-E void FDECL(flip_level_rnd, (int, BOOLEAN_P));
-E boolean FDECL(check_room, (xchar *, xchar *, xchar *, xchar *, BOOLEAN_P));
-E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P, XCHAR_P));
-E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P));
-E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P));
-E void FDECL(fill_special_room, (struct mkroom *));
-E void FDECL(wallify_map, (int, int, int, int));
-E boolean FDECL(load_special, (const char *));
-E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *));
-E struct selectionvar *NDECL(selection_new);
-E void FDECL(selection_free, (struct selectionvar *, BOOLEAN_P));
-E struct selectionvar *FDECL(selection_clone, (struct selectionvar *));
-E void FDECL(set_selection_floodfillchk, (int FDECL((*), (int,int))));
-E void FDECL(selection_floodfill, (struct selectionvar *, int, int,
- BOOLEAN_P));
-E boolean FDECL(pm_good_location, (int, int, struct permonst *));
-E void FDECL(get_location_coord, (xchar *, xchar *, int, struct mkroom *,
- long));
-E void FDECL(selection_setpoint, (int, int, struct selectionvar *, XCHAR_P));
-E struct selectionvar * FDECL(selection_not, (struct selectionvar *));
-E void FDECL(selection_filter_percent, (struct selectionvar *, int));
-E int FDECL(selection_rndcoord, (struct selectionvar *, xchar *, xchar *,
- BOOLEAN_P));
-E void FDECL(selection_do_grow, (struct selectionvar *, int));
-E void FDECL(selection_do_line, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- struct selectionvar *));
-E void FDECL(selection_do_randline, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- SCHAR_P, SCHAR_P, struct selectionvar *));
-E struct selectionvar *FDECL(selection_filter_mapchar, (struct selectionvar *,
- XCHAR_P, int));
-E void FDECL(set_floodfillchk_match_under, (XCHAR_P));
-E void FDECL(selection_do_ellipse, (struct selectionvar *,
- int, int, int, int, int));
-E void FDECL(selection_do_gradient, (struct selectionvar *, long, long,
- long, long, long, long, long, long));
-E void NDECL(update_croom);
-E const char *FDECL(get_trapname_bytype, (int));
-E void FDECL(l_register_des, (lua_State *));
+extern void create_des_coder(void);
+extern struct mapfragment *mapfrag_fromstr(char *);
+extern void mapfrag_free(struct mapfragment **);
+extern schar mapfrag_get(struct mapfragment *, int, int);
+extern boolean mapfrag_canmatch(struct mapfragment *);
+extern const char * mapfrag_error(struct mapfragment *);
+extern boolean mapfrag_match(struct mapfragment *, int, int);
+extern void flip_level(int, boolean);
+extern void flip_level_rnd(int, boolean);
+extern boolean check_room(xchar *, xchar *, xchar *, xchar *, boolean);
+extern boolean create_room(xchar, xchar, xchar, xchar, xchar, xchar, xchar,
+ xchar);
+extern void create_secret_door(struct mkroom *, xchar);
+extern boolean dig_corridor(coord *, coord *, boolean, schar, schar);
+extern void fill_special_room(struct mkroom *);
+extern void wallify_map(int, int, int, int);
+extern boolean load_special(const char *);
+extern xchar selection_getpoint(int, int, struct selectionvar *);
+extern struct selectionvar *selection_new(void);
+extern void selection_free(struct selectionvar *, boolean);
+extern struct selectionvar *selection_clone(struct selectionvar *);
+extern void set_selection_floodfillchk(int(*)(int,int));
+extern void selection_floodfill(struct selectionvar *, int, int, boolean);
+extern boolean pm_good_location(int, int, struct permonst *);
+extern void get_location_coord(xchar *, xchar *, int, struct mkroom *, long);
+extern void selection_setpoint(int, int, struct selectionvar *, xchar);
+extern struct selectionvar * selection_not(struct selectionvar *);
+extern void selection_filter_percent(struct selectionvar *, int);
+extern int selection_rndcoord(struct selectionvar *, xchar *, xchar *,
+ boolean);
+extern void selection_do_grow(struct selectionvar *, int);
+extern void selection_do_line(xchar, xchar, xchar, xchar,
+ struct selectionvar *);
+extern void selection_do_randline(xchar, xchar, xchar, xchar, schar, schar,
+ struct selectionvar *);
+extern struct selectionvar *selection_filter_mapchar(struct selectionvar *,
+ xchar, int);
+extern void set_floodfillchk_match_under(xchar);
+extern void selection_do_ellipse(struct selectionvar *, int, int, int, int,
+ int);
+extern void selection_do_gradient(struct selectionvar *, long, long, long,
+ long, long, long, long, long);
+extern void update_croom(void);
+extern const char *get_trapname_bytype(int);
+extern void l_register_des(lua_State *);
#endif /* !CROSSCOMPILE || CROSSCOMPILE_TARGET */
/* ### spell.c ### */
-E void FDECL(book_cursed, (struct obj *));
-E int FDECL(study_book, (struct obj *));
-E void FDECL(book_disappears, (struct obj *));
-E void FDECL(book_substitution, (struct obj *, struct obj *));
-E void NDECL(age_spells);
-E int NDECL(docast);
-E int FDECL(spell_skilltype, (int));
-E int FDECL(spelleffects, (int, BOOLEAN_P));
-E int FDECL(tport_spell, (int));
-E void NDECL(losespells);
-E int NDECL(dovspell);
-E void FDECL(initialspell, (struct obj *));
+extern void book_cursed(struct obj *);
+extern int study_book(struct obj *);
+extern void book_disappears(struct obj *);
+extern void book_substitution(struct obj *, struct obj *);
+extern void age_spells(void);
+extern int docast(void);
+extern int spell_skilltype(int);
+extern int spelleffects(int, boolean);
+extern int tport_spell(int);
+extern void losespells(void);
+extern int dovspell(void);
+extern void initialspell(struct obj *);
/* ### steal.c ### */
-E long FDECL(somegold, (long));
-E void FDECL(stealgold, (struct monst *));
-E void NDECL(thiefdead);
-E void FDECL(remove_worn_item, (struct obj *, BOOLEAN_P));
-E int FDECL(steal, (struct monst *, char *));
-E int FDECL(mpickobj, (struct monst *, struct obj *));
-E void FDECL(stealamulet, (struct monst *));
-E void FDECL(maybe_absorb_item, (struct monst *, struct obj *, int, int));
-E void FDECL(mdrop_obj, (struct monst *, struct obj *, BOOLEAN_P));
-E void FDECL(mdrop_special_objs, (struct monst *));
-E void FDECL(relobj, (struct monst *, int, BOOLEAN_P));
-E struct obj *FDECL(findgold, (struct obj *));
+extern long somegold(long);
+extern void stealgold(struct monst *);
+extern void thiefdead(void);
+extern void remove_worn_item(struct obj *, boolean);
+extern int steal(struct monst *, char *);
+extern int mpickobj(struct monst *, struct obj *);
+extern void stealamulet(struct monst *);
+extern void maybe_absorb_item(struct monst *, struct obj *, int, int);
+extern void mdrop_obj(struct monst *, struct obj *, boolean);
+extern void mdrop_special_objs(struct monst *);
+extern void relobj(struct monst *, int, boolean);
+extern struct obj *findgold(struct obj *);
/* ### steed.c ### */
-E void NDECL(rider_cant_reach);
-E boolean FDECL(can_saddle, (struct monst *));
-E int FDECL(use_saddle, (struct obj *));
-E void FDECL(put_saddle_on_mon, (struct obj *, struct monst *));
-E boolean FDECL(can_ride, (struct monst *));
-E int NDECL(doride);
-E boolean FDECL(mount_steed, (struct monst *, BOOLEAN_P));
-E void NDECL(exercise_steed);
-E void NDECL(kick_steed);
-E void FDECL(dismount_steed, (int));
-E void FDECL(place_monster, (struct monst *, int, int));
-E boolean FDECL(stucksteed, (BOOLEAN_P));
+extern void rider_cant_reach(void);
+extern boolean can_saddle(struct monst *);
+extern int use_saddle(struct obj *);
+extern void put_saddle_on_mon(struct obj *, struct monst *);
+extern boolean can_ride(struct monst *);
+extern int doride(void);
+extern boolean mount_steed(struct monst *, boolean);
+extern void exercise_steed(void);
+extern void kick_steed(void);
+extern void dismount_steed(int);
+extern void place_monster(struct monst *, int, int);
+extern boolean stucksteed(boolean);
/* ### symbols.c ### */
-E void FDECL(switch_symbols, (int));
-E void FDECL(assign_graphics, (int));
-E void NDECL(init_symbols);
-E void NDECL(init_showsyms);
-E void NDECL(init_primary_symbols);
-E void NDECL(init_rogue_symbols);
-E void NDECL(init_ov_primary_symbols);
-E void NDECL(init_ov_rogue_symbols);
-E void FDECL(clear_symsetentry, (int, BOOLEAN_P));
-E void FDECL(update_primary_symset, (struct symparse *, int));
-E void FDECL(update_rogue_symset, (struct symparse *, int));
-E void FDECL(update_ov_primary_symset, (struct symparse *, int));
-E void FDECL(update_ov_rogue_symset, (struct symparse *, int));
-E nhsym FDECL(get_othersym, (int, int));
+extern void switch_symbols(int);
+extern void assign_graphics(int);
+extern void init_symbols(void);
+extern void init_showsyms(void);
+extern void init_primary_symbols(void);
+extern void init_rogue_symbols(void);
+extern void init_ov_primary_symbols(void);
+extern void init_ov_rogue_symbols(void);
+extern void clear_symsetentry(int, boolean);
+extern void update_primary_symset(struct symparse *, int);
+extern void update_rogue_symset(struct symparse *, int);
+extern void update_ov_primary_symset(struct symparse *, int);
+extern void update_ov_rogue_symset(struct symparse *, int);
+extern nhsym get_othersym(int, int);
/* ### sys.c ### */
-E void NDECL(sys_early_init);
-E void NDECL(sysopt_release);
-E void FDECL(sysopt_seduce_set, (int));
+extern void sys_early_init(void);
+extern void sysopt_release(void);
+extern void sysopt_seduce_set(int);
/* ### teleport.c ### */
-E boolean FDECL(noteleport_level, (struct monst *));
-E boolean FDECL(goodpos, (int, int, struct monst *, long));
-E boolean FDECL(enexto, (coord *, XCHAR_P, XCHAR_P, struct permonst *));
-E boolean FDECL(enexto_core, (coord *, XCHAR_P, XCHAR_P,
- struct permonst *, long));
-E void FDECL(teleds, (int, int, int));
-E boolean FDECL(safe_teleds, (int));
-E boolean FDECL(teleport_pet, (struct monst *, BOOLEAN_P));
-E void NDECL(tele);
-E void FDECL(scrolltele, (struct obj *));
-E int NDECL(dotelecmd);
-E int FDECL(dotele, (BOOLEAN_P));
-E void NDECL(level_tele);
-E void FDECL(domagicportal, (struct trap *));
-E void FDECL(tele_trap, (struct trap *));
-E void FDECL(level_tele_trap, (struct trap *, unsigned));
-E void FDECL(rloc_to, (struct monst *, int, int));
-E boolean FDECL(rloc, (struct monst *, BOOLEAN_P));
-E boolean FDECL(tele_restrict, (struct monst *));
-E void FDECL(mtele_trap, (struct monst *, struct trap *, int));
-E int FDECL(mlevel_tele_trap, (struct monst *, struct trap *,
- BOOLEAN_P, int));
-E boolean FDECL(rloco, (struct obj *));
-E int NDECL(random_teleport_level);
-E boolean FDECL(u_teleport_mon, (struct monst *, BOOLEAN_P));
+extern boolean noteleport_level(struct monst *);
+extern boolean goodpos(int, int, struct monst *, long);
+extern boolean enexto(coord *, xchar, xchar, struct permonst *);
+extern boolean enexto_core(coord *, xchar, xchar, struct permonst *, long);
+extern void teleds(int, int, int);
+extern boolean safe_teleds(int);
+extern boolean teleport_pet(struct monst *, boolean);
+extern void tele(void);
+extern void scrolltele(struct obj *);
+extern int dotelecmd(void);
+extern int dotele(boolean);
+extern void level_tele(void);
+extern void domagicportal(struct trap *);
+extern void tele_trap(struct trap *);
+extern void level_tele_trap(struct trap *, unsigned);
+extern void rloc_to(struct monst *, int, int);
+extern boolean rloc(struct monst *, boolean);
+extern boolean tele_restrict(struct monst *);
+extern void mtele_trap(struct monst *, struct trap *, int);
+extern int mlevel_tele_trap(struct monst *, struct trap *, boolean, int);
+extern boolean rloco(struct obj *);
+extern int random_teleport_level(void);
+extern boolean u_teleport_mon(struct monst *, boolean);
/* ### tile.c ### */
+
#ifdef USE_TILES
-E void FDECL(substitute_tiles, (d_level *));
+extern void substitute_tiles(d_level *);
#endif
/* ### timeout.c ### */
-E void NDECL(burn_away_slime);
-E void NDECL(nh_timeout);
-E void FDECL(fall_asleep, (int, BOOLEAN_P));
-E void FDECL(attach_egg_hatch_timeout, (struct obj *, long));
-E void FDECL(attach_fig_transform_timeout, (struct obj *));
-E void FDECL(kill_egg, (struct obj *));
-E void FDECL(hatch_egg, (ANY_P *, long));
-E void FDECL(learn_egg_type, (int));
-E void FDECL(burn_object, (ANY_P *, long));
-E void FDECL(begin_burn, (struct obj *, BOOLEAN_P));
-E void FDECL(end_burn, (struct obj *, BOOLEAN_P));
-E void NDECL(do_storms);
-E boolean FDECL(start_timer, (long, SHORT_P, SHORT_P, ANY_P *));
-E long FDECL(stop_timer, (SHORT_P, ANY_P *));
-E long FDECL(peek_timer, (SHORT_P, ANY_P *));
-E void NDECL(run_timers);
-E void FDECL(obj_move_timers, (struct obj *, struct obj *));
-E void FDECL(obj_split_timers, (struct obj *, struct obj *));
-E void FDECL(obj_stop_timers, (struct obj *));
-E boolean FDECL(obj_has_timer, (struct obj *, SHORT_P));
-E void FDECL(spot_stop_timers, (XCHAR_P, XCHAR_P, SHORT_P));
-E long FDECL(spot_time_expires, (XCHAR_P, XCHAR_P, SHORT_P));
-E long FDECL(spot_time_left, (XCHAR_P, XCHAR_P, SHORT_P));
-E boolean FDECL(obj_is_local, (struct obj *));
-E void FDECL(save_timers, (NHFILE *, int));
-E void FDECL(restore_timers, (NHFILE *, int, long));
-E void FDECL(timer_stats, (const char *, char *, long *, long *));
-E void FDECL(relink_timers, (BOOLEAN_P));
-E int NDECL(wiz_timeout_queue);
-E void NDECL(timer_sanity_check);
+extern void burn_away_slime(void);
+extern void nh_timeout(void);
+extern void fall_asleep(int, boolean);
+extern void attach_egg_hatch_timeout(struct obj *, long);
+extern void attach_fig_transform_timeout(struct obj *);
+extern void kill_egg(struct obj *);
+extern void hatch_egg(union any *, long);
+extern void learn_egg_type(int);
+extern void burn_object(union any *, long);
+extern void begin_burn(struct obj *, boolean);
+extern void end_burn(struct obj *, boolean);
+extern void do_storms(void);
+extern boolean start_timer(long, short, short, union any *);
+extern long stop_timer(short, union any *);
+extern long peek_timer(short, union any *);
+extern void run_timers(void);
+extern void obj_move_timers(struct obj *, struct obj *);
+extern void obj_split_timers(struct obj *, struct obj *);
+extern void obj_stop_timers(struct obj *);
+extern boolean obj_has_timer(struct obj *, short);
+extern void spot_stop_timers(xchar, xchar, short);
+extern long spot_time_expires(xchar, xchar, short);
+extern long spot_time_left(xchar, xchar, short);
+extern boolean obj_is_local(struct obj *);
+extern void save_timers(NHFILE *, int);
+extern void restore_timers(NHFILE *, int, long);
+extern void timer_stats(const char *, char *, long *, long *);
+extern void relink_timers(boolean);
+extern int wiz_timeout_queue(void);
+extern void timer_sanity_check(void);
/* ### topten.c ### */
-E void FDECL(formatkiller, (char *, unsigned, int, BOOLEAN_P));
-E int FDECL(observable_depth, (d_level *));
-E void FDECL(topten, (int, time_t));
-E void FDECL(prscore, (int, char **));
-E struct toptenentry *NDECL(get_rnd_toptenentry);
-E struct obj *FDECL(tt_oname, (struct obj *));
+extern void formatkiller(char *, unsigned, int, boolean);
+extern int observable_depth(d_level *);
+extern void topten(int, time_t);
+extern void prscore(int, char **);
+extern struct toptenentry *get_rnd_toptenentry(void);
+extern struct obj *tt_oname(struct obj *);
/* ### track.c ### */
-E void NDECL(initrack);
-E void NDECL(settrack);
-E coord *FDECL(gettrack, (int, int));
+extern void initrack(void);
+extern void settrack(void);
+extern coord *gettrack(int, int);
/* ### trap.c ### */
-E boolean FDECL(burnarmor, (struct monst *));
-E int FDECL(erode_obj, (struct obj *, const char *, int, int));
-E boolean FDECL(grease_protect, (struct obj *, const char *, struct monst *));
-E struct trap *FDECL(maketrap, (int, int, int));
-E void FDECL(fall_through, (BOOLEAN_P, unsigned));
-E struct monst *FDECL(animate_statue,
- (struct obj *, XCHAR_P, XCHAR_P, int, int *));
-E struct monst *FDECL(activate_statue_trap,
- (struct trap *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(set_utrap, (unsigned, unsigned));
-E void FDECL(reset_utrap, (BOOLEAN_P));
-E void FDECL(dotrap, (struct trap *, unsigned));
-E void FDECL(seetrap, (struct trap *));
-E void FDECL(feeltrap, (struct trap *));
-E int FDECL(mintrap, (struct monst *));
-E void FDECL(instapetrify, (const char *));
-E void FDECL(minstapetrify, (struct monst *, BOOLEAN_P));
-E void FDECL(selftouch, (const char *));
-E void FDECL(mselftouch, (struct monst *, const char *, BOOLEAN_P));
-E void NDECL(float_up);
-E void FDECL(fill_pit, (int, int));
-E int FDECL(float_down, (long, long));
-E void NDECL(climb_pit);
-E boolean FDECL(fire_damage, (struct obj *, BOOLEAN_P, XCHAR_P, XCHAR_P));
-E int FDECL(fire_damage_chain,
- (struct obj *, BOOLEAN_P, BOOLEAN_P, XCHAR_P, XCHAR_P));
-E boolean FDECL(lava_damage, (struct obj *, XCHAR_P, XCHAR_P));
-E void acid_damage(struct obj *);
-E int FDECL(water_damage, (struct obj *, const char *, BOOLEAN_P));
-E void FDECL(water_damage_chain, (struct obj *, BOOLEAN_P));
-E boolean NDECL(drown);
-E void FDECL(drain_en, (int));
-E int NDECL(dountrap);
-E void FDECL(cnv_trap_obj, (int, int, struct trap *, BOOLEAN_P));
-E int FDECL(untrap, (BOOLEAN_P));
-E boolean FDECL(openholdingtrap, (struct monst *, boolean *));
-E boolean FDECL(closeholdingtrap, (struct monst *, boolean *));
-E boolean FDECL(openfallingtrap, (struct monst *, BOOLEAN_P, boolean *));
-E boolean FDECL(chest_trap, (struct obj *, int, BOOLEAN_P));
-E void FDECL(deltrap, (struct trap *));
-E boolean FDECL(delfloortrap, (struct trap *));
-E struct trap *FDECL(t_at, (int, int));
-E void FDECL(b_trapped, (const char *, int));
-E boolean NDECL(unconscious);
-E void FDECL(blow_up_landmine, (struct trap *));
-E int FDECL(launch_obj, (SHORT_P, int, int, int, int, int));
-E boolean NDECL(launch_in_progress);
-E void NDECL(force_launch_placement);
-E boolean FDECL(uteetering_at_seen_pit, (struct trap *));
-E boolean FDECL(uescaped_shaft, (struct trap *));
-E boolean NDECL(lava_effects);
-E void NDECL(sink_into_lava);
-E void NDECL(sokoban_guilt);
-E const char * FDECL(trapname, (int, BOOLEAN_P));
-E void FDECL(ignite_items, (struct obj *));
+extern boolean burnarmor(struct monst *);
+extern int erode_obj(struct obj *, const char *, int, int);
+extern boolean grease_protect(struct obj *, const char *, struct monst *);
+extern struct trap *maketrap(int, int, int);
+extern void fall_through(boolean, unsigned);
+extern struct monst *animate_statue(struct obj *, xchar, xchar, int, int *);
+extern struct monst *activate_statue_trap(struct trap *, xchar, xchar,
+ boolean);
+extern void set_utrap(unsigned, unsigned);
+extern void reset_utrap(boolean);
+extern void dotrap(struct trap *, unsigned);
+extern void seetrap(struct trap *);
+extern void feeltrap(struct trap *);
+extern int mintrap(struct monst *);
+extern void instapetrify(const char *);
+extern void minstapetrify(struct monst *, boolean);
+extern void selftouch(const char *);
+extern void mselftouch(struct monst *, const char *, boolean);
+extern void float_up(void);
+extern void fill_pit(int, int);
+extern int float_down(long, long);
+extern void climb_pit(void);
+extern boolean fire_damage(struct obj *, boolean, xchar, xchar);
+extern int fire_damage_chain(struct obj *, boolean, boolean, xchar, xchar);
+extern boolean lava_damage(struct obj *, xchar, xchar);
+extern void acid_damage(struct obj *);
+extern int water_damage(struct obj *, const char *, boolean);
+extern void water_damage_chain(struct obj *, boolean);
+extern boolean drown(void);
+extern void drain_en(int);
+extern int dountrap(void);
+extern void cnv_trap_obj(int, int, struct trap *, boolean);
+extern int untrap(boolean);
+extern boolean openholdingtrap(struct monst *, boolean *);
+extern boolean closeholdingtrap(struct monst *, boolean *);
+extern boolean openfallingtrap(struct monst *, boolean, boolean *);
+extern boolean chest_trap(struct obj *, int, boolean);
+extern void deltrap(struct trap *);
+extern boolean delfloortrap(struct trap *);
+extern struct trap *t_at(int, int);
+extern void b_trapped(const char *, int);
+extern boolean unconscious(void);
+extern void blow_up_landmine(struct trap *);
+extern int launch_obj(short, int, int, int, int, int);
+extern boolean launch_in_progress(void);
+extern void force_launch_placement(void);
+extern boolean uteetering_at_seen_pit(struct trap *);
+extern boolean uescaped_shaft(struct trap *);
+extern boolean lava_effects(void);
+extern void sink_into_lava(void);
+extern void sokoban_guilt(void);
+extern const char * trapname(int, boolean);
+extern void ignite_items(struct obj *);
/* ### u_init.c ### */
-E void NDECL(u_init);
+extern void u_init(void);
/* ### uhitm.c ### */
-E void FDECL(erode_armor, (struct monst *, int));
-E boolean FDECL(attack_checks, (struct monst *, struct obj *));
-E void FDECL(check_caitiff, (struct monst *));
-E int FDECL(find_roll_to_hit, (struct monst *, UCHAR_P, struct obj *,
- int *, int *));
-E boolean FDECL(attack, (struct monst *));
-E boolean FDECL(hmon, (struct monst *, struct obj *, int, int));
-E boolean FDECL(shade_miss, (struct monst *, struct monst *, struct obj *,
- BOOLEAN_P, BOOLEAN_P));
-E void FDECL(mhitm_ad_rust, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_corr, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_dcay, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_dren, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_drli, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_fire, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_cold, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_elec, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_acid, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_sgld, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_tlpt, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_blnd, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_curs, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_drst, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_drin, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_stck, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_wrap, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_plys, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_slee, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_slim, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_ench, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_slow, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_conf, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_poly, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_famn, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_pest, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_deth, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_halu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_phys, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_ston, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_were, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_heal, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_stun, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_legs, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_dgst, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_samu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_dise, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_sedu, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_ad_ssex, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E void FDECL(mhitm_adtyping, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E boolean FDECL(do_stone_u, (struct monst *));
-E void FDECL(do_stone_mon, (struct monst *, struct attack *, struct monst *, struct mhitm_data *));
-E int FDECL(damageum, (struct monst *, struct attack *, int));
-E void FDECL(missum, (struct monst *, struct attack *, BOOLEAN_P));
-E int FDECL(passive, (struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P,
- UCHAR_P, BOOLEAN_P));
-E void FDECL(passive_obj, (struct monst *, struct obj *, struct attack *));
-E void FDECL(stumble_onto_mimic, (struct monst *));
-E int FDECL(flash_hits_mon, (struct monst *, struct obj *));
-E void FDECL(light_hits_gremlin, (struct monst *, int));
+extern void erode_armor(struct monst *, int);
+extern boolean attack_checks(struct monst *, struct obj *);
+extern void check_caitiff(struct monst *);
+extern int find_roll_to_hit(struct monst *, uchar, struct obj *, int *, int *);
+extern boolean attack(struct monst *);
+extern boolean hmon(struct monst *, struct obj *, int, int);
+extern boolean shade_miss(struct monst *, struct monst *, struct obj *,
+ boolean, boolean);
+extern void mhitm_ad_rust(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_corr(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_dcay(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_dren(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_drli(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_fire(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_cold(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_elec(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_acid(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_sgld(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_tlpt(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_blnd(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_curs(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_drst(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_drin(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_stck(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_wrap(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_plys(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_slee(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_slim(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_ench(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_slow(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_conf(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_poly(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_famn(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_pest(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_deth(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_halu(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_phys(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_ston(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_were(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_heal(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_stun(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_legs(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_dgst(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_samu(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_dise(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_sedu(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_ad_ssex(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern void mhitm_adtyping(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern boolean do_stone_u(struct monst *);
+extern void do_stone_mon(struct monst *, struct attack *, struct monst *,
+ struct mhitm_data *);
+extern int damageum(struct monst *, struct attack *, int);
+extern void missum(struct monst *, struct attack *, boolean);
+extern int passive(struct monst *, struct obj *, boolean, boolean, uchar,
+ boolean);
+extern void passive_obj(struct monst *, struct obj *, struct attack *);
+extern void stumble_onto_mimic(struct monst *);
+extern int flash_hits_mon(struct monst *, struct obj *);
+extern void light_hits_gremlin(struct monst *, int);
-/* ### unixmain.c ### */
+/* ### unixmain.c ### */
#ifdef UNIX
#ifdef PORT_HELP
-E void NDECL(port_help);
-#endif
-E void FDECL(sethanguphandler, (void (*)(int)));
-E boolean NDECL(authorize_wizard_mode);
-E void FDECL(append_slash, (char *));
-E boolean FDECL(check_user_string, (const char *));
-E char *NDECL(get_login_name);
-E unsigned long NDECL(sys_random_seed);
+extern void port_help(void);
+#endif
+extern void sethanguphandler(void(*)(int));
+extern boolean authorize_wizard_mode(void);
+extern void append_slash(char *);
+extern boolean check_user_string(const char *);
+extern char *get_login_name(void);
+extern unsigned long sys_random_seed(void);
#endif /* UNIX */
/* ### unixtty.c ### */
#if defined(UNIX) || defined(__BEOS__)
-E void NDECL(gettty);
-E void FDECL(settty, (const char *));
-E void NDECL(setftty);
-E void NDECL(intron);
-E void NDECL(introff);
-E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2);
+extern void gettty(void);
+extern void settty(const char *);
+extern void setftty(void);
+extern void intron(void);
+extern void introff(void);
+extern void error (const char *, ...);
#endif /* UNIX || __BEOS__ */
/* ### unixunix.c ### */
#ifdef UNIX
-E void NDECL(getlock);
-E void FDECL(regularize, (char *));
+extern void getlock(void);
+extern void regularize(char *);
#if defined(TIMED_DELAY) && !defined(msleep) && defined(SYSV)
-E void FDECL(msleep, (unsigned));
+extern void msleep(unsigned);
#endif
#ifdef SHELL
-E int NDECL(dosh);
+extern int dosh(void);
#endif /* SHELL */
#if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
-E int FDECL(child, (int));
+extern int child(int);
#endif
#ifdef PANICTRACE
-E boolean FDECL(file_exists, (const char *));
+extern boolean file_exists(const char *);
#endif
#endif /* UNIX */
#ifdef UNIX
#ifdef GNOME_GRAPHICS
-E int FDECL(hide_privileges, (BOOLEAN_P));
+extern int hide_privileges(boolean);
#endif
#endif /* UNIX */
/* ### vault.c ### */
-E void FDECL(newegd, (struct monst *));
-E void FDECL(free_egd, (struct monst *));
-E boolean FDECL(grddead, (struct monst *));
-E struct monst *NDECL(findgd);
-E void NDECL(vault_summon_gd);
-E char FDECL(vault_occupied, (char *));
-E void FDECL(uleftvault, (struct monst *));
-E void NDECL(invault);
-E int FDECL(gd_move, (struct monst *));
-E void FDECL(paygd, (BOOLEAN_P));
-E long FDECL(hidden_gold, (BOOLEAN_P));
-E boolean NDECL(gd_sound);
-E void FDECL(vault_gd_watching, (unsigned int));
+extern void newegd(struct monst *);
+extern void free_egd(struct monst *);
+extern boolean grddead(struct monst *);
+extern struct monst *findgd(void);
+extern void vault_summon_gd(void);
+extern char vault_occupied(char *);
+extern void uleftvault(struct monst *);
+extern void invault(void);
+extern int gd_move(struct monst *);
+extern void paygd(boolean);
+extern long hidden_gold(boolean);
+extern boolean gd_sound(void);
+extern void vault_gd_watching(unsigned int);
/* ### version.c ### */
-E char *FDECL(version_string, (char *));
-E char *FDECL(getversionstring, (char *));
-E int NDECL(doversion);
-E int NDECL(doextversion);
+extern char *version_string(char *);
+extern char *getversionstring(char *);
+extern int doversion(void);
+extern int doextversion(void);
#ifdef MICRO
-E boolean FDECL(comp_times, (long));
-#endif
-E boolean
-FDECL(check_version, (struct version_info *, const char *, BOOLEAN_P, unsigned long));
-E boolean FDECL(uptodate, (NHFILE *, const char *, unsigned long));
-E void FDECL(store_formatindicator, (NHFILE *));
-E void FDECL(store_version, (NHFILE *));
-E unsigned long FDECL(get_feature_notice_ver, (char *));
-E unsigned long NDECL(get_current_feature_ver);
-E const char *FDECL(copyright_banner_line, (int));
-E void FDECL(early_version_info, (BOOLEAN_P));
-
+extern boolean comp_times(long);
+#endif
+extern boolean check_version(struct version_info *, const char *, boolean,
+ unsigned long);
+extern boolean uptodate(NHFILE *, const char *, unsigned long);
+extern void store_formatindicator(NHFILE *);
+extern void store_version(NHFILE *);
+extern unsigned long get_feature_notice_ver(char *);
+extern unsigned long get_current_feature_ver(void);
+extern const char *copyright_banner_line(int);
+extern void early_version_info(boolean);
#ifdef RUNTIME_PORT_ID
-E char *FDECL(get_port_id, (char *));
+extern char *get_port_id(char *);
#endif
#ifdef RUNTIME_PASTEBUF_SUPPORT
-E void FDECL(port_insert_pastebuf, (char *));
+extern void port_insert_pastebuf(char *);
#endif
/* ### video.c ### */
#ifdef MSDOS
-E int FDECL(assign_video, (char *));
+extern int assign_video(char *);
#ifdef NO_TERMS
-E void NDECL(gr_init);
-E void NDECL(gr_finish);
+extern void gr_init(void);
+extern void gr_finish(void);
#endif
-E void FDECL(tileview, (BOOLEAN_P));
+extern void tileview(boolean);
#endif
#ifdef VIDEOSHADES
-E int FDECL(assign_videoshades, (char *));
-E int FDECL(assign_videocolors, (char *));
+extern int assign_videoshades(char *);
+extern int assign_videocolors(char *);
#endif
/* ### vision.c ### */
-E void NDECL(vision_init);
-E int FDECL(does_block, (int, int, struct rm *));
-E void NDECL(vision_reset);
-E void FDECL(vision_recalc, (int));
-E void FDECL(block_point, (int, int));
-E void FDECL(unblock_point, (int, int));
-E boolean FDECL(clear_path, (int, int, int, int));
-E void FDECL(do_clear_area, (int, int, int,
- void (*)(int, int, genericptr), genericptr_t));
-E unsigned FDECL(howmonseen, (struct monst *));
+extern void vision_init(void);
+extern int does_block(int, int, struct rm *);
+extern void vision_reset(void);
+extern void vision_recalc(int);
+extern void block_point(int, int);
+extern void unblock_point(int, int);
+extern boolean clear_path(int, int, int, int);
+extern void do_clear_area(int, int, int, void(*)(int, int, void *),
+ genericptr_t);
+extern unsigned howmonseen(struct monst *);
#ifdef VMS
/* ### vmsfiles.c ### */
-E int FDECL(vms_link, (const char *, const char *));
-E int FDECL(vms_unlink, (const char *));
-E int FDECL(vms_creat, (const char *, unsigned int));
-E int FDECL(vms_open, (const char *, int, unsigned int));
-E boolean FDECL(same_dir, (const char *, const char *));
-E int FDECL(c__translate, (int));
-E char *FDECL(vms_basename, (const char *));
+extern int vms_link(const char *, const char *);
+extern int vms_unlink(const char *);
+extern int vms_creat(const char *, unsigned int);
+extern int vms_open(const char *, int, unsigned int);
+extern boolean same_dir(const char *, const char *);
+extern int c__translate(int);
+extern char *vms_basename(const char *);
/* ### vmsmail.c ### */
-E unsigned long NDECL(init_broadcast_trapping);
-E unsigned long NDECL(enable_broadcast_trapping);
-E unsigned long NDECL(disable_broadcast_trapping);
+extern unsigned long init_broadcast_trapping(void);
+extern unsigned long enable_broadcast_trapping(void);
+extern unsigned long disable_broadcast_trapping(void);
#if 0
-E struct mail_info *NDECL(parse_next_broadcast);
+extern struct mail_info *parse_next_broadcast(void);
#endif /*0*/
/* ### vmsmain.c ### */
-E int FDECL(main, (int, char **));
+extern int main(int, char **);
#ifdef CHDIR
-E void FDECL(chdirx, (const char *, BOOLEAN_P));
+extern void chdirx(const char *, boolean);
#endif /* CHDIR */
-E void FDECL(sethanguphandler, (void (*)(int)));
-E boolean NDECL(authorize_wizard_mode);
+extern void sethanguphandler(void(*)(int));
+extern boolean authorize_wizard_mode(void);
/* ### vmsmisc.c ### */
-E void NDECL(vms_abort) NORETURN;
-E void FDECL(vms_exit, (int)) NORETURN;
+extern void vms_abort(void) NORETURN;
+extern void vms_exit(int) NORETURN;
#ifdef PANICTRACE
-E void FDECL(vms_traceback, (int));
+extern void vms_traceback(int);
#endif
/* ### vmstty.c ### */
-E int NDECL(vms_getchar);
-E void NDECL(gettty);
-E void FDECL(settty, (const char *));
-E void FDECL(shuttty, (const char *));
-E void NDECL(setftty);
-E void NDECL(intron);
-E void NDECL(introff);
-E void VDECL(error, (const char *, ...)) PRINTF_F(1, 2);
+extern int vms_getchar(void);
+extern void gettty(void);
+extern void settty(const char *);
+extern void shuttty(const char *);
+extern void setftty(void);
+extern void intron(void);
+extern void introff(void);
+extern void error (const char *, ...);
#ifdef TIMED_DELAY
-E void FDECL(msleep, (unsigned));
+extern void msleep(unsigned);
#endif
/* ### vmsunix.c ### */
-E void NDECL(getlock);
-E void FDECL(regularize, (char *));
-E int NDECL(vms_getuid);
-E boolean FDECL(file_is_stmlf, (int));
-E int FDECL(vms_define, (const char *, const char *, int));
-E int FDECL(vms_putenv, (const char *));
-E char *NDECL(verify_termcap);
+extern void getlock(void);
+extern void regularize(char *);
+extern int vms_getuid(void);
+extern boolean file_is_stmlf(int);
+extern int vms_define(const char *, const char *, int);
+extern int vms_putenv(const char *);
+extern char *verify_termcap(void);
#if defined(CHDIR) || defined(SHELL) || defined(SECURE)
-E void NDECL(privoff);
-E void NDECL(privon);
+extern void privoff(void);
+extern void privon(void);
#endif
#ifdef SYSCF
-E boolean FDECL(check_user_string, (const char *));
+extern boolean check_user_string(const char *);
#endif
#ifdef SHELL
-E int NDECL(dosh);
+extern int dosh(void);
#endif
#if defined(SHELL) || defined(MAIL)
-E int FDECL(vms_doshell, (const char *, BOOLEAN_P));
+extern int vms_doshell(const char *, boolean);
#endif
#ifdef SUSPEND
-E int NDECL(dosuspend);
+extern int dosuspend(void);
#endif
#ifdef SELECTSAVED
-E int FDECL(vms_get_saved_games, (const char *, char ***));
+extern int vms_get_saved_games(const char *, char ***);
#endif
#endif /* VMS */
/* ### weapon.c ### */
-E const char *FDECL(weapon_descr, (struct obj *));
-E int FDECL(hitval, (struct obj *, struct monst *));
-E int FDECL(dmgval, (struct obj *, struct monst *));
-E int FDECL(special_dmgval, (struct monst *, struct monst *, long, long *));
-E void FDECL(silver_sears, (struct monst *, struct monst *, long));
-E struct obj *FDECL(select_rwep, (struct monst *));
-E boolean FDECL(monmightthrowwep, (struct obj *));
-E struct obj *FDECL(select_hwep, (struct monst *));
-E void FDECL(possibly_unwield, (struct monst *, BOOLEAN_P));
-E void FDECL(mwepgone, (struct monst *));
-E int FDECL(mon_wield_item, (struct monst *));
-E int NDECL(abon);
-E int NDECL(dbon);
-E void FDECL(wet_a_towel, (struct obj *, int, BOOLEAN_P));
-E void FDECL(dry_a_towel, (struct obj *, int, BOOLEAN_P));
-E char *FDECL(skill_level_name, (int, char *));
-E const char *FDECL(skill_name, (int));
-E boolean FDECL(can_advance, (int, BOOLEAN_P));
-E int NDECL(enhance_weapon_skill);
-E void FDECL(unrestrict_weapon_skill, (int));
-E void FDECL(use_skill, (int, int));
-E void FDECL(add_weapon_skill, (int));
-E void FDECL(lose_weapon_skill, (int));
-E void FDECL(drain_weapon_skill, (int));
-E int FDECL(weapon_type, (struct obj *));
-E int NDECL(uwep_skill_type);
-E int FDECL(weapon_hit_bonus, (struct obj *));
-E int FDECL(weapon_dam_bonus, (struct obj *));
-E void FDECL(skill_init, (const struct def_skill *));
+extern const char *weapon_descr(struct obj *);
+extern int hitval(struct obj *, struct monst *);
+extern int dmgval(struct obj *, struct monst *);
+extern int special_dmgval(struct monst *, struct monst *, long, long *);
+extern void silver_sears(struct monst *, struct monst *, long);
+extern struct obj *select_rwep(struct monst *);
+extern boolean monmightthrowwep(struct obj *);
+extern struct obj *select_hwep(struct monst *);
+extern void possibly_unwield(struct monst *, boolean);
+extern void mwepgone(struct monst *);
+extern int mon_wield_item(struct monst *);
+extern int abon(void);
+extern int dbon(void);
+extern void wet_a_towel(struct obj *, int, boolean);
+extern void dry_a_towel(struct obj *, int, boolean);
+extern char *skill_level_name(int, char *);
+extern const char *skill_name(int);
+extern boolean can_advance(int, boolean);
+extern int enhance_weapon_skill(void);
+extern void unrestrict_weapon_skill(int);
+extern void use_skill(int, int);
+extern void add_weapon_skill(int);
+extern void lose_weapon_skill(int);
+extern void drain_weapon_skill(int);
+extern int weapon_type(struct obj *);
+extern int uwep_skill_type(void);
+extern int weapon_hit_bonus(struct obj *);
+extern int weapon_dam_bonus(struct obj *);
+extern void skill_init(const struct def_skill *);
/* ### were.c ### */
-E void FDECL(were_change, (struct monst *));
-E int FDECL(counter_were, (int));
-E int FDECL(were_beastie, (int));
-E void FDECL(new_were, (struct monst *));
-E int FDECL(were_summon, (struct permonst *, BOOLEAN_P, int *, char *));
-E void NDECL(you_were);
-E void FDECL(you_unwere, (BOOLEAN_P));
-E void FDECL(set_ulycn, (int));
+extern void were_change(struct monst *);
+extern int counter_were(int);
+extern int were_beastie(int);
+extern void new_were(struct monst *);
+extern int were_summon(struct permonst *, boolean, int *, char *);
+extern void you_were(void);
+extern void you_unwere(boolean);
+extern void set_ulycn(int);
/* ### wield.c ### */
-E void FDECL(setuwep, (struct obj *));
-E void FDECL(setuqwep, (struct obj *));
-E void FDECL(setuswapwep, (struct obj *));
-E int NDECL(dowield);
-E int NDECL(doswapweapon);
-E int NDECL(dowieldquiver);
-E boolean FDECL(wield_tool, (struct obj *, const char *));
-E int NDECL(can_twoweapon);
-E void NDECL(drop_uswapwep);
-E int NDECL(dotwoweapon);
-E void NDECL(uwepgone);
-E void NDECL(uswapwepgone);
-E void NDECL(uqwepgone);
-E void FDECL(set_twoweap, (BOOLEAN_P));
-E void NDECL(untwoweapon);
-E int FDECL(chwepon, (struct obj *, int));
-E int FDECL(welded, (struct obj *));
-E void FDECL(weldmsg, (struct obj *));
-E void FDECL(setmnotwielded, (struct monst *, struct obj *));
-E boolean FDECL(mwelded, (struct obj *));
+extern void setuwep(struct obj *);
+extern void setuqwep(struct obj *);
+extern void setuswapwep(struct obj *);
+extern int dowield(void);
+extern int doswapweapon(void);
+extern int dowieldquiver(void);
+extern boolean wield_tool(struct obj *, const char *);
+extern int can_twoweapon(void);
+extern void drop_uswapwep(void);
+extern int dotwoweapon(void);
+extern void uwepgone(void);
+extern void uswapwepgone(void);
+extern void uqwepgone(void);
+extern void set_twoweap(boolean);
+extern void untwoweapon(void);
+extern int chwepon(struct obj *, int);
+extern int welded(struct obj *);
+extern void weldmsg(struct obj *);
+extern void setmnotwielded(struct monst *, struct obj *);
+extern boolean mwelded(struct obj *);
/* ### windows.c ### */
-E void FDECL(choose_windows, (const char *));
+extern void choose_windows(const char *);
#ifdef WINCHAIN
-void FDECL(addto_windowchain, (const char *s));
-void NDECL(commit_windowchain);
-#endif
-E boolean NDECL(genl_can_suspend_no);
-E boolean NDECL(genl_can_suspend_yes);
-E char FDECL(genl_message_menu, (CHAR_P, int, const char *));
-E void FDECL(genl_preference_update, (const char *));
-E char *FDECL(genl_getmsghistory, (BOOLEAN_P));
-E void FDECL(genl_putmsghistory, (const char *, BOOLEAN_P));
+void addto_windowchain(const char *s);
+void commit_windowchain(void);
+#endif
+extern boolean genl_can_suspend_no(void);
+extern boolean genl_can_suspend_yes(void);
+extern char genl_message_menu(char, int, const char *);
+extern void genl_preference_update(const char *);
+extern char *genl_getmsghistory(boolean);
+extern void genl_putmsghistory(const char *, boolean);
#ifdef HANGUPHANDLING
-E void NDECL(nhwindows_hangup);
-#endif
-E void NDECL(genl_status_init);
-E void NDECL(genl_status_finish);
-E void FDECL(genl_status_enablefield, (int, const char *, const char *,
- BOOLEAN_P));
-E void FDECL(genl_status_update, (int, genericptr_t, int, int, int,
- unsigned long *));
+extern void nhwindows_hangup(void);
+#endif
+extern void genl_status_init(void);
+extern void genl_status_finish(void);
+extern void genl_status_enablefield(int, const char *, const char *, boolean);
+extern void genl_status_update(int, genericptr_t, int, int, int,
+ unsigned long *);
#ifdef DUMPLOG
-E char *FDECL(dump_fmtstr, (const char *, char *, BOOLEAN_P));
-#endif
-E void FDECL(dump_open_log, (time_t));
-E void NDECL(dump_close_log);
-E void FDECL(dump_redirect, (BOOLEAN_P));
-E void FDECL(dump_forward_putstr, (winid, int, const char*, int));
-E int FDECL(has_color, (int));
-E int FDECL(glyph2ttychar, (int));
-E int FDECL(glyph2symidx, (int));
-E char *FDECL(encglyph, (int));
-E char *FDECL(decode_mixed, (char *, const char *));
-E void FDECL(genl_putmixed, (winid, int, const char *));
-E boolean FDECL(menuitem_invert_test, (int, unsigned, BOOLEAN_P));
+extern char *dump_fmtstr(const char *, char *, boolean);
+#endif
+extern void dump_open_log(time_t);
+extern void dump_close_log(void);
+extern void dump_redirect(boolean);
+extern void dump_forward_putstr(winid, int, const char*, int);
+extern int has_color(int);
+extern int glyph2ttychar(int);
+extern int glyph2symidx(int);
+extern char *encglyph(int);
+extern char *decode_mixed(char *, const char *);
+extern void genl_putmixed(winid, int, const char *);
+extern boolean menuitem_invert_test(int, unsigned, boolean);
/* ### winnt.c ### */
+
#ifdef WIN32
-E void NDECL(nethack_enter_winnt);
+extern void nethack_enter_winnt(void);
#endif
/* ### wizard.c ### */
-E void NDECL(amulet);
-E int FDECL(mon_has_amulet, (struct monst *));
-E int FDECL(mon_has_special, (struct monst *));
-E int FDECL(tactics, (struct monst *));
-E boolean FDECL(has_aggravatables, (struct monst *));
-E void NDECL(aggravate);
-E void NDECL(clonewiz);
-E int FDECL(pick_nasty, (int));
-E int FDECL(nasty, (struct monst *));
-E void NDECL(resurrect);
-E void NDECL(intervene);
-E void NDECL(wizdead);
-E void FDECL(cuss, (struct monst *));
+extern void amulet(void);
+extern int mon_has_amulet(struct monst *);
+extern int mon_has_special(struct monst *);
+extern int tactics(struct monst *);
+extern boolean has_aggravatables(struct monst *);
+extern void aggravate(void);
+extern void clonewiz(void);
+extern int pick_nasty(int);
+extern int nasty(struct monst *);
+extern void resurrect(void);
+extern void intervene(void);
+extern void wizdead(void);
+extern void cuss(struct monst *);
/* ### worm.c ### */
-E int NDECL(get_wormno);
-E void FDECL(initworm, (struct monst *, int));
-E void FDECL(worm_move, (struct monst *));
-E void FDECL(worm_nomove, (struct monst *));
-E void FDECL(wormgone, (struct monst *));
-E int FDECL(wormhitu, (struct monst *));
-E void FDECL(cutworm, (struct monst *, XCHAR_P, XCHAR_P, BOOLEAN_P));
-E void FDECL(see_wsegs, (struct monst *));
-E void FDECL(detect_wsegs, (struct monst *, BOOLEAN_P));
-E void FDECL(save_worm, (NHFILE *));
-E void FDECL(rest_worm, (NHFILE *));
-E void FDECL(place_wsegs, (struct monst *, struct monst *));
-E void FDECL(sanity_check_worm, (struct monst *));
-E void NDECL(wormno_sanity_check);
-E void FDECL(remove_worm, (struct monst *));
-E void FDECL(place_worm_tail_randomly, (struct monst *, XCHAR_P, XCHAR_P));
-E int FDECL(size_wseg, (struct monst *));
-E int FDECL(count_wsegs, (struct monst *));
-E boolean FDECL(worm_known, (struct monst *));
-E boolean FDECL(worm_cross, (int, int, int, int));
-E int FDECL(wseg_at, (struct monst *, int, int));
-E void FDECL(flip_worm_segs_vertical, (struct monst *, int, int));
-E void FDECL(flip_worm_segs_horizontal, (struct monst *, int, int));
+extern int get_wormno(void);
+extern void initworm(struct monst *, int);
+extern void worm_move(struct monst *);
+extern void worm_nomove(struct monst *);
+extern void wormgone(struct monst *);
+extern int wormhitu(struct monst *);
+extern void cutworm(struct monst *, xchar, xchar, boolean);
+extern void see_wsegs(struct monst *);
+extern void detect_wsegs(struct monst *, boolean);
+extern void save_worm(NHFILE *);
+extern void rest_worm(NHFILE *);
+extern void place_wsegs(struct monst *, struct monst *);
+extern void sanity_check_worm(struct monst *);
+extern void wormno_sanity_check(void);
+extern void remove_worm(struct monst *);
+extern void place_worm_tail_randomly(struct monst *, xchar, xchar);
+extern int size_wseg(struct monst *);
+extern int count_wsegs(struct monst *);
+extern boolean worm_known(struct monst *);
+extern boolean worm_cross(int, int, int, int);
+extern int wseg_at(struct monst *, int, int);
+extern void flip_worm_segs_vertical(struct monst *, int, int);
+extern void flip_worm_segs_horizontal(struct monst *, int, int);
/* ### worn.c ### */
-E void FDECL(setworn, (struct obj *, long));
-E void FDECL(setnotworn, (struct obj *));
-E void NDECL(allunworn);
-E struct obj *FDECL(wearmask_to_obj, (long));
-E long FDECL(wearslot, (struct obj *));
-E void FDECL(mon_set_minvis, (struct monst *));
-E void FDECL(mon_adjust_speed, (struct monst *, int, struct obj *));
-E void FDECL(update_mon_intrinsics,
- (struct monst *, struct obj *, BOOLEAN_P, BOOLEAN_P));
-E int FDECL(find_mac, (struct monst *));
-E void FDECL(m_dowear, (struct monst *, BOOLEAN_P));
-E struct obj *FDECL(which_armor, (struct monst *, long));
-E void FDECL(mon_break_armor, (struct monst *, BOOLEAN_P));
-E void FDECL(bypass_obj, (struct obj *));
-E void NDECL(clear_bypasses);
-E void FDECL(bypass_objlist, (struct obj *, BOOLEAN_P));
-E struct obj *FDECL(nxt_unbypassed_obj, (struct obj *));
-E struct obj *FDECL(nxt_unbypassed_loot, (Loot *, struct obj *));
-E int FDECL(racial_exception, (struct monst *, struct obj *));
+extern void setworn(struct obj *, long);
+extern void setnotworn(struct obj *);
+extern void allunworn(void);
+extern struct obj *wearmask_to_obj(long);
+extern long wearslot(struct obj *);
+extern void mon_set_minvis(struct monst *);
+extern void mon_adjust_speed(struct monst *, int, struct obj *);
+extern void update_mon_intrinsics(struct monst *, struct obj *, boolean,
+ boolean);
+extern int find_mac(struct monst *);
+extern void m_dowear(struct monst *, boolean);
+extern struct obj *which_armor(struct monst *, long);
+extern void mon_break_armor(struct monst *, boolean);
+extern void bypass_obj(struct obj *);
+extern void clear_bypasses(void);
+extern void bypass_objlist(struct obj *, boolean);
+extern struct obj *nxt_unbypassed_obj(struct obj *);
+extern struct obj *nxt_unbypassed_loot(Loot *, struct obj *);
+extern int racial_exception(struct monst *, struct obj *);
/* ### write.c ### */
-E int FDECL(dowrite, (struct obj *));
+extern int dowrite(struct obj *);
/* ### zap.c ### */
-E void FDECL(learnwand, (struct obj *));
-E int FDECL(bhitm, (struct monst *, struct obj *));
-E void FDECL(probe_monster, (struct monst *));
-E boolean FDECL(get_obj_location, (struct obj *, xchar *, xchar *, int));
-E boolean FDECL(get_mon_location, (struct monst *, xchar *, xchar *, int));
-E struct monst *FDECL(get_container_location,
- (struct obj * obj, int *, int *));
-E struct monst *FDECL(montraits, (struct obj *, coord *, BOOLEAN_P));
-E struct monst *FDECL(revive, (struct obj *, BOOLEAN_P));
-E int FDECL(unturn_dead, (struct monst *));
-E void NDECL(unturn_you);
-E void FDECL(cancel_item, (struct obj *));
-E boolean FDECL(drain_item, (struct obj *, BOOLEAN_P));
-E boolean FDECL(obj_unpolyable, (struct obj *));
-E struct obj *FDECL(poly_obj, (struct obj *, int));
-E boolean FDECL(obj_resists, (struct obj *, int, int));
-E boolean FDECL(obj_shudders, (struct obj *));
-E void FDECL(do_osshock, (struct obj *));
-E int FDECL(bhito, (struct obj *, struct obj *));
-E int FDECL(bhitpile,
- (struct obj *, int (*)(OBJ_P, OBJ_P), int, int, SCHAR_P));
-E int FDECL(zappable, (struct obj *));
-E void NDECL(do_enlightenment_effect);
-E void FDECL(zapnodir, (struct obj *));
-E int NDECL(dozap);
-E int FDECL(zapyourself, (struct obj *, BOOLEAN_P));
-E void FDECL(ubreatheu, (struct attack *));
-E int FDECL(lightdamage, (struct obj *, BOOLEAN_P, int));
-E boolean FDECL(flashburn, (long));
-E boolean FDECL(cancel_monst, (struct monst *, struct obj *, BOOLEAN_P,
- BOOLEAN_P, BOOLEAN_P));
-E void NDECL(zapsetup);
-E void NDECL(zapwrapup);
-E void FDECL(weffects, (struct obj *));
-E int FDECL(spell_damage_bonus, (int));
-E const char *FDECL(exclam, (int force));
-E void FDECL(hit, (const char *, struct monst *, const char *));
-E void FDECL(miss, (const char *, struct monst *));
-E struct monst *FDECL(bhit, (int, int, int, enum bhit_call_types,
- int (*)(MONST_P, OBJ_P),
- int (*)(OBJ_P, OBJ_P), struct obj **));
-E struct monst *FDECL(boomhit, (struct obj *, int, int));
-E int FDECL(zhitm, (struct monst *, int, int, struct obj **));
-E int FDECL(burn_floor_objects, (int, int, BOOLEAN_P, BOOLEAN_P));
-E void FDECL(buzz, (int, int, XCHAR_P, XCHAR_P, int, int));
-E void FDECL(dobuzz, (int, int, XCHAR_P, XCHAR_P, int, int, BOOLEAN_P));
-E void FDECL(melt_ice, (XCHAR_P, XCHAR_P, const char *));
-E void FDECL(start_melt_ice_timeout, (XCHAR_P, XCHAR_P, long));
-E void FDECL(melt_ice_away, (ANY_P *, long));
-E int FDECL(zap_over_floor, (XCHAR_P, XCHAR_P, int, boolean *, SHORT_P));
-E void FDECL(fracture_rock, (struct obj *));
-E boolean FDECL(break_statue, (struct obj *));
-E void FDECL(destroy_item, (int, int));
-E int FDECL(destroy_mitem, (struct monst *, int, int));
-E int FDECL(resist, (struct monst *, CHAR_P, int, int));
-E void NDECL(makewish);
+extern void learnwand(struct obj *);
+extern int bhitm(struct monst *, struct obj *);
+extern void probe_monster(struct monst *);
+extern boolean get_obj_location(struct obj *, xchar *, xchar *, int);
+extern boolean get_mon_location(struct monst *, xchar *, xchar *, int);
+extern struct monst *get_container_location(struct obj * obj, int *, int *);
+extern struct monst *montraits(struct obj *, coord *, boolean);
+extern struct monst *revive(struct obj *, boolean);
+extern int unturn_dead(struct monst *);
+extern void unturn_you(void);
+extern void cancel_item(struct obj *);
+extern boolean drain_item(struct obj *, boolean);
+extern boolean obj_unpolyable(struct obj *);
+extern struct obj *poly_obj(struct obj *, int);
+extern boolean obj_resists(struct obj *, int, int);
+extern boolean obj_shudders(struct obj *);
+extern void do_osshock(struct obj *);
+extern int bhito(struct obj *, struct obj *);
+extern int bhitpile(struct obj *, int(*)(struct obj *, struct obj *), int,
+ int, schar);
+extern int zappable(struct obj *);
+extern void do_enlightenment_effect(void);
+extern void zapnodir(struct obj *);
+extern int dozap(void);
+extern int zapyourself(struct obj *, boolean);
+extern void ubreatheu(struct attack *);
+extern int lightdamage(struct obj *, boolean, int);
+extern boolean flashburn(long);
+extern boolean cancel_monst(struct monst *, struct obj *, boolean, boolean,
+ boolean);
+extern void zapsetup(void);
+extern void zapwrapup(void);
+extern void weffects(struct obj *);
+extern int spell_damage_bonus(int);
+extern const char *exclam(int force);
+extern void hit(const char *, struct monst *, const char *);
+extern void miss(const char *, struct monst *);
+extern struct monst *bhit(int, int, int, enum bhit_call_types,
+ int(*)(struct monst *, struct obj *),
+ int(*)(struct obj *, struct obj *), struct obj **);
+extern struct monst *boomhit(struct obj *, int, int);
+extern int zhitm(struct monst *, int, int, struct obj **);
+extern int burn_floor_objects(int, int, boolean, boolean);
+extern void buzz(int, int, xchar, xchar, int, int);
+extern void dobuzz(int, int, xchar, xchar, int, int, boolean);
+extern void melt_ice(xchar, xchar, const char *);
+extern void start_melt_ice_timeout(xchar, xchar, long);
+extern void melt_ice_away(union any *, long);
+extern int zap_over_floor(xchar, xchar, int, boolean *, short);
+extern void fracture_rock(struct obj *);
+extern boolean break_statue(struct obj *);
+extern void destroy_item(int, int);
+extern int destroy_mitem(struct monst *, int, int);
+extern int resist(struct monst *, char, int, int);
+extern void makewish(void);
#endif /* !MAKEDEFS_C && !MDLIB_C */
-#undef E
-
#endif /* EXTERN_H */
struct ext_func_tab {
uchar key;
const char *ef_txt, *ef_desc;
- int NDECL((*ef_funct));
+ int (*ef_funct)(void);
int flags;
const char *f_text;
};
if nethack is built with MONITOR_HEAP enabled and they aren't; this
declaration has been moved out of the '#else' below to avoid getting
a complaint from -Wmissing-prototypes when building with MONITOR_HEAP */
-extern char *FDECL(dupstr, (const char *));
+extern char *dupstr(const char *);
/*
* MONITOR_HEAP is conditionally used for primitive memory leak debugging.
*/
#ifdef MONITOR_HEAP
/* plain alloc() is not declared except in alloc.c */
-extern long *FDECL(nhalloc, (unsigned int, const char *, int));
-extern void FDECL(nhfree, (genericptr_t, const char *, int));
-extern char *FDECL(nhdupstr, (const char *, const char *, int));
+extern long *nhalloc(unsigned int, const char *, int);
+extern void nhfree(genericptr_t, const char *, int);
+extern char *nhdupstr(const char *, const char *, int);
/* this predates C99's __func__; that is trickier to use conditionally
because it is not implemented as a preprocessor macro; MONITOR_HEAP
wouldn't gain much benefit from it anyway so continue to live without it;
#define dupstr(s) nhdupstr(s, __FILE__, (int) __LINE__)
#else /* !MONITOR_HEAP */
/* declare alloc.c's alloc(); allocations made with it use ordinary free() */
-extern long *FDECL(alloc, (unsigned int)); /* alloc.c */
+extern long *alloc(unsigned int); /* alloc.c */
#endif /* ?MONITOR_HEAP */
/* Used for consistency checks of various data files; declare it here so
* 2. Add a pointer to your new struct to the mextra struct in this
* file.
* 3. Add a referencing macro at bottom of this file after the mextra
- * struct (see MNAME, EGD, EPRI, ESHK, EMIN, or EDOG for examples).
+ * struct (see MGIVENNAME, EGD, EPRI, ESHK, EMIN, or EDOG for examples).
* 4. If your new field isn't a pointer and requires a non-zero value
* on initialization, add code to init_mextra() in src/makemon.c
* 5. Create a newXX(mtmp) function and possibly a free_XX(mtmp)
* function in an appropriate new or existing source file and add
* a prototype for it to include/extern.h.
*
- * void FDECL(newXX, (struct monst *));
- * void FDECL(free_XX, (struct monst *));
+ * void newXX(struct monst *);
+ * void free_XX(struct monst *);
*
* void
* newXX(mtmp)
/* Stuff to help the user with some common, yet significant errors */
#define INTERJECT_PANIC 0
#define INTERJECTION_TYPES (INTERJECT_PANIC + 1)
-extern void FDECL(interject_assistance,
- (int, int, genericptr_t, genericptr_t));
-extern void FDECL(interject, (int));
+extern void interject_assistance(int, int, genericptr_t, genericptr_t);
+extern void interject(int);
/*
*===============================================
#ifdef strcasecmp
#undef strcasecmp
#endif
-/* extern int NDECL(getlock); */
+/* extern int getlock(void); */
#endif
#ifdef _MSC_VER
#define ABORT C('a')
#define getuid() 1
#define getlogin() ((char *) 0)
-extern void NDECL(win32_abort);
-extern void FDECL(nttty_preference_update, (const char *));
-extern void NDECL(toggle_mouse_support);
-extern void FDECL(map_subkeyvalue, (char *));
+extern void win32_abort(void);
+extern void nttty_preference_update(const char *);
+extern void toggle_mouse_support(void);
+extern void map_subkeyvalue(char *);
#if defined(WIN32CON)
-extern void FDECL(set_altkeyhandler, (const char *));
+extern void set_altkeyhandler(const char *);
#endif
-extern void NDECL(raw_clear_screen);
+extern void raw_clear_screen(void);
#include <fcntl.h>
#ifndef __BORLANDC__
#define ALLOCA_HACK /* used in util/panic.c */
#endif
-extern int FDECL(set_win32_option, (const char *, const char *));
+extern int set_win32_option(const char *, const char *);
#define LEFTBUTTON FROM_LEFT_1ST_BUTTON_PRESSED
#define RIGHTBUTTON RIGHTMOST_BUTTON_PRESSED
#define MIDBUTTON FROM_LEFT_2ND_BUTTON_PRESSED
#define MOUSEMASK (LEFTBUTTON | RIGHTBUTTON | MIDBUTTON)
#ifdef CHANGE_COLOR
-extern int FDECL(alternative_palette, (char *));
+extern int alternative_palette(char *);
#endif
#define nethack_enter(argc, argv) nethack_enter_winnt()
-extern void FDECL(nethack_exit, (int)) NORETURN;
-extern boolean FDECL(file_exists, (const char *));
-extern boolean FDECL(file_newer, (const char *, const char *));
+extern void nethack_exit(int) NORETURN;
+extern boolean file_exists(const char *);
+extern boolean file_newer(const char *, const char *);
#ifndef SYSTEM_H
#include "system.h"
#endif
* compatible with compilers which do not support macro stringization (i.e.
* #x to turn x into its string form).
*/
-extern void FDECL(nt_assert_failed, (const char *, const char *, int));
+extern void nt_assert_failed(const char *, const char *, int);
#define nhassert(expression) (void)((!!(expression)) || \
(nt_assert_failed(#expression, __FILE__, __LINE__), 0))
* for it to include/extern.h. The majority of these are currently
* located in mkobj.c for convenience.
*
- * void FDECL(newXX, (struct obj *));
- * void FDECL(free_XX, (struct obj *));
+ * void newXX(struct obj *);
+ * void free_XX(struct obj *);
*
* void
* newxx(otmp)
* updates that should accompany your change.
*/
-static int FDECL(optfn_boolean, (int, int, BOOLEAN_P, char *, char *));
+static int optfn_boolean(int, int, boolean, char *, char *);
enum OptType {BoolOpt, CompOpt};
enum Y_N {No, Yes};
enum Off_On {Off, On};
enum Y_N dupeok;
enum Y_N pfx;
boolean opt_in_out, *addr;
- int FDECL((*optfn), (int, int, BOOLEAN_P, char *, char *));
+ int (*optfn)(int, int, boolean, char *, char *);
const char *alias;
const char *descr;
const char *prefixgw;
#if defined(NHOPT_PROTO)
#define NHOPTB(a, b, c, s, i, n, v, d, al, bp)
#define NHOPTC(a, b, c, s, n, v, d, h, al, z) \
-static int FDECL(optfn_##a, (int, int, BOOLEAN_P, char *, char *));
+static int optfn_##a(int, int, boolean, char *, char *);
#define NHOPTP(a, b, c, s, n, v, d, h, al, z) \
-static int FDECL(pfxfn_##a, (int, int, BOOLEAN_P, char *, char *));
+static int pfxfn_##a(int, int, boolean, char *, char *);
#elif defined(NHOPT_ENUM)
#define NHOPTB(a, b, c, s, i, n, v, d, al, bp) \
/* generic callback function */
-typedef boolean FDECL((*callback_proc), (genericptr_t, genericptr_t));
+typedef boolean (*callback_proc)(genericptr_t, genericptr_t);
/*
* player_flags
* includes config.h instead of hack.h so doesn't see extern.h.
*/
/* ### drawing.c ### */
-extern int FDECL(def_char_to_objclass, (CHAR_P));
-extern int FDECL(def_char_to_monclass, (CHAR_P));
-extern int FDECL(def_char_is_furniture, (CHAR_P));
+extern int def_char_to_objclass(char);
+extern int def_char_to_monclass(char);
+extern int def_char_is_furniture(char);
#endif /* RM_H */
#endif
#ifndef SIG_RET_TYPE
#if defined(NHSTDC) || defined(POSIX_TYPES) || defined(OS2) || defined(__DECC)
-#define SIG_RET_TYPE void (*)()
+#define SIG_RET_TYPE void (*)(int)
#endif
#endif
#ifndef SIG_RET_TYPE
E long NDECL(lrand48);
E void FDECL(srand48, (long));
#else
-E long lrand48();
-E void srand48();
+extern long lrand48(void);
+extern void srand48(long);
#endif /* MACOSX */
#endif /* BSD || ULTRIX || RANDOM */
E void sleep();
#endif
#if defined(ULTRIX) || defined(SYSV)
-E unsigned sleep();
+extern unsigned int sleep(unsigned int);
#endif
#if defined(HPUX)
E unsigned int FDECL(sleep, (unsigned int));
#endif
E char *FDECL(getenv, (const char *));
-E char *getlogin();
+extern char *getlogin(void);
#if defined(HPUX) && !defined(_POSIX_SOURCE)
E long NDECL(getuid);
E long NDECL(getgid);
#else
#if !(defined(HPUX) && defined(_POSIX_SOURCE))
E int FDECL(tgetent, (char *, const char *));
-E void FDECL(tputs, (const char *, int, int (*)()));
+extern void tputs(const char *, int, int (*)(int));
#endif
E int FDECL(tgetnum, (const char *));
E int FDECL(tgetflag, (const char *));
unsigned char *indexes; /* for paletted images */
};
-boolean FDECL(read_tiles, (const char *filename, BOOLEAN_P true_color));
-const struct Pixel *NDECL(get_palette);
-void FDECL(set_tile_type, (BOOLEAN_P true_color));
-void NDECL(free_tiles);
-const struct TileImage *FDECL(get_tile, (unsigned tile_index));
+boolean read_tiles(const char *filename, boolean true_color);
+const struct Pixel *get_palette(void);
+void set_tile_type(boolean true_color);
+void free_tiles(void);
+const struct TileImage *get_tile(unsigned tile_index);
/* For resizing tiles */
-struct TileImage *FDECL(stretch_tile, (const struct TileImage *,
- unsigned, unsigned));
-void FDECL(free_tile, (struct TileImage *));
+struct TileImage *stretch_tile(const struct TileImage *, unsigned,
+ unsigned);
+void free_tile(struct TileImage *);
/* Used internally by the tile set code */
struct TileSetImage {
unsigned tile_width, tile_height;
};
-boolean FDECL(read_bmp_tiles, (const char *filename,
- struct TileSetImage *image));
-boolean FDECL(read_gif_tiles, (const char *filename,
- struct TileSetImage *image));
-boolean FDECL(read_png_tiles, (const char *filename,
- struct TileSetImage *image));
+boolean read_bmp_tiles(const char *filename, struct TileSetImage *image);
+boolean read_gif_tiles(const char *filename, struct TileSetImage *image);
+boolean read_png_tiles(const char *filename, struct TileSetImage *image);
#endif
#define TIMEOUT_H
/* generic timeout function */
-typedef void FDECL((*timeout_proc), (ANY_P *, long));
+typedef void (*timeout_proc)(ANY_P *, long);
/* kind of timer */
enum timer_type {
#include "wintype.h" /* winid */
#endif
-#ifndef E
-#define E extern
-#endif
-
#if defined(BOS) || defined(NHSTDC)
#define DIMENSION_P int
#else
#define MAX_HISTORY 60 /* max history saved on message window */
/* Window variables (winX.c). */
-E struct xwindow window_list[MAX_WINDOWS];
-E XtAppContext app_context; /* context of application */
-E Widget toplevel; /* toplevel widget */
-E Atom wm_delete_window; /* delete window protocol */
-E boolean exit_x_event; /* exit condition for event loop */
+extern struct xwindow window_list[MAX_WINDOWS];
+extern XtAppContext app_context; /* context of application */
+extern Widget toplevel; /* toplevel widget */
+extern Atom wm_delete_window; /* delete window protocol */
+extern boolean exit_x_event; /* exit condition for event loop */
#define EXIT_ON_KEY_PRESS 0 /* valid values for exit_x_event */
#define EXIT_ON_KEY_OR_BUTTON_PRESS 1
#define EXIT_ON_EXIT 2
#define EXIT_ON_SENT_EVENT 3
-E int click_x, click_y, click_button, updated_inventory;
-E boolean plsel_ask_name;
+extern int click_x, click_y, click_button, updated_inventory;
+extern boolean plsel_ask_name;
typedef struct {
Boolean slow; /* issue prompts between map and message wins */
#endif
} AppResources;
-E AppResources appResources;
-E void (*input_func)();
+extern AppResources appResources;
+extern void (*input_func)(Widget, XEvent *, String *, Cardinal *);
extern struct window_procs X11_procs;
} while (0)
/* ### Window.c ### */
-E Font FDECL(WindowFont, (Widget));
-E XFontStruct *FDECL(WindowFontStruct, (Widget));
+extern Font WindowFont(Widget);
+extern XFontStruct *WindowFontStruct(Widget);
/* ### dialogs.c ### */
-E Widget FDECL(CreateDialog, (Widget, String, XtCallbackProc, XtCallbackProc));
-E void FDECL(SetDialogPrompt, (Widget, String));
-E String FDECL(GetDialogResponse, (Widget));
-E void FDECL(SetDialogResponse, (Widget, String, unsigned));
-E void FDECL(positionpopup, (Widget, BOOLEAN_P));
+extern Widget CreateDialog(Widget, String, XtCallbackProc, XtCallbackProc);
+extern void SetDialogPrompt(Widget, String);
+extern String GetDialogResponse(Widget);
+extern void SetDialogResponse(Widget, String, unsigned);
+extern void positionpopup(Widget, boolean);
/* ### winX.c ### */
-E struct xwindow *FDECL(find_widget, (Widget));
-E XColor FDECL(get_nhcolor, (struct xwindow *, int));
-E void FDECL(init_menu_nhcolors, (struct xwindow *));
-E void FDECL(load_boldfont, (struct xwindow *, Widget));
-E Boolean FDECL(nhApproxColor, (Screen *, Colormap, char *, XColor *));
-E Boolean FDECL(nhCvtStringToPixel, (Display *, XrmValuePtr, Cardinal *,
- XrmValuePtr, XrmValuePtr, XtPointer *));
-E void FDECL(get_window_frame_extents, (Widget,
- long *, long *, long *, long *));
-E void FDECL(get_widget_window_geometry, (Widget, int *, int *, int *, int *));
-E char *FDECL(fontname_boldify, (const char *));
-E Dimension FDECL(nhFontHeight, (Widget));
-E char FDECL(key_event_to_char, (XKeyEvent *));
-E void FDECL(msgkey, (Widget, XtPointer, XEvent *));
-E void FDECL(highlight_yn, (BOOLEAN_P));
-E void FDECL(nh_XtPopup, (Widget, int, Widget));
-E void FDECL(nh_XtPopdown, (Widget));
-E void FDECL(win_X11_init, (int));
-E void FDECL(find_scrollbars, (Widget, Widget *, Widget *));
-E void FDECL(nh_keyscroll, (Widget, XEvent *, String *, Cardinal *));
+extern struct xwindow *find_widget(Widget);
+extern XColor get_nhcolor(struct xwindow *, int);
+extern void init_menu_nhcolors(struct xwindow *);
+extern void load_boldfont(struct xwindow *, Widget);
+extern Boolean nhApproxColor(Screen *, Colormap, char *, XColor *);
+extern Boolean nhCvtStringToPixel(Display *, XrmValuePtr, Cardinal *,
+ XrmValuePtr, XrmValuePtr, XtPointer *);
+extern void get_window_frame_extents(Widget, long *, long *, long *, long *);
+extern void get_widget_window_geometry(Widget, int *, int *, int *, int *);
+extern char *fontname_boldify(const char *);
+extern Dimension nhFontHeight(Widget);
+extern char key_event_to_char(XKeyEvent *);
+extern void msgkey(Widget, XtPointer, XEvent *);
+extern void highlight_yn(boolean);
+extern void nh_XtPopup(Widget, int, Widget);
+extern void nh_XtPopdown(Widget);
+extern void win_X11_init(int);
+extern void find_scrollbars(Widget, Widget *, Widget *);
+extern void nh_keyscroll(Widget, XEvent *, String *, Cardinal *);
/* ### winmesg.c ### */
-E void FDECL(set_message_slider, (struct xwindow *));
-E void FDECL(create_message_window, (struct xwindow *, BOOLEAN_P, Widget));
-E void FDECL(destroy_message_window, (struct xwindow *));
-E void FDECL(display_message_window, (struct xwindow *));
-E void FDECL(append_message, (struct xwindow *, const char *));
-E void FDECL(set_last_pause, (struct xwindow *));
+extern void set_message_slider(struct xwindow *);
+extern void create_message_window(struct xwindow *, boolean, Widget);
+extern void destroy_message_window(struct xwindow *);
+extern void display_message_window(struct xwindow *);
+extern void append_message(struct xwindow *, const char *);
+extern void set_last_pause(struct xwindow *);
/* ### winmap.c ### */
-E void NDECL(post_process_tiles);
-E void FDECL(check_cursor_visibility, (struct xwindow *));
-E void FDECL(display_map_window, (struct xwindow *));
-E void FDECL(clear_map_window, (struct xwindow *));
-E void FDECL(map_input, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(set_map_size, (struct xwindow *, DIMENSION_P, DIMENSION_P));
-E void FDECL(create_map_window, (struct xwindow *, BOOLEAN_P, Widget));
-E void FDECL(destroy_map_window, (struct xwindow *));
-E int FDECL(x_event, (int));
+extern void post_process_tiles(void);
+extern void check_cursor_visibility(struct xwindow *);
+extern void display_map_window(struct xwindow *);
+extern void clear_map_window(struct xwindow *);
+extern void map_input(Widget, XEvent *, String *, Cardinal *);
+extern void set_map_size(struct xwindow *, Dimension, Dimension);
+extern void create_map_window(struct xwindow *, boolean, Widget);
+extern void destroy_map_window(struct xwindow *);
+extern int x_event(int);
/* ### winmenu.c ### */
-E void FDECL(menu_delete, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(menu_key, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(create_menu_window, (struct xwindow *));
-E void FDECL(destroy_menu_window, (struct xwindow *));
+extern void menu_delete(Widget, XEvent *, String *, Cardinal *);
+extern void menu_key(Widget, XEvent *, String *, Cardinal *);
+extern void create_menu_window(struct xwindow *);
+extern void destroy_menu_window(struct xwindow *);
/* ### winmisc.c ### */
-E XtPointer FDECL(i2xtp, (int));
-E int FDECL(xtp2i, (XtPointer));
-E void FDECL(ps_key, (Widget, XEvent *, String *,
- Cardinal *)); /* player selection action */
-E void FDECL(race_key, (Widget, XEvent *, String *,
- Cardinal *)); /* race selection action */
-E void FDECL(gend_key, (Widget, XEvent *, String *, Cardinal *)); /* gender */
-E void FDECL(algn_key,
- (Widget, XEvent *, String *, Cardinal *)); /* alignment */
-E void FDECL(ec_delete, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(ec_key, (Widget, XEvent *, String *,
- Cardinal *)); /* extended command action */
-E void FDECL(plsel_quit, (Widget, XEvent *, String *,
- Cardinal *)); /* player selection dialog */
-E void FDECL(plsel_play, (Widget, XEvent *, String *,
- Cardinal *)); /* player selection dialog */
-E void FDECL(plsel_randomize, (Widget, XEvent *, String *,
- Cardinal *)); /* player selection dialog */
-E void NDECL(release_extended_cmds);
+extern XtPointer i2xtp(int);
+extern int xtp2i(XtPointer);
+extern void ps_key(Widget, XEvent *, String *,
+ Cardinal *); /* player selection action */
+extern void race_key(Widget, XEvent *, String *,
+ Cardinal *); /* race selection action */
+extern void gend_key(Widget, XEvent *, String *, Cardinal *); /* gender */
+extern void algn_key(Widget, XEvent *, String *, Cardinal *); /* alignment */
+extern void ec_delete(Widget, XEvent *, String *, Cardinal *);
+extern void ec_key(Widget, XEvent *, String *,
+ Cardinal *); /* extended command action */
+extern void plsel_quit(Widget, XEvent *, String *,
+ Cardinal *); /* player selection dialog */
+extern void plsel_play(Widget, XEvent *, String *,
+ Cardinal *); /* player selection dialog */
+extern void plsel_randomize(Widget, XEvent *, String *,
+ Cardinal *); /* player selection dialog */
+extern void release_extended_cmds(void);
/* ### winstatus.c ### */
-E void FDECL(create_status_window, (struct xwindow *, BOOLEAN_P, Widget));
-E void FDECL(destroy_status_window, (struct xwindow *));
-E void FDECL(adjust_status, (struct xwindow *, const char *));
-E void NDECL(null_out_status);
-E void NDECL(check_turn_events);
+extern void create_status_window(struct xwindow *, boolean, Widget);
+extern void destroy_status_window(struct xwindow *);
+extern void adjust_status(struct xwindow *, const char *);
+extern void null_out_status(void);
+extern void check_turn_events(void);
/* ### wintext.c ### */
-E void FDECL(delete_text, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(dismiss_text, (Widget, XEvent *, String *, Cardinal *));
-E void FDECL(key_dismiss_text, (Widget, XEvent *, String *, Cardinal *));
+extern void delete_text(Widget, XEvent *, String *, Cardinal *);
+extern void dismiss_text(Widget, XEvent *, String *, Cardinal *);
+extern void key_dismiss_text(Widget, XEvent *, String *, Cardinal *);
#ifdef GRAPHIC_TOMBSTONE
-E void FDECL(rip_dismiss_text, (Widget, XEvent *, String *, Cardinal *));
+extern void rip_dismiss_text(Widget, XEvent *, String *, Cardinal *);
#endif
-E void FDECL(add_to_text_window, (struct xwindow *, int, const char *));
-E void FDECL(display_text_window, (struct xwindow *, BOOLEAN_P));
-E void FDECL(create_text_window, (struct xwindow *));
-E void FDECL(destroy_text_window, (struct xwindow *));
-E void FDECL(clear_text_window, (struct xwindow *));
-E void FDECL(append_text_buffer, (struct text_buffer *, const char *,
- BOOLEAN_P)); /* text buffer routines */
-E void FDECL(init_text_buffer, (struct text_buffer *));
-E void FDECL(clear_text_buffer, (struct text_buffer *));
-E void FDECL(free_text_buffer, (struct text_buffer *));
+extern void add_to_text_window(struct xwindow *, int, const char *);
+extern void display_text_window(struct xwindow *, boolean);
+extern void create_text_window(struct xwindow *);
+extern void destroy_text_window(struct xwindow *);
+extern void clear_text_window(struct xwindow *);
+extern void append_text_buffer(struct text_buffer *, const char *,
+ boolean); /* text buffer routines */
+extern void init_text_buffer(struct text_buffer *);
+extern void clear_text_buffer(struct text_buffer *);
+extern void free_text_buffer(struct text_buffer *);
#ifdef GRAPHIC_TOMBSTONE
-E void FDECL(calculate_rip_text, (int, time_t));
+extern void calculate_rip_text(int, time_t);
#endif
/* ### winval.c ### */
-E Widget FDECL(create_value, (Widget, const char *));
-E void FDECL(set_name, (Widget, const char *));
-E void FDECL(set_name_width, (Widget, int));
-E int FDECL(get_name_width, (Widget));
-E Widget FDECL(get_value_widget, (Widget));
-E void FDECL(set_value, (Widget, const char *));
-E void FDECL(set_value_width, (Widget, int));
-E int FDECL(get_value_width, (Widget));
-E void FDECL(hilight_value, (Widget));
-E void FDECL(swap_fg_bg, (Widget));
-
+extern Widget create_value(Widget, const char *);
+extern void set_name(Widget, const char *);
+extern void set_name_width(Widget, int);
+extern int get_name_width(Widget);
+extern Widget get_value_widget(Widget);
+extern void set_value_width(Widget, int);
+extern int get_value_width(Widget);
+extern void hilight_value(Widget);
+extern void swap_fg_bg(Widget);
+extern void set_value(Widget w, const char *new_value);
/* external declarations */
-E char *FDECL(X11_getmsghistory, (BOOLEAN_P));
-E void FDECL(X11_putmsghistory, (const char *, BOOLEAN_P));
-E void FDECL(X11_init_nhwindows, (int *, char **));
-E void NDECL(X11_player_selection);
-E void NDECL(X11_askname);
-E void NDECL(X11_get_nh_event);
-E void FDECL(X11_exit_nhwindows, (const char *));
-E void FDECL(X11_suspend_nhwindows, (const char *));
-E void NDECL(X11_resume_nhwindows);
-E winid FDECL(X11_create_nhwindow, (int));
-E void FDECL(X11_clear_nhwindow, (winid));
-E void FDECL(X11_display_nhwindow, (winid, BOOLEAN_P));
-E void FDECL(X11_destroy_nhwindow, (winid));
-E void FDECL(X11_curs, (winid, int, int));
-E void FDECL(X11_putstr, (winid, int, const char *));
-E void FDECL(X11_display_file, (const char *, BOOLEAN_P));
-E void FDECL(X11_start_menu, (winid, unsigned long));
-E void FDECL(X11_add_menu, (winid, const glyph_info *, const ANY_P *,
- CHAR_P, CHAR_P, int,
- const char *, unsigned int));
-E void FDECL(X11_end_menu, (winid, const char *));
-E int FDECL(X11_select_menu, (winid, int, MENU_ITEM_P **));
-E void NDECL(X11_update_inventory);
-E void NDECL(X11_mark_synch);
-E void NDECL(X11_wait_synch);
+extern char *X11_getmsghistory(boolean);
+extern void X11_putmsghistory(const char *, boolean);
+extern void X11_init_nhwindows(int *, char **);
+extern void X11_player_selection(void);
+extern void X11_askname(void);
+extern void X11_get_nh_event(void);
+extern void X11_exit_nhwindows(const char *);
+extern void X11_suspend_nhwindows(const char *);
+extern void X11_resume_nhwindows(void);
+extern winid X11_create_nhwindow(int);
+extern void X11_clear_nhwindow(winid);
+extern void X11_display_nhwindow(winid, boolean);
+extern void X11_destroy_nhwindow(winid);
+extern void X11_curs(winid, int, int);
+extern void X11_putstr(winid, int, const char *);
+extern void X11_display_file(const char *, boolean);
+extern void X11_start_menu(winid, unsigned long);
+extern void X11_add_menu(winid, const glyph_info *, const ANY_P *, char,
+ char, int, const char *, unsigned int);
+extern void X11_end_menu(winid, const char *);
+extern int X11_select_menu(winid, int, MENU_ITEM_P **);
+extern void X11_update_inventory(void);
+extern void X11_mark_synch(void);
+extern void X11_wait_synch(void);
#ifdef CLIPPING
-E void FDECL(X11_cliparound, (int, int));
+extern void X11_cliparound(int, int);
#endif
-E void FDECL(X11_print_glyph, (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
-E void FDECL(X11_raw_print, (const char *));
-E void FDECL(X11_raw_print_bold, (const char *));
-E int NDECL(X11_nhgetch);
-E int FDECL(X11_nh_poskey, (int *, int *, int *));
-E void NDECL(X11_nhbell);
-E int NDECL(X11_doprev_message);
-E char FDECL(X11_yn_function, (const char *, const char *, CHAR_P));
-E void FDECL(X11_getlin, (const char *, char *));
-E int NDECL(X11_get_ext_cmd);
-E void FDECL(X11_number_pad, (int));
-E void NDECL(X11_delay_output);
-E void NDECL(X11_status_init);
-E void NDECL(X11_status_finish);
-E void FDECL(X11_status_enablefield, (int, const char *, const char *,
- BOOLEAN_P));
-E void FDECL(X11_status_update, (int, genericptr_t, int, int, int,
- unsigned long *));
+extern void X11_print_glyph(winid, xchar, xchar, const glyph_info *,
+ const glyph_info *);
+extern void X11_raw_print(const char *);
+extern void X11_raw_print_bold(const char *);
+extern int X11_nhgetch(void);
+extern int X11_nh_poskey(int *, int *, int *);
+extern void X11_nhbell(void);
+extern int X11_doprev_message(void);
+extern char X11_yn_function(const char *, const char *, char);
+extern void X11_getlin(const char *, char *);
+extern int X11_get_ext_cmd(void);
+extern void X11_number_pad(int);
+extern void X11_delay_output(void);
+extern void X11_status_init(void);
+extern void X11_status_finish(void);
+extern void X11_status_enablefield(int, const char *, const char *, boolean);
+extern void X11_status_update(int, genericptr_t, int, int, int,
+ unsigned long *);
/* other defs that really should go away (they're tty specific) */
-E void NDECL(X11_start_screen);
-E void NDECL(X11_end_screen);
+extern void X11_start_screen(void);
+extern void X11_end_screen(void);
#ifdef GRAPHIC_TOMBSTONE
-E void FDECL(X11_outrip, (winid, int, time_t));
+extern void X11_outrip(winid, int, time_t);
#else
-E void FDECL(genl_outrip, (winid, int, time_t));
+extern void genl_outrip(winid, int, time_t);
#endif
-E void FDECL(X11_preference_update, (const char *));
+extern void X11_preference_update(const char *);
#endif /* WINX_H */
extern void curses_resume_nhwindows(void);
extern winid curses_create_nhwindow(int type);
extern void curses_clear_nhwindow(winid wid);
-extern void curses_display_nhwindow(winid wid, BOOLEAN_P block);
+extern void curses_display_nhwindow(winid wid, boolean block);
extern void curses_destroy_nhwindow(winid wid);
extern void curses_curs(winid wid, int x, int y);
extern void curses_putstr(winid wid, int attr, const char *text);
-extern void curses_display_file(const char *filename, BOOLEAN_P must_exist);
+extern void curses_display_file(const char *filename, boolean must_exist);
extern void curses_start_menu(winid wid, unsigned long);
extern void curses_add_menu(winid wid, const glyph_info *,
const ANY_P * identifier,
- CHAR_P accelerator, CHAR_P group_accel, int attr,
+ char accelerator, char group_accel, int attr,
const char *str, unsigned int itemflags);
extern void curses_end_menu(winid wid, const char *prompt);
extern int curses_select_menu(winid wid, int how, MENU_ITEM_P **selected);
extern void curses_mark_synch(void);
extern void curses_wait_synch(void);
extern void curses_cliparound(int x, int y);
-extern void curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
+extern void curses_print_glyph(winid wid, xchar x, xchar y,
const glyph_info *, const glyph_info *);
extern void curses_raw_print(const char *str);
extern void curses_raw_print_bold(const char *str);
extern void curses_nhbell(void);
extern int curses_doprev_message(void);
extern char curses_yn_function(const char *question, const char *choices,
- CHAR_P def);
+ char def);
extern void curses_getlin(const char *question, char *input);
extern int curses_get_ext_cmd(void);
extern void curses_number_pad(int state);
extern void curses_line_input_dialog(const char *prompt,
char *answer, int buffer);
extern int curses_character_input_dialog(const char *prompt,
- const char *choices, CHAR_P def);
+ const char *choices, char def);
extern int curses_ext_cmd(void);
extern void curses_create_nhmenu(winid wid, unsigned long);
extern void curses_add_nhmenu_item(winid wid, const glyph_info *,
- const ANY_P *identifier, CHAR_P accelerator,
- CHAR_P group_accel, int attr,
+ const ANY_P *identifier, char accelerator,
+ char group_accel, int attr,
const char *str, unsigned itemflags);
extern void curs_menu_set_bottom_heavy(winid);
extern void curses_finalize_nhmenu(winid wid, const char *prompt);
extern void curses_update_inv(void);
extern void curses_add_inv(int, const glyph_info *,
- CHAR_P, attr_t, const char *);
+ char, attr_t, const char *);
/* cursinit.c */
extern void curses_teardown_messages(void);
extern void curses_prev_mesg(void);
extern void curses_count_window(const char *count_text);
-char *curses_getmsghistory(BOOLEAN_P);
-void curses_putmsghistory(const char *, BOOLEAN_P);
+char *curses_getmsghistory(boolean);
+void curses_putmsghistory(const char *, boolean);
#endif /* WINCURS_H */
#ifndef WINGEM_H
#define WINGEM_H
-#define E extern
-
/* menu structure */
typedef struct Gmi {
struct Gmi *Gmi_next;
/* ### wingem1.c ### */
#ifdef CLIPPING
-E void NDECL(setclipped);
+extern void setclipped(void);
#endif
-E void FDECL(docorner, (int, int));
-E void NDECL(end_glyphout);
-E void FDECL(g_putch, (int));
-E void FDECL(win_Gem_init, (int));
-E int NDECL(mar_gem_init);
-E char NDECL(mar_ask_class);
-E char *NDECL(mar_ask_name);
-E int FDECL(mar_create_window, (int));
-E void FDECL(mar_destroy_nhwindow, (int));
-E void FDECL(mar_print_glyph, (int, int, int, const glyph_info *, const glyph_info *));
-E void FDECL(mar_print_line, (int, int, int, char *));
-E void FDECL(mar_set_message, (char *, char *, char *));
-E Gem_menu_item *NDECL(mar_hol_inv);
-E void FDECL(mar_set_menu_type, (int));
-E void NDECL(mar_reverse_menu);
-E void FDECL(mar_set_menu_title, (const char *));
-E void NDECL(mar_set_accelerators);
-E void FDECL(mar_add_menu, (winid, Gem_menu_item *));
-E void FDECL(mar_change_menu_2_text, (winid));
-E void FDECL(mar_add_message, (const char *));
-E void NDECL(mar_status_dirty);
-E int FDECL(mar_hol_win_type, (int));
-E void NDECL(mar_clear_messagewin);
-E void FDECL(mar_set_no_glyph, (int));
-E void NDECL(mar_map_curs_weiter);
+extern void docorner(int, int);
+extern void end_glyphout(void);
+extern void g_putch(int);
+extern void win_Gem_init(int);
+extern int mar_gem_init(void);
+extern char mar_ask_class(void);
+extern char *mar_ask_name(void);
+extern int mar_create_window(int);
+extern void mar_destroy_nhwindow(int);
+extern void mar_print_glyph(int, int, int, const glyph_info *,
+ const glyph_info *);
+extern void mar_print_line(int, int, int, char *);
+extern void mar_set_message(char *, char *, char *);
+extern Gem_menu_item *mar_hol_inv(void);
+extern void mar_set_menu_type(int);
+extern void mar_reverse_menu(void);
+extern void mar_set_menu_title(const char *);
+extern void mar_set_accelerators(void);
+extern void mar_add_menu(winid, Gem_menu_item *);
+extern void mar_change_menu_2_text(winid);
+extern void mar_add_message(const char *);
+extern void mar_status_dirty(void);
+extern int mar_hol_win_type(int);
+extern void mar_clear_messagewin(void);
+extern void mar_set_no_glyph(int);
+extern void mar_map_curs_weiter(void);
/* external declarations */
-E void FDECL(Gem_init_nhwindows, (int *, char **));
-E void NDECL(Gem_player_selection);
-E void NDECL(Gem_askname);
-E void NDECL(Gem_get_nh_event);
-E void FDECL(Gem_exit_nhwindows, (const char *));
-E void FDECL(Gem_suspend_nhwindows, (const char *));
-E void NDECL(Gem_resume_nhwindows);
-E winid FDECL(Gem_create_nhwindow, (int));
-E void FDECL(Gem_clear_nhwindow, (winid));
-E void FDECL(Gem_display_nhwindow, (winid, BOOLEAN_P));
-E void FDECL(Gem_dismiss_nhwindow, (winid));
-E void FDECL(Gem_destroy_nhwindow, (winid));
-E void FDECL(Gem_curs, (winid, int, int));
-E void FDECL(Gem_putstr, (winid, int, const char *));
-E void FDECL(Gem_display_file, (const char *, BOOLEAN_P));
-E void FDECL(Gem_start_menu, (winid, unsigned long));
-E void FDECL(Gem_add_menu, (winid, const glyph_info *,
- const ANY_P *, CHAR_P, CHAR_P, int,
- const char *, unsigned int));
-E void FDECL(Gem_end_menu, (winid, const char *));
-E int FDECL(Gem_select_menu, (winid, int, MENU_ITEM_P **));
-E char FDECL(Gem_message_menu, (CHAR_P, int, const char *));
-E void NDECL(Gem_update_inventory);
-E void NDECL(Gem_mark_synch);
-E void NDECL(Gem_wait_synch);
+extern void Gem_init_nhwindows(int *, char **);
+extern void Gem_player_selection(void);
+extern void Gem_askname(void);
+extern void Gem_get_nh_event(void);
+extern void Gem_exit_nhwindows(const char *);
+extern void Gem_suspend_nhwindows(const char *);
+extern void Gem_resume_nhwindows(void);
+extern winid Gem_create_nhwindow(int);
+extern void Gem_clear_nhwindow(winid);
+extern void Gem_display_nhwindow(winid, boolean);
+extern void Gem_dismiss_nhwindow(winid);
+extern void Gem_destroy_nhwindow(winid);
+extern void Gem_curs(winid, int, int);
+extern void Gem_putstr(winid, int, const char *);
+extern void Gem_display_file(const char *, boolean);
+extern void Gem_start_menu(winid, unsigned long);
+extern void Gem_add_menu(winid, const glyph_info *, const ANY_P *, char, char,
+ int, const char *, unsigned int);
+extern void Gem_end_menu(winid, const char *);
+extern int Gem_select_menu(winid, int, MENU_ITEM_P **);
+extern char Gem_message_menu(char, int, const char *);
+extern void Gem_update_inventory(void);
+extern void Gem_mark_synch(void);
+extern void Gem_wait_synch(void);
#ifdef CLIPPING
-E void FDECL(Gem_cliparound, (int, int));
+extern void Gem_cliparound(int, int);
#endif
#ifdef POSITIONBAR
-E void FDECL(Gem_update_positionbar, (char *));
+extern void Gem_update_positionbar(char *);
#endif
-E void FDECL(Gem_print_glyph, (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
-E void FDECL(Gem_raw_print, (const char *));
-E void FDECL(Gem_raw_print_bold, (const char *));
-E int NDECL(Gem_nhgetch);
-E int FDECL(Gem_nh_poskey, (int *, int *, int *));
-E void NDECL(Gem_nhbell);
-E int NDECL(Gem_doprev_message);
-E char FDECL(Gem_yn_function, (const char *, const char *, CHAR_P));
-E void FDECL(Gem_getlin, (const char *, char *));
-E int NDECL(Gem_get_ext_cmd);
-E void FDECL(Gem_number_pad, (int));
-E void NDECL(Gem_delay_output);
+extern void Gem_print_glyph(winid, xchar, xchar, const glyph_info *,
+ const glyph_info *);
+extern void Gem_raw_print(const char *);
+extern void Gem_raw_print_bold(const char *);
+extern int Gem_nhgetch(void);
+extern int Gem_nh_poskey(int *, int *, int *);
+extern void Gem_nhbell(void);
+extern int Gem_doprev_message(void);
+extern char Gem_yn_function(const char *, const char *, char);
+extern void Gem_getlin(const char *, char *);
+extern int Gem_get_ext_cmd(void);
+extern void Gem_number_pad(int);
+extern void Gem_delay_output(void);
#ifdef CHANGE_COLOR
-E void FDECL(Gem_change_color, (int color, long rgb, int reverse));
-E char *NDECL(Gem_get_color_string);
+extern void Gem_change_color(int color, long rgb, int reverse);
+extern char *Gem_get_color_string(void);
#endif
/* other defs that really should go away (they're tty specific) */
-E void NDECL(Gem_start_screen);
-E void NDECL(Gem_end_screen);
+extern void Gem_start_screen(void);
+extern void Gem_end_screen(void);
-E void FDECL(genl_outrip, (winid, int, time_t));
+extern void genl_outrip(winid, int, time_t);
-#undef E
#endif /* WINGEM_H */
unsigned long wincap; /* window port capability options supported */
unsigned long wincap2; /* additional window port capability options */
boolean has_color[CLR_MAX];
- void FDECL((*win_init_nhwindows), (int *, char **));
- void NDECL((*win_player_selection));
- void NDECL((*win_askname));
- void NDECL((*win_get_nh_event));
- void FDECL((*win_exit_nhwindows), (const char *));
- void FDECL((*win_suspend_nhwindows), (const char *));
- void NDECL((*win_resume_nhwindows));
- winid FDECL((*win_create_nhwindow), (int));
- void FDECL((*win_clear_nhwindow), (winid));
- void FDECL((*win_display_nhwindow), (winid, BOOLEAN_P));
- void FDECL((*win_destroy_nhwindow), (winid));
- void FDECL((*win_curs), (winid, int, int));
- void FDECL((*win_putstr), (winid, int, const char *));
- void FDECL((*win_putmixed), (winid, int, const char *));
- void FDECL((*win_display_file), (const char *, BOOLEAN_P));
- void FDECL((*win_start_menu), (winid, unsigned long));
- void FDECL((*win_add_menu), (winid, const glyph_info *, const ANY_P *,
- CHAR_P, CHAR_P, int,
- const char *, unsigned int));
- void FDECL((*win_end_menu), (winid, const char *));
- int FDECL((*win_select_menu), (winid, int, MENU_ITEM_P **));
- char FDECL((*win_message_menu), (CHAR_P, int, const char *));
- void NDECL((*win_update_inventory));
- void NDECL((*win_mark_synch));
- void NDECL((*win_wait_synch));
+ void (*win_init_nhwindows)(int *, char **);
+ void (*win_player_selection)(void);
+ void (*win_askname)(void);
+ void (*win_get_nh_event)(void);
+ void (*win_exit_nhwindows)(const char *);
+ void (*win_suspend_nhwindows)(const char *);
+ void (*win_resume_nhwindows)(void);
+ winid (*win_create_nhwindow)(int);
+ void (*win_clear_nhwindow)(winid);
+ void (*win_display_nhwindow)(winid, boolean);
+ void (*win_destroy_nhwindow)(winid);
+ void (*win_curs)(winid, int, int);
+ void (*win_putstr)(winid, int, const char *);
+ void (*win_putmixed)(winid, int, const char *);
+ void (*win_display_file)(const char *, boolean);
+ void (*win_start_menu)(winid, unsigned long);
+ void (*win_add_menu)(winid, const glyph_info *, const ANY_P *,
+ char, char, int,
+ const char *, unsigned int);
+ void (*win_end_menu)(winid, const char *);
+ int (*win_select_menu)(winid, int, MENU_ITEM_P **);
+ char (*win_message_menu)(char, int, const char *);
+ void (*win_update_inventory)(void);
+ void (*win_mark_synch)(void);
+ void (*win_wait_synch)(void);
#ifdef CLIPPING
- void FDECL((*win_cliparound), (int, int));
+ void (*win_cliparound)(int, int);
#endif
#ifdef POSITIONBAR
- void FDECL((*win_update_positionbar), (char *));
+ void (*win_update_positionbar)(char *);
#endif
- void FDECL((*win_print_glyph), (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
- void FDECL((*win_raw_print), (const char *));
- void FDECL((*win_raw_print_bold), (const char *));
- int NDECL((*win_nhgetch));
- int FDECL((*win_nh_poskey), (int *, int *, int *));
- void NDECL((*win_nhbell));
- int NDECL((*win_doprev_message));
- char FDECL((*win_yn_function), (const char *, const char *, CHAR_P));
- void FDECL((*win_getlin), (const char *, char *));
- int NDECL((*win_get_ext_cmd));
- void FDECL((*win_number_pad), (int));
- void NDECL((*win_delay_output));
+ void (*win_print_glyph)(winid, xchar, xchar,
+ const glyph_info *, const glyph_info *);
+ void (*win_raw_print)(const char *);
+ void (*win_raw_print_bold)(const char *);
+ int (*win_nhgetch)(void);
+ int (*win_nh_poskey)(int *, int *, int *);
+ void (*win_nhbell)(void);
+ int (*win_doprev_message)(void);
+ char (*win_yn_function)(const char *, const char *, char);
+ void (*win_getlin)(const char *, char *);
+ int (*win_get_ext_cmd)(void);
+ void (*win_number_pad)(int);
+ void (*win_delay_output)(void);
#ifdef CHANGE_COLOR
- void FDECL((*win_change_color), (int, long, int));
+ void (*win_change_color)(int, long, int);
#ifdef MAC
- void FDECL((*win_change_background), (int));
- short FDECL((*win_set_font_name), (winid, char *));
+ void (*win_change_background)(int);
+ short (*win_set_font_name)(winid, char *);
#endif
- char *NDECL((*win_get_color_string));
+ char *(*win_get_color_string)(void);
#endif
/* other defs that really should go away (they're tty specific) */
- void NDECL((*win_start_screen));
- void NDECL((*win_end_screen));
+ void (*win_start_screen)(void);
+ void (*win_end_screen)(void);
- void FDECL((*win_outrip), (winid, int, time_t));
- void FDECL((*win_preference_update), (const char *));
- char *FDECL((*win_getmsghistory), (BOOLEAN_P));
- void FDECL((*win_putmsghistory), (const char *, BOOLEAN_P));
- void NDECL((*win_status_init));
- void NDECL((*win_status_finish));
- void FDECL((*win_status_enablefield),
- (int, const char *, const char *, BOOLEAN_P));
- void FDECL((*win_status_update), (int, genericptr_t, int, int, int,
- unsigned long *));
- boolean NDECL((*win_can_suspend));
+ void (*win_outrip)(winid, int, time_t);
+ void (*win_preference_update)(const char *);
+ char *(*win_getmsghistory)(boolean);
+ void (*win_putmsghistory)(const char *, boolean);
+ void (*win_status_init)(void);
+ void (*win_status_finish)(void);
+ void (*win_status_enablefield)(int, const char *, const char *,
+ boolean);
+ void (*win_status_update)(int, genericptr_t, int, int, int,
+ unsigned long *);
+ boolean (*win_can_suspend)(void);
};
extern
* '+' are reserved for processors. */
unsigned long wincap; /* window port capability options supported */
unsigned long wincap2; /* additional window port capability options */
- void FDECL((*win_init_nhwindows), (CARGS, int *, char **));
- void FDECL((*win_player_selection), (CARGS));
- void FDECL((*win_askname), (CARGS));
- void FDECL((*win_get_nh_event), (CARGS));
- void FDECL((*win_exit_nhwindows), (CARGS, const char *));
- void FDECL((*win_suspend_nhwindows), (CARGS, const char *));
- void FDECL((*win_resume_nhwindows), (CARGS));
- winid FDECL((*win_create_nhwindow), (CARGS, int));
- void FDECL((*win_clear_nhwindow), (CARGS, winid));
- void FDECL((*win_display_nhwindow), (CARGS, winid, BOOLEAN_P));
- void FDECL((*win_destroy_nhwindow), (CARGS, winid));
- void FDECL((*win_curs), (CARGS, winid, int, int));
- void FDECL((*win_putstr), (CARGS, winid, int, const char *));
- void FDECL((*win_putmixed), (CARGS, winid, int, const char *));
- void FDECL((*win_display_file), (CARGS, const char *, BOOLEAN_P));
- void FDECL((*win_start_menu), (CARGS, winid, unsigned long));
- void FDECL((*win_add_menu), (CARGS, winid, const glyph_info *,
- const ANY_P *, CHAR_P, CHAR_P, int,
- const char *, unsigned int));
- void FDECL((*win_end_menu), (CARGS, winid, const char *));
- int FDECL((*win_select_menu), (CARGS, winid, int, MENU_ITEM_P **));
- char FDECL((*win_message_menu), (CARGS, CHAR_P, int, const char *));
- void FDECL((*win_update_inventory), (CARGS));
- void FDECL((*win_mark_synch), (CARGS));
- void FDECL((*win_wait_synch), (CARGS));
+ void (*win_init_nhwindows)(CARGS, int *, char **);
+ void (*win_player_selection)(CARGS);
+ void (*win_askname)(CARGS);
+ void (*win_get_nh_event)(CARGS);
+ void (*win_exit_nhwindows)(CARGS, const char *);
+ void (*win_suspend_nhwindows)(CARGS, const char *);
+ void (*win_resume_nhwindows)(CARGS);
+ winid (*win_create_nhwindow)(CARGS, int);
+ void (*win_clear_nhwindow)(CARGS, winid);
+ void (*win_display_nhwindow)(CARGS, winid, boolean);
+ void (*win_destroy_nhwindow)(CARGS, winid);
+ void (*win_curs)(CARGS, winid, int, int);
+ void (*win_putstr)(CARGS, winid, int, const char *);
+ void (*win_putmixed)(CARGS, winid, int, const char *);
+ void (*win_display_file)(CARGS, const char *, boolean);
+ void (*win_start_menu)(CARGS, winid, unsigned long);
+ void (*win_add_menu)(CARGS, winid, const glyph_info *,
+ const ANY_P *, char, char, int,
+ const char *, unsigned int);
+ void (*win_end_menu)(CARGS, winid, const char *);
+ int (*win_select_menu)(CARGS, winid, int, MENU_ITEM_P **);
+ char (*win_message_menu)(CARGS, char, int, const char *);
+ void (*win_update_inventory)(CARGS);
+ void (*win_mark_synch)(CARGS);
+ void (*win_wait_synch)(CARGS);
#ifdef CLIPPING
- void FDECL((*win_cliparound), (CARGS, int, int));
+ void (*win_cliparound)(CARGS, int, int);
#endif
#ifdef POSITIONBAR
- void FDECL((*win_update_positionbar), (CARGS, char *));
+ void (*win_update_positionbar)(CARGS, char *);
#endif
- void FDECL((*win_print_glyph), (CARGS, winid, XCHAR_P, XCHAR_P,
- const glyph_info *,
- const glyph_info *));
- void FDECL((*win_raw_print), (CARGS, const char *));
- void FDECL((*win_raw_print_bold), (CARGS, const char *));
- int FDECL((*win_nhgetch), (CARGS));
- int FDECL((*win_nh_poskey), (CARGS, int *, int *, int *));
- void FDECL((*win_nhbell), (CARGS));
- int FDECL((*win_doprev_message), (CARGS));
- char FDECL((*win_yn_function),
- (CARGS, const char *, const char *, CHAR_P));
- void FDECL((*win_getlin), (CARGS, const char *, char *));
- int FDECL((*win_get_ext_cmd), (CARGS));
- void FDECL((*win_number_pad), (CARGS, int));
- void FDECL((*win_delay_output), (CARGS));
+ void (*win_print_glyph)(CARGS, winid, xchar, xchar,
+ const glyph_info *,
+ const glyph_info *);
+ void (*win_raw_print)(CARGS, const char *);
+ void (*win_raw_print_bold)(CARGS, const char *);
+ int (*win_nhgetch)(CARGS);
+ int (*win_nh_poskey)(CARGS, int *, int *, int *);
+ void (*win_nhbell)(CARGS);
+ int (*win_doprev_message)(CARGS);
+ char (*win_yn_function),
+ (CARGS, const char *, const char *, char);
+ void (*win_getlin)(CARGS, const char *, char *);
+ int (*win_get_ext_cmd)(CARGS);
+ void (*win_number_pad)(CARGS, int);
+ void (*win_delay_output)(CARGS);
#ifdef CHANGE_COLOR
- void FDECL((*win_change_color), (CARGS, int, long, int));
+ void (*win_change_color)(CARGS, int, long, int);
#ifdef MAC
- void FDECL((*win_change_background), (CARGS, int));
- short FDECL((*win_set_font_name), (CARGS, winid, char *));
+ void (*win_change_background)(CARGS, int);
+ short (*win_set_font_name)(CARGS, winid, char *);
#endif
- char *FDECL((*win_get_color_string), (CARGS));
+ char *(*win_get_color_string)(CARGS);
#endif
/* other defs that really should go away (they're tty specific) */
- void FDECL((*win_start_screen), (CARGS));
- void FDECL((*win_end_screen), (CARGS));
+ void (*win_start_screen)(CARGS);
+ void (*win_end_screen)(CARGS);
- void FDECL((*win_outrip), (CARGS, winid, int, time_t));
- void FDECL((*win_preference_update), (CARGS, const char *));
- char *FDECL((*win_getmsghistory), (CARGS, BOOLEAN_P));
- void FDECL((*win_putmsghistory), (CARGS, const char *, BOOLEAN_P));
- void FDECL((*win_status_init), (CARGS));
- void FDECL((*win_status_finish), (CARGS));
- void FDECL((*win_status_enablefield),
- (CARGS, int, const char *, const char *, BOOLEAN_P));
- void FDECL((*win_status_update), (CARGS, int, genericptr_t, int, int, int,
- unsigned long *));
- boolean FDECL((*win_can_suspend), (CARGS));
+ void (*win_outrip)(CARGS, winid, int, time_t);
+ void (*win_preference_update)(CARGS, const char *);
+ char *(*win_getmsghistory)(CARGS, boolean);
+ void (*win_putmsghistory)(CARGS, const char *, boolean);
+ void (*win_status_init)(CARGS);
+ void (*win_status_finish)(CARGS);
+ void (*win_status_enablefield),
+ (CARGS, int, const char *, const char *, boolean);
+ void (*win_status_update)(CARGS, int, genericptr_t, int, int, int,
+ unsigned long *);
+ boolean (*win_can_suspend)(CARGS);
};
#endif /* WINCHAIN */
/*
* window port routines available in sys/share/safeproc.c
*/
-extern struct window_procs *FDECL(get_safe_procs, (int));
-extern void FDECL(safe_init_nhwindows, (int *, char **));
-extern void NDECL(safe_player_selection);
-extern void NDECL(safe_askname);
-extern void NDECL(safe_get_nh_event);
-extern void FDECL(safe_exit_nhwindows, (const char *));
-extern void FDECL(safe_suspend_nhwindows, (const char *));
-extern void NDECL(safe_resume_nhwindows);
-extern winid FDECL(safe_create_nhwindow, (int));
-extern void FDECL(safe_clear_nhwindow, (winid));
-extern void FDECL(safe_display_nhwindow, (winid, BOOLEAN_P));
-extern void FDECL(safe_destroy_nhwindow, (winid));
-extern void FDECL(safe_curs, (winid, int, int));
-extern void FDECL(safe_putstr, (winid, int, const char *));
-extern void FDECL(safe_putmixed, (winid, int, const char *));
-extern void FDECL(safe_display_file, (const char *, BOOLEAN_P));
-extern void FDECL(safe_start_menu, (winid, unsigned long));
-extern void FDECL(safe_add_menu, (winid, const glyph_info *, const ANY_P *,
- CHAR_P, CHAR_P, int, const char *,
- unsigned int));
-extern void FDECL(safe_end_menu, (winid, const char *));
-extern int FDECL(safe_select_menu, (winid, int, MENU_ITEM_P **));
-extern char FDECL(safe_message_menu, (CHAR_P, int, const char *));
-extern void NDECL(safe_update_inventory);
-extern void NDECL(safe_mark_synch);
-extern void NDECL(safe_wait_synch);
+extern struct window_procs *get_safe_procs(int);
+extern void safe_init_nhwindows(int *, char **);
+extern void safe_player_selection(void);
+extern void safe_askname(void);
+extern void safe_get_nh_event(void);
+extern void safe_exit_nhwindows(const char *);
+extern void safe_suspend_nhwindows(const char *);
+extern void safe_resume_nhwindows(void);
+extern winid safe_create_nhwindow(int);
+extern void safe_clear_nhwindow(winid);
+extern void safe_display_nhwindow(winid, boolean);
+extern void safe_destroy_nhwindow(winid);
+extern void safe_curs(winid, int, int);
+extern void safe_putstr(winid, int, const char *);
+extern void safe_putmixed(winid, int, const char *);
+extern void safe_display_file(const char *, boolean);
+extern void safe_start_menu(winid, unsigned long);
+extern void safe_add_menu(winid, const glyph_info *, const ANY_P *,
+ char, char, int, const char *,
+ unsigned int);
+extern void safe_end_menu(winid, const char *);
+extern int safe_select_menu(winid, int, MENU_ITEM_P **);
+extern char safe_message_menu(char, int, const char *);
+extern void safe_update_inventory(void);
+extern void safe_mark_synch(void);
+extern void safe_wait_synch(void);
#ifdef CLIPPING
-extern void FDECL(safe_cliparound, (int, int));
+extern void safe_cliparound(int, int);
#endif
#ifdef POSITIONBAR
-extern void FDECL(safe_update_positionbar, (char *));
+extern void safe_update_positionbar(char *);
#endif
-extern void FDECL(safe_print_glyph, (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
-extern void FDECL(safe_raw_print, (const char *));
-extern void FDECL(safe_raw_print_bold, (const char *));
-extern int NDECL(safe_nhgetch);
-extern int FDECL(safe_nh_poskey, (int *, int *, int *));
-extern void NDECL(safe_nhbell);
-extern int NDECL(safe_doprev_message);
-extern char FDECL(safe_yn_function, (const char *, const char *, CHAR_P));
-extern void FDECL(safe_getlin, (const char *, char *));
-extern int NDECL(safe_get_ext_cmd);
-extern void FDECL(safe_number_pad, (int));
-extern void NDECL(safe_delay_output);
+extern void safe_print_glyph(winid, xchar, xchar,
+ const glyph_info *, const glyph_info *);
+extern void safe_raw_print(const char *);
+extern void safe_raw_print_bold(const char *);
+extern int safe_nhgetch(void);
+extern int safe_nh_poskey(int *, int *, int *);
+extern void safe_nhbell(void);
+extern int safe_doprev_message(void);
+extern char safe_yn_function(const char *, const char *, char);
+extern void safe_getlin(const char *, char *);
+extern int safe_get_ext_cmd(void);
+extern void safe_number_pad(int);
+extern void safe_delay_output(void);
#ifdef CHANGE_COLOR
-extern void FDECL(safe_change_color, (int, long, int));
+extern void safe_change_color(int, long, int);
#ifdef MAC
-extern void FDECL(safe_change_background, (int));
-extern short FDECL(safe_set_font_name, (winid, char *));
+extern void safe_change_background(int);
+extern short safe_set_font_name(winid, char *);
#endif
-extern char *NDECL(safe_get_color_string);
+extern char *safe_get_color_string(void);
#endif
-extern void NDECL(safe_start_screen);
-extern void NDECL(safe_end_screen);
-extern void FDECL(safe_outrip, (winid, int, time_t));
-extern void FDECL(safe_preference_update, (const char *));
-extern char *FDECL(safe_getmsghistory, (BOOLEAN_P));
-extern void FDECL(safe_putmsghistory, (const char *, BOOLEAN_P));
-extern void NDECL(safe_status_init);
-extern void NDECL(safe_status_finish);
-extern void FDECL(safe_status_enablefield, (int, const char *, const char *,
- BOOLEAN_P));
-extern void FDECL(safe_status_update, (int, genericptr_t, int, int, int,
- unsigned long *));
-extern boolean NDECL(safe_can_suspend);
-extern void FDECL(stdio_raw_print, (const char *));
-extern void FDECL(stdio_nonl_raw_print, (const char *));
-extern void FDECL(stdio_raw_print_bold, (const char *));
-extern void NDECL(stdio_wait_synch);
-extern int NDECL(stdio_nhgetch);
+extern void safe_start_screen(void);
+extern void safe_end_screen(void);
+extern void safe_outrip(winid, int, time_t);
+extern void safe_preference_update(const char *);
+extern char *safe_getmsghistory(boolean);
+extern void safe_putmsghistory(const char *, boolean);
+extern void safe_status_init(void);
+extern void safe_status_finish(void);
+extern void safe_status_enablefield(int, const char *, const char *,
+ boolean);
+extern void safe_status_update(int, genericptr_t, int, int, int,
+ unsigned long *);
+extern boolean safe_can_suspend(void);
+extern void stdio_raw_print(const char *);
+extern void stdio_nonl_raw_print(const char *);
+extern void stdio_raw_print_bold(const char *);
+extern void stdio_wait_synch(void);
+extern int stdio_nhgetch(void);
#endif /* SAFEPROCS */
#endif /* WINPROCS_H */
/* port specific external function references */
/* ### getline.c ### */
-E void FDECL(xwaitforspace, (const char *));
+E void xwaitforspace(const char *);
/* ### termcap.c, video.c ### */
-E void FDECL(tty_startup, (int *, int *));
+E void tty_startup(int *, int *);
#ifndef NO_TERMS
-E void NDECL(tty_shutdown);
+E void tty_shutdown(void);
#endif
-E int FDECL(xputc, (int));
-E void FDECL(xputs, (const char *));
+E int xputc(int);
+E void xputs(const char *);
#if defined(SCREEN_VGA) || defined(SCREEN_8514)
-E void FDECL(xputg, (int, int, unsigned));
+E void xputg(int, int, unsigned);
#endif
-E void NDECL(cl_end);
-E void NDECL(clear_screen);
-E void NDECL(home);
-E void NDECL(standoutbeg);
-E void NDECL(standoutend);
+E void cl_end(void);
+E void clear_screen(void);
+E void home(void);
+E void standoutbeg(void);
+E void standoutend(void);
#if 0
-E void NDECL(revbeg);
-E void NDECL(boldbeg);
-E void NDECL(blinkbeg);
-E void NDECL(dimbeg);
-E void NDECL(m_end);
+E void revbeg(void);
+E void boldbeg(void);
+E void blinkbeg(void);
+E void dimbeg(void);
+E void m_end(void);
#endif
-E void NDECL(backsp);
-E void NDECL(graph_on);
-E void NDECL(graph_off);
-E void NDECL(cl_eos);
+E void backsp(void);
+E void graph_on(void);
+E void graph_off(void);
+E void cl_eos(void);
/*
* termcap.c (or facsimiles in other ports) is the right place for doing
* a color or whatever. wintty.c should concern itself with WHERE to put
* stuff in a window.
*/
-E int FDECL(term_attr_fixup, (int));
-E void FDECL(term_start_attr, (int attr));
-E void FDECL(term_end_attr, (int attr));
-E void NDECL(term_start_raw_bold);
-E void NDECL(term_end_raw_bold);
+E int term_attr_fixup(int);
+E void term_start_attr(int attr);
+E void term_end_attr(int attr);
+E void term_start_raw_bold(void);
+E void term_end_raw_bold(void);
#ifdef TEXTCOLOR
-E void NDECL(term_end_color);
-E void FDECL(term_start_color, (int color));
+E void term_end_color(void);
+E void term_start_color(int color);
#endif /* TEXTCOLOR */
/* ### topl.c ### */
-E void FDECL(show_topl, (const char *));
-E void NDECL(remember_topl);
-E void FDECL(addtopl, (const char *));
-E void NDECL(more);
-E void FDECL(update_topl, (const char *));
-E void FDECL(putsyms, (const char *));
+E void show_topl(const char *);
+E void remember_topl(void);
+E void addtopl(const char *);
+E void more(void);
+E void update_topl(const char *);
+E void putsyms(const char *);
/* ### wintty.c ### */
#ifdef CLIPPING
-E void NDECL(setclipped);
+E void setclipped(void);
#endif
-E void FDECL(docorner, (int, int));
-E void NDECL(end_glyphout);
-E void FDECL(g_putch, (int));
-E void FDECL(win_tty_init, (int));
+E void docorner(int, int);
+E void end_glyphout(void);
+E void g_putch(int);
+E void win_tty_init(int);
/* external declarations */
-E void FDECL(tty_init_nhwindows, (int *, char **));
-E void FDECL(tty_preference_update, (const char *));
-E void NDECL(tty_player_selection);
-E void NDECL(tty_askname);
-E void NDECL(tty_get_nh_event);
-E void FDECL(tty_exit_nhwindows, (const char *));
-E void FDECL(tty_suspend_nhwindows, (const char *));
-E void NDECL(tty_resume_nhwindows);
-E winid FDECL(tty_create_nhwindow, (int));
-E void FDECL(tty_clear_nhwindow, (winid));
-E void FDECL(tty_display_nhwindow, (winid, BOOLEAN_P));
-E void FDECL(tty_dismiss_nhwindow, (winid));
-E void FDECL(tty_destroy_nhwindow, (winid));
-E void FDECL(tty_curs, (winid, int, int));
-E void FDECL(tty_putstr, (winid, int, const char *));
-E void FDECL(tty_display_file, (const char *, BOOLEAN_P));
-E void FDECL(tty_start_menu, (winid, unsigned long));
-E void FDECL(tty_add_menu, (winid, const glyph_info *, const ANY_P *,
- CHAR_P, CHAR_P, int, const char *,
- unsigned int));
-E void FDECL(tty_end_menu, (winid, const char *));
-E int FDECL(tty_select_menu, (winid, int, MENU_ITEM_P **));
-E char FDECL(tty_message_menu, (CHAR_P, int, const char *));
-E void NDECL(tty_update_inventory);
-E void NDECL(tty_mark_synch);
-E void NDECL(tty_wait_synch);
+E void tty_init_nhwindows(int *, char **);
+E void tty_preference_update(const char *);
+E void tty_player_selection(void);
+E void tty_askname(void);
+E void tty_get_nh_event(void);
+E void tty_exit_nhwindows(const char *);
+E void tty_suspend_nhwindows(const char *);
+E void tty_resume_nhwindows(void);
+E winid tty_create_nhwindow(int);
+E void tty_clear_nhwindow(winid);
+E void tty_display_nhwindow(winid, boolean);
+E void tty_dismiss_nhwindow(winid);
+E void tty_destroy_nhwindow(winid);
+E void tty_curs(winid, int, int);
+E void tty_putstr(winid, int, const char *);
+E void tty_display_file(const char *, boolean);
+E void tty_start_menu(winid, unsigned long);
+E void tty_add_menu(winid, const glyph_info *, const ANY_P *, char, char,
+ int, const char *, unsigned int);
+E void tty_end_menu(winid, const char *);
+E int tty_select_menu(winid, int, MENU_ITEM_P **);
+E char tty_message_menu(char, int, const char *);
+E void tty_update_inventory(void);
+E void tty_mark_synch(void);
+E void tty_wait_synch(void);
#ifdef CLIPPING
-E void FDECL(tty_cliparound, (int, int));
+E void tty_cliparound(int, int);
#endif
#ifdef POSITIONBAR
-E void FDECL(tty_update_positionbar, (char *));
+E void tty_update_positionbar(char *);
#endif
-E void FDECL(tty_print_glyph, (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
-E void FDECL(tty_raw_print, (const char *));
-E void FDECL(tty_raw_print_bold, (const char *));
-E int NDECL(tty_nhgetch);
-E int FDECL(tty_nh_poskey, (int *, int *, int *));
-E void NDECL(tty_nhbell);
-E int NDECL(tty_doprev_message);
-E char FDECL(tty_yn_function, (const char *, const char *, CHAR_P));
-E void FDECL(tty_getlin, (const char *, char *));
-E int NDECL(tty_get_ext_cmd);
-E void FDECL(tty_number_pad, (int));
-E void NDECL(tty_delay_output);
+E void tty_print_glyph(winid, xchar, xchar, const glyph_info *,
+ const glyph_info *);
+E void tty_raw_print(const char *);
+E void tty_raw_print_bold(const char *);
+E int tty_nhgetch(void);
+E int tty_nh_poskey(int *, int *, int *);
+E void tty_nhbell(void);
+E int tty_doprev_message(void);
+E char tty_yn_function(const char *, const char *, char);
+E void tty_getlin(const char *, char *);
+E int tty_get_ext_cmd(void);
+E void tty_number_pad(int);
+E void tty_delay_output(void);
#ifdef CHANGE_COLOR
-E void FDECL(tty_change_color, (int color, long rgb, int reverse));
+E void tty_change_color(int color, long rgb, int reverse);
#ifdef MAC
-E void FDECL(tty_change_background, (int white_or_black));
-E short FDECL(set_tty_font_name, (winid, char *));
+E void tty_change_background(int white_or_black);
+E short set_tty_font_name(winid, char *);
#endif
-E char *NDECL(tty_get_color_string);
+E char *tty_get_color_string(void);
#endif
-E void FDECL(tty_status_enablefield,
- (int, const char *, const char *, BOOLEAN_P));
-E void NDECL(tty_status_init);
-E void FDECL(tty_status_update, (int, genericptr_t, int, int, int, unsigned long *));
+E void tty_status_enablefield(int, const char *, const char *, boolean);
+E void tty_status_init(void);
+E void tty_status_update(int, genericptr_t, int, int, int, unsigned long *);
/* other defs that really should go away (they're tty specific) */
-E void NDECL(tty_start_screen);
-E void NDECL(tty_end_screen);
+E void tty_start_screen(void);
+E void tty_end_screen(void);
-E void FDECL(genl_outrip, (winid, int, time_t));
+E void genl_outrip(winid, int, time_t);
-E char *FDECL(tty_getmsghistory, (BOOLEAN_P));
-E void FDECL(tty_putmsghistory, (const char *, BOOLEAN_P));
+E char *tty_getmsghistory(boolean);
+E void tty_putmsghistory(const char *, boolean);
#ifdef NO_TERMS
#ifdef MAC
#define putchar term_putc
#define fflush term_flush
#define puts term_puts
-E int FDECL(term_putc, (int c));
-E int FDECL(term_flush, (void *desc));
-E int FDECL(term_puts, (const char *str));
+E int term_putc(int c);
+E int term_flush(void *desc);
+E int term_puts(const char *str);
#endif /* MAC */
#if defined(MSDOS) || defined(WIN32)
#if defined(SCREEN_BIOS) || defined(SCREEN_DJGPPFAST) || defined(WIN32)
#define puts(x) xputs(x)
#endif /*SCREEN_BIOS || SCREEN_DJGPPFAST || WIN32 */
#ifdef POSITIONBAR
-E void FDECL(video_update_positionbar, (char *));
+E void video_update_positionbar(char *);
#endif
#endif /*MSDOS*/
#endif /*NO_TERMS*/
unsigned long *a_ulptr;
unsigned *a_uptr;
const char *a_string;
- int NDECL((*a_nfunc));
+ int (*a_nfunc)(void);
unsigned long a_mask32; /* used by status highlighting */
/* add types as needed */
} anything;
#endif
#ifdef POSITIONBAR
-static void NDECL(do_positionbar);
+static void do_positionbar(void);
#endif
-static void FDECL(regen_hp, (int));
-static void FDECL(interrupt_multi, (const char *));
-static void FDECL(debug_fields, (const char *));
+static void regen_hp(int);
+static void interrupt_multi(const char *);
+static void debug_fields(const char *);
void
-early_init()
+early_init(void)
{
decl_globals_init();
objects_globals_init();
}
void
-moveloop(resuming)
-boolean resuming;
+moveloop(boolean resuming)
{
#if defined(MICRO) || defined(WIN32)
char ch;
/* maybe recover some lost health (or lose some when an eel out of water) */
static void
-regen_hp(wtcap)
-int wtcap;
+regen_hp(int wtcap)
{
int heal = 0;
boolean reached_full = FALSE,
#undef U_CAN_REGEN
void
-stop_occupation()
+stop_occupation(void)
{
if (g.occupation) {
if (!maybe_finished_meal(TRUE))
}
void
-display_gamewindows()
+display_gamewindows(void)
{
WIN_MESSAGE = create_nhwindow(NHW_MESSAGE);
if (VIA_WINDOWPORT()) {
}
void
-newgame()
+newgame(void)
{
int i;
/* show "welcome [back] to nethack" message at program startup */
void
-welcome(new_game)
-boolean new_game; /* false => restoring an old game */
+welcome(boolean new_game) /* false => restoring an old game */
{
char buf[BUFSZ];
boolean currentgend = Upolyd ? u.mfemale : flags.female;
#ifdef POSITIONBAR
static void
-do_positionbar()
+do_positionbar(void)
{
static char pbar[COLNO];
char *p;
#endif
static void
-interrupt_multi(msg)
-const char *msg;
+interrupt_multi(const char *msg)
{
if (g.multi > 0 && !g.context.travel && !g.context.run) {
nomul(0);
};
#ifdef WIN32
-extern int FDECL(windows_early_options, (const char *));
+extern int windows_early_options(const char *);
#endif
/*
*/
int
-argcheck(argc, argv, e_arg)
-int argc;
-char *argv[];
-enum earlyarg e_arg;
+argcheck(int argc, char *argv[], enum earlyarg e_arg)
{
int i, idx;
boolean match = FALSE;
* can be debugged without buffering.
*/
static void
-debug_fields(opts)
-const char *opts;
+debug_fields(const char *opts)
{
char *op;
boolean negated = FALSE;
#define EXTERN_H /* comment line for pre-compiled headers */
#include "config.h"
-char *FDECL(fmt_ptr, (const genericptr));
+char *fmt_ptr(const genericptr);
#ifdef MONITOR_HEAP
#undef alloc
#undef free
-extern void FDECL(free, (genericptr_t));
-static void NDECL(heapmon_init);
+extern void free(genericptr_t);
+static void heapmon_init(void);
static FILE *heaplog = 0;
static boolean tried_heaplog = FALSE;
#endif
-long *FDECL(alloc, (unsigned int));
-extern void VDECL(panic, (const char *, ...)) PRINTF_F(1, 2);
+long *alloc(unsigned int);
+extern void panic(const char *, ...);
long *
-alloc(lth)
-register unsigned int lth;
+alloc(unsigned int lth)
{
#ifdef LINT
/*
/* format a pointer for display purposes; returns a static buffer */
char *
-fmt_ptr(ptr)
-const genericptr ptr;
+fmt_ptr(const genericptr ptr)
{
char *buf;
/* If ${NH_HEAPLOG} is defined and we can create a file by that name,
then we'll log the allocation and release information to that file. */
static void
-heapmon_init()
+heapmon_init(void)
{
char *logname = getenv("NH_HEAPLOG");
}
long *
-nhalloc(lth, file, line)
-unsigned int lth;
-const char *file;
-int line;
+nhalloc(unsigned int lth, const char *file, int line)
{
long *ptr = alloc(lth);
}
void
-nhfree(ptr, file, line)
-genericptr_t ptr;
-const char *file;
-int line;
+nhfree(genericptr_t ptr, const char *file, int line)
{
if (!tried_heaplog)
heapmon_init();
/* strdup() which uses our alloc() rather than libc's malloc(),
with caller tracking */
char *
-nhdupstr(string, file, line)
-const char *string;
-const char *file;
-int line;
+nhdupstr(const char *string, const char *file, int line)
{
return strcpy((char *) nhalloc(strlen(string) + 1, file, line), string);
}
not used when MONITOR_HEAP is enabled, but included unconditionally
in case utility programs get built using a different setting for that */
char *
-dupstr(string)
-const char *string;
+dupstr(const char *string)
{
return strcpy((char *) alloc(strlen(string) + 1), string);
}
#include "hack.h"
-static int FDECL(use_camera, (struct obj *));
-static int FDECL(use_towel, (struct obj *));
-static boolean FDECL(its_dead, (int, int, int *));
-static int FDECL(use_stethoscope, (struct obj *));
-static void FDECL(use_whistle, (struct obj *));
-static void FDECL(use_magic_whistle, (struct obj *));
-static int FDECL(use_leash, (struct obj *));
-static int FDECL(use_mirror, (struct obj *));
-static void FDECL(use_bell, (struct obj **));
-static void FDECL(use_candelabrum, (struct obj *));
-static void FDECL(use_candle, (struct obj **));
-static void FDECL(use_lamp, (struct obj *));
-static void FDECL(light_cocktail, (struct obj **));
-static int FDECL(rub_ok, (struct obj *));
-static void FDECL(display_jump_positions, (int));
-static void FDECL(use_tinning_kit, (struct obj *));
-static void FDECL(use_figurine, (struct obj **));
-static int FDECL(grease_ok, (struct obj *));
-static void FDECL(use_grease, (struct obj *));
-static void FDECL(use_trap, (struct obj *));
-static int FDECL(touchstone_ok, (struct obj *));
-static void FDECL(use_stone, (struct obj *));
-static int NDECL(set_trap); /* occupation callback */
-static int FDECL(use_whip, (struct obj *));
-static void FDECL(display_polearm_positions, (int));
-static int FDECL(use_pole, (struct obj *));
-static int FDECL(use_cream_pie, (struct obj *));
-static int FDECL(jelly_ok, (struct obj *));
-static int FDECL(use_royal_jelly, (struct obj *));
-static int FDECL(use_grapple, (struct obj *));
-static int FDECL(do_break_wand, (struct obj *));
-static int FDECL(apply_ok, (struct obj *));
-static int FDECL(flip_through_book, (struct obj *));
-static boolean FDECL(figurine_location_checks, (struct obj *,
- coord *, BOOLEAN_P));
-static boolean FDECL(check_jump, (genericptr_t, int, int));
-static boolean FDECL(is_valid_jump_pos, (int, int, int, BOOLEAN_P));
-static boolean FDECL(get_valid_jump_position, (int, int));
-static boolean FDECL(get_valid_polearm_position, (int, int));
-static boolean FDECL(find_poleable_mon, (coord *, int, int));
+static int use_camera(struct obj *);
+static int use_towel(struct obj *);
+static boolean its_dead(int, int, int *);
+static int use_stethoscope(struct obj *);
+static void use_whistle(struct obj *);
+static void use_magic_whistle(struct obj *);
+static int use_leash(struct obj *);
+static int use_mirror(struct obj *);
+static void use_bell(struct obj **);
+static void use_candelabrum(struct obj *);
+static void use_candle(struct obj **);
+static void use_lamp(struct obj *);
+static void light_cocktail(struct obj **);
+static int rub_ok(struct obj *);
+static void display_jump_positions(int);
+static void use_tinning_kit(struct obj *);
+static void use_figurine(struct obj **);
+static int grease_ok(struct obj *);
+static void use_grease(struct obj *);
+static void use_trap(struct obj *);
+static int touchstone_ok(struct obj *);
+static void use_stone(struct obj *);
+static int set_trap(void); /* occupation callback */
+static int use_whip(struct obj *);
+static void display_polearm_positions(int);
+static int use_pole(struct obj *);
+static int use_cream_pie(struct obj *);
+static int jelly_ok(struct obj *);
+static int use_royal_jelly(struct obj *);
+static int use_grapple(struct obj *);
+static int do_break_wand(struct obj *);
+static int apply_ok(struct obj *);
+static int flip_through_book(struct obj *);
+static boolean figurine_location_checks(struct obj *, coord *, boolean);
+static boolean check_jump(genericptr_t, int, int);
+static boolean is_valid_jump_pos(int, int, int, boolean);
+static boolean get_valid_jump_position(int, int);
+static boolean get_valid_polearm_position(int, int);
+static boolean find_poleable_mon(coord *, int, int);
static const char no_elbow_room[] =
"don't have enough elbow-room to maneuver.";
static int
-use_camera(obj)
-struct obj *obj;
+use_camera(struct obj *obj)
{
struct monst *mtmp;
(void) zapyourself(obj, TRUE);
} else {
mtmp = bhit(u.dx, u.dy, COLNO, FLASHED_LIGHT,
- (int FDECL((*), (MONST_P, OBJ_P))) 0,
- (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
+ (int (*) (MONST_P, OBJ_P)) 0,
+ (int (*) (OBJ_P, OBJ_P)) 0, &obj);
obj->ox = u.ux, obj->oy = u.uy; /* flash_hits_mon() wants this */
if (mtmp)
(void) flash_hits_mon(mtmp, obj);
}
static int
-use_towel(obj)
-struct obj *obj;
+use_towel(struct obj *obj)
{
boolean drying_feedback = (obj == uwep);
/* maybe give a stethoscope message based on floor objects */
static boolean
-its_dead(rx, ry, resp)
-int rx, ry, *resp;
+its_dead(int rx, int ry, int *resp)
{
char buf[BUFSZ];
boolean more_corpses;
almost useless. As a compromise, one use per turn is free, another
uses up the turn; this makes curse status have a tangible effect. */
static int
-use_stethoscope(obj)
-register struct obj *obj;
+use_stethoscope(struct obj *obj)
{
struct monst *mtmp;
struct rm *lev;
alt_whistle_str[] = "produce a %s, sharp vibration.";
static void
-use_whistle(obj)
-struct obj *obj;
+use_whistle(struct obj *obj)
{
if (!can_blow(&g.youmonst)) {
You("are incapable of using the whistle.");
}
static void
-use_magic_whistle(obj)
-struct obj *obj;
+use_magic_whistle(struct obj *obj)
{
register struct monst *mtmp, *nextmon;
}
boolean
-um_dist(x, y, n)
-xchar x, y, n;
+um_dist(xchar x, xchar y, xchar n)
{
return (boolean) (abs(u.ux - x) > n || abs(u.uy - y) > n);
}
int
-number_leashed()
+number_leashed(void)
{
int i = 0;
struct obj *obj;
/* otmp is about to be destroyed or stolen */
void
-o_unleash(otmp)
-struct obj *otmp;
+o_unleash(struct obj *otmp)
{
register struct monst *mtmp;
/* mtmp is about to die, or become untame */
void
-m_unleash(mtmp, feedback)
-struct monst *mtmp;
-boolean feedback;
+m_unleash(struct monst *mtmp, boolean feedback)
{
register struct obj *otmp;
/* player is about to die (for bones) */
void
-unleash_all()
+unleash_all(void)
{
register struct obj *otmp;
register struct monst *mtmp;
#define MAXLEASHED 2
boolean
-leashable(mtmp)
-struct monst *mtmp;
+leashable(struct monst *mtmp)
{
return (boolean) (mtmp->mnum != PM_LONG_WORM
&& !unsolid(mtmp->data)
/* ARGSUSED */
static int
-use_leash(obj)
-struct obj *obj;
+use_leash(struct obj *obj)
{
coord cc;
struct monst *mtmp;
/* assuming mtmp->mleashed has been checked */
struct obj *
-get_mleash(mtmp)
-struct monst *mtmp;
+get_mleash(struct monst *mtmp)
{
struct obj *otmp;
}
boolean
-next_to_u()
+next_to_u(void)
{
register struct monst *mtmp;
register struct obj *otmp;
}
void
-check_leash(x, y)
-register xchar x, y;
+check_leash(xchar x, xchar y)
{
register struct obj *otmp;
register struct monst *mtmp;
/* charisma is supposed to include qualities like leadership and personal
magnetism rather than just appearance, but it has devolved to this... */
const char *
-beautiful()
+beautiful(void)
{
const char *res;
int cha = ACURR(A_CHA);
static const char look_str[] = "look %s.";
static int
-use_mirror(obj)
-struct obj *obj;
+use_mirror(struct obj *obj)
{
const char *mirror, *uvisage;
struct monst *mtmp;
return 1;
}
mtmp = bhit(u.dx, u.dy, COLNO, INVIS_BEAM,
- (int FDECL((*), (MONST_P, OBJ_P))) 0,
- (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
+ (int (*) (MONST_P, OBJ_P)) 0,
+ (int (*) (OBJ_P, OBJ_P)) 0, &obj);
if (!mtmp || !haseyes(mtmp->data) || g.notonhead)
return 1;
}
static void
-use_bell(optr)
-struct obj **optr;
+use_bell(struct obj **optr)
{
register struct obj *obj = *optr;
struct monst *mtmp;
}
static void
-use_candelabrum(obj)
-register struct obj *obj;
+use_candelabrum(struct obj *obj)
{
const char *s = (obj->spe != 1) ? "candles" : "candle";
}
static void
-use_candle(optr)
-struct obj **optr;
+use_candle(struct obj **optr)
{
register struct obj *obj = *optr;
register struct obj *otmp;
/* call in drop, throw, and put in box, etc. */
boolean
-snuff_candle(otmp)
-struct obj *otmp;
+snuff_candle(struct obj *otmp)
{
boolean candle = Is_candle(otmp);
you've been swallowed by a monster; obj might be in transit while
being thrown or dropped so don't assume that its location is valid */
boolean
-snuff_lit(obj)
-struct obj *obj;
+snuff_lit(struct obj *obj)
{
xchar x, y;
/* called when lit object is hit by water */
boolean
-splash_lit(obj)
-struct obj *obj;
+splash_lit(struct obj *obj)
{
boolean result, dunk = FALSE;
/* Called when potentially lightable object is affected by fire_damage().
Return TRUE if object becomes lit and FALSE otherwise --ALI */
boolean
-catch_lit(obj)
-struct obj *obj;
+catch_lit(struct obj *obj)
{
xchar x, y;
}
static void
-use_lamp(obj)
-struct obj *obj;
+use_lamp(struct obj *obj)
{
char buf[BUFSZ];
}
static void
-light_cocktail(optr)
-struct obj **optr;
+light_cocktail(struct obj **optr)
{
struct obj *obj = *optr; /* obj is a potion of oil */
char buf[BUFSZ];
/* getobj callback for object to be rubbed - not selecting a secondary object to
* rub on a gray stone or rub jelly on */
static int
-rub_ok(obj)
-struct obj *obj;
+rub_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
}
int
-dorub()
+dorub(void)
{
struct obj *obj;
}
int
-dojump()
+dojump(void)
{
/* Physical jump */
return jump(0);
/* callback routine for walk_path() */
static boolean
-check_jump(arg, x, y)
-genericptr arg;
-int x, y;
+check_jump(genericptr arg, int x, int y)
{
int traj = *(int *) arg;
struct rm *lev = &levl[x][y];
}
static boolean
-is_valid_jump_pos(x, y, magic, showmsg)
-int x, y, magic;
-boolean showmsg;
+is_valid_jump_pos(int x, int y, int magic, boolean showmsg)
{
if (!magic && !(HJumping & ~INTRINSIC) && !EJumping && distu(x, y) != 5) {
/* The Knight jumping restriction still applies when riding a
}
static boolean
-get_valid_jump_position(x,y)
-int x,y;
+get_valid_jump_position(int x, int y)
{
return (isok(x, y)
&& (ACCESSIBLE(levl[x][y].typ) || Passes_walls)
}
static void
-display_jump_positions(state)
-int state;
+display_jump_positions(int state)
{
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
}
int
-jump(magic)
-int magic; /* 0=Physical, otherwise skill level */
+jump(int magic) /* 0=Physical, otherwise skill level */
{
coord cc;
}
boolean
-tinnable(corpse)
-struct obj *corpse;
+tinnable(struct obj *corpse)
{
if (corpse->oeaten)
return 0;
}
static void
-use_tinning_kit(obj)
-struct obj *obj;
+use_tinning_kit(struct obj *obj)
{
struct obj *corpse, *can;
}
void
-use_unicorn_horn(optr)
-struct obj **optr;
+use_unicorn_horn(struct obj **optr)
{
#define PROP_COUNT 7 /* number of properties we're dealing with */
int idx, val, val_limit, trouble_count, unfixable_trbl, did_prop;
* Timer callback routine: turn figurine into monster
*/
void
-fig_transform(arg, timeout)
-anything *arg;
-long timeout;
+fig_transform(anything *arg, long timeout)
{
struct obj *figurine = arg->a_obj;
struct monst *mtmp;
}
static boolean
-figurine_location_checks(obj, cc, quietly)
-struct obj *obj;
-coord *cc;
-boolean quietly;
+figurine_location_checks(struct obj *obj, coord *cc, boolean quietly)
{
xchar x, y;
}
static void
-use_figurine(optr)
-struct obj **optr;
+use_figurine(struct obj **optr)
{
register struct obj *obj = *optr;
xchar x, y;
/* getobj callback for object to apply grease to */
static int
-grease_ok(obj)
-struct obj *obj;
+grease_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_SUGGEST;
}
static void
-use_grease(obj)
-struct obj *obj;
+use_grease(struct obj *obj)
{
struct obj *otmp;
/* getobj callback for object to rub on a known touchstone */
static int
-touchstone_ok(obj)
-struct obj *obj;
+touchstone_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* touchstones - by Ken Arnold */
static void
-use_stone(tstone)
-struct obj *tstone;
+use_stone(struct obj *tstone)
{
static const char scritch[] = "\"scritch, scritch\"";
struct obj *obj;
}
void
-reset_trapset()
+reset_trapset(void)
{
g.trapinfo.tobj = 0;
g.trapinfo.force_bungle = 0;
/* Place a landmine/bear trap. Helge Hafting */
static void
-use_trap(otmp)
-struct obj *otmp;
+use_trap(struct obj *otmp)
{
int ttyp, tmp;
const char *what = (char *) 0;
}
static int
-set_trap()
+set_trap(void)
{
struct obj *otmp = g.trapinfo.tobj;
struct trap *ttmp;
}
static int
-use_whip(obj)
-struct obj *obj;
+use_whip(struct obj *obj)
{
char buf[BUFSZ];
struct monst *mtmp;
/* find pos of monster in range, if only one monster */
static boolean
-find_poleable_mon(pos, min_range, max_range)
-coord *pos;
-int min_range, max_range;
+find_poleable_mon(coord *pos, int min_range, int max_range)
{
struct monst *mtmp;
coord mpos;
}
static boolean
-get_valid_polearm_position(x, y)
-int x, y;
+get_valid_polearm_position(int x, int y)
{
int glyph;
}
static void
-display_polearm_positions(state)
-int state;
+display_polearm_positions(int state)
{
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
/* Distance attacks by pole-weapons */
static int
-use_pole(obj)
-struct obj *obj;
+use_pole(struct obj *obj)
{
int res = 0, typ, max_range, min_range, glyph;
coord cc;
}
static int
-use_cream_pie(obj)
-struct obj *obj;
+use_cream_pie(struct obj *obj)
{
boolean wasblind = Blind;
boolean wascreamed = u.ucreamed;
/* getobj callback for object to rub royal jelly on */
static int
-jelly_ok(obj)
-struct obj *obj;
+jelly_ok(struct obj *obj)
{
if (obj && obj->otyp == EGG)
return GETOBJ_SUGGEST;
}
static int
-use_royal_jelly(obj)
-struct obj *obj;
+use_royal_jelly(struct obj *obj)
{
int oldcorpsenm;
unsigned was_timed;
}
static int
-use_grapple(obj)
-struct obj *obj;
+use_grapple(struct obj *obj)
{
int res = 0, typ, max_range = 4, tohit;
boolean save_confirm;
/* return 1 if the wand is broken, hence some time elapsed */
static int
-do_break_wand(obj)
-struct obj *obj;
+do_break_wand(struct obj *obj)
{
static const char nothing_else_happens[] = "But nothing else happens...";
register int i, x, y;
/* getobj callback for object to apply - this is more complex than most other
* callbacks because there are a lot of appliables */
static int
-apply_ok(obj)
-struct obj *obj;
+apply_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* the 'a' command */
int
-doapply()
+doapply(void)
{
struct obj *obj;
register int res = 1;
* great.
*/
int
-unfixable_trouble_count(is_horn)
-boolean is_horn;
+unfixable_trouble_count(boolean is_horn)
{
int unfixable_trbl = 0;
}
static int
-flip_through_book(obj)
-struct obj *obj;
+flip_through_book(struct obj *obj)
{
if (Underwater) {
pline("You don't want to get the pages even more soggy, do you?");
#define get_artifact(o) \
(((o) && (o)->oartifact) ? &artilist[(int) (o)->oartifact] : 0)
-static boolean FDECL(bane_applies, (const struct artifact *,
- struct monst *));
-static int FDECL(spec_applies, (const struct artifact *, struct monst *));
-static int FDECL(invoke_ok, (struct obj *));
-static int FDECL(arti_invoke, (struct obj *));
-static boolean FDECL(Mb_hit, (struct monst * magr, struct monst *mdef,
- struct obj *, int *, int, BOOLEAN_P, char *));
-static unsigned long FDECL(abil_to_spfx, (long *));
-static uchar FDECL(abil_to_adtyp, (long *));
-static int FDECL(glow_strength, (int));
-static boolean FDECL(untouchable, (struct obj *, BOOLEAN_P));
-static int FDECL(count_surround_traps, (int, int));
+static boolean bane_applies(const struct artifact *, struct monst *);
+static int spec_applies(const struct artifact *, struct monst *);
+static int invoke_ok(struct obj *);
+static int arti_invoke(struct obj *);
+static boolean Mb_hit(struct monst * magr, struct monst *mdef,
+ struct obj *, int *, int, boolean, char *);
+static unsigned long abil_to_spfx(long *);
+static uchar abil_to_adtyp(long *);
+static int glow_strength(int);
+static boolean untouchable(struct obj *, boolean);
+static int count_surround_traps(int, int);
/* The amount added to the victim's total hit points to insure that the
victim will be killed even after damage bonus/penalty adjustments.
of hit points that will fit in a 15 bit integer. */
#define FATAL_DAMAGE_MODIFIER 200
-static void NDECL(hack_artifacts);
-static boolean FDECL(attacks, (int, struct obj *));
+static void hack_artifacts(void);
+static boolean attacks(int, struct obj *);
/* handle some special cases; must be called after u_init() */
static void
-hack_artifacts()
+hack_artifacts(void)
{
struct artifact *art;
int alignmnt = aligns[flags.initalign].value;
/* zero out the artifact existence list */
void
-init_artifacts()
+init_artifacts(void)
{
(void) memset((genericptr_t) g.artiexist, 0, sizeof g.artiexist);
(void) memset((genericptr_t) g.artidisco, 0, sizeof g.artidisco);
}
void
-save_artifacts(nhfp)
-NHFILE *nhfp;
+save_artifacts(NHFILE *nhfp)
{
if (nhfp->structlevel) {
bwrite(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist);
}
void
-restore_artifacts(nhfp)
-NHFILE *nhfp;
+restore_artifacts(NHFILE *nhfp)
{
if (nhfp->structlevel) {
mread(nhfp->fd, (genericptr_t) g.artiexist, sizeof g.artiexist);
}
const char *
-artiname(artinum)
-int artinum;
+artiname(int artinum)
{
if (artinum <= 0 || artinum > NROFARTIFACTS)
return "";
for the 1st, ``obj = mk_artifact((struct obj *)0, some_alignment);''.
*/
struct obj *
-mk_artifact(otmp, alignment)
-struct obj *otmp; /* existing object; ignored if alignment specified */
-aligntyp alignment; /* target alignment, or A_NONE */
+mk_artifact(struct obj *otmp, /* existing object; ignored if alignment specified */
+ aligntyp alignment) /* target alignment, or A_NONE */
{
const struct artifact *a;
int m, n, altn;
* is non-NULL.
*/
const char *
-artifact_name(name, otyp)
-const char *name;
-short *otyp;
+artifact_name(const char *name, short *otyp)
{
register const struct artifact *a;
register const char *aname;
}
boolean
-exist_artifact(otyp, name)
-int otyp;
-const char *name;
+exist_artifact(int otyp, const char *name)
{
register const struct artifact *a;
boolean *arex;
}
void
-artifact_exists(otmp, name, mod)
-struct obj *otmp;
-const char *name;
-boolean mod;
+artifact_exists(struct obj *otmp, const char *name, boolean mod)
{
register const struct artifact *a;
}
int
-nartifact_exist()
+nartifact_exist(void)
{
int a = 0;
int n = SIZE(g.artiexist);
}
boolean
-spec_ability(otmp, abil)
-struct obj *otmp;
-unsigned long abil;
+spec_ability(struct obj *otmp, unsigned long abil)
{
const struct artifact *arti = get_artifact(otmp);
/* used so that callers don't need to known about SPFX_ codes */
boolean
-confers_luck(obj)
-struct obj *obj;
+confers_luck(struct obj *obj)
{
/* might as well check for this too */
if (obj->otyp == LUCKSTONE)
/* used to check whether a monster is getting reflection from an artifact */
boolean
-arti_reflects(obj)
-struct obj *obj;
+arti_reflects(struct obj *obj)
{
const struct artifact *arti = get_artifact(obj);
/* decide whether this obj is effective when attacking against shades;
does not consider the bonus for blessed objects versus undead */
boolean
-shade_glare(obj)
-struct obj *obj;
+shade_glare(struct obj *obj)
{
const struct artifact *arti;
/* returns 1 if name is restricted for otmp->otyp */
boolean
-restrict_name(otmp, name)
-struct obj *otmp;
-const char *name;
+restrict_name(struct obj *otmp, const char *name)
{
register const struct artifact *a;
const char *aname, *odesc, *other;
}
static boolean
-attacks(adtyp, otmp)
-int adtyp;
-struct obj *otmp;
+attacks(int adtyp, struct obj *otmp)
{
register const struct artifact *weap;
}
boolean
-defends(adtyp, otmp)
-int adtyp;
-struct obj *otmp;
+defends(int adtyp, struct obj *otmp)
{
register const struct artifact *weap;
/* used for monsters */
boolean
-defends_when_carried(adtyp, otmp)
-int adtyp;
-struct obj *otmp;
+defends_when_carried(int adtyp, struct obj *otmp)
{
register const struct artifact *weap;
/* determine whether an item confers Protection */
boolean
-protects(otmp, being_worn)
-struct obj *otmp;
-boolean being_worn;
+protects(struct obj *otmp, boolean being_worn)
{
const struct artifact *arti;
* unworn/unwielded/dropped. Pickup/drop only set/reset the W_ART mask.
*/
void
-set_artifact_intrinsic(otmp, on, wp_mask)
-struct obj *otmp;
-boolean on;
-long wp_mask;
+set_artifact_intrinsic(struct obj *otmp, boolean on, long wp_mask)
{
long *mask = 0;
register const struct artifact *art, *oart = get_artifact(otmp);
* fooled by such trappings.
*/
int
-touch_artifact(obj, mon)
-struct obj *obj;
-struct monst *mon;
+touch_artifact(struct obj *obj, struct monst *mon)
{
register const struct artifact *oart = get_artifact(obj);
boolean badclass, badalign, self_willed, yours;
/* decide whether an artifact itself is vulnerable to a particular type
of erosion damage, independent of the properties of its bearer */
boolean
-arti_immune(obj, dtyp)
-struct obj *obj;
-int dtyp;
+arti_immune(struct obj *obj, int dtyp)
{
register const struct artifact *weap = get_artifact(obj);
}
static boolean
-bane_applies(oart, mon)
-const struct artifact *oart;
-struct monst *mon;
+bane_applies(const struct artifact *oart, struct monst *mon)
{
struct artifact atmp;
/* decide whether an artifact's special attacks apply against mtmp */
static int
-spec_applies(weap, mtmp)
-register const struct artifact *weap;
-struct monst *mtmp;
+spec_applies(const struct artifact *weap, struct monst *mtmp)
{
struct permonst *ptr;
boolean yours;
/* return the M2 flags of monster that an artifact's special attacks apply
* against */
long
-spec_m2(otmp)
-struct obj *otmp;
+spec_m2(struct obj *otmp)
{
const struct artifact *artifact = get_artifact(otmp);
/* special attack bonus */
int
-spec_abon(otmp, mon)
-struct obj *otmp;
-struct monst *mon;
+spec_abon(struct obj *otmp, struct monst *mon)
{
const struct artifact *weap = get_artifact(otmp);
/* special damage bonus */
int
-spec_dbon(otmp, mon, tmp)
-struct obj *otmp;
-struct monst *mon;
-int tmp;
+spec_dbon(struct obj *otmp, struct monst *mon, int tmp)
{
register const struct artifact *weap = get_artifact(otmp);
/* add identified artifact to discoveries list */
void
-discover_artifact(m)
-xchar m;
+discover_artifact(xchar m)
{
int i;
/* used to decide whether an artifact has been fully identified */
boolean
-undiscovered_artifact(m)
-xchar m;
+undiscovered_artifact(xchar m)
{
int i;
/* display a list of discovered artifacts; return their count */
int
-disp_artifact_discoveries(tmpwin)
-winid tmpwin; /* supplied by dodiscover() */
+disp_artifact_discoveries(winid tmpwin) /* supplied by dodiscover() */
{
int i, m, otyp;
char buf[BUFSZ];
/* called when someone is being hit by Magicbane */
static boolean
-Mb_hit(magr, mdef, mb, dmgptr, dieroll, vis, hittee)
-struct monst *magr, *mdef; /* attacker and defender */
-struct obj *mb; /* Magicbane */
-int *dmgptr; /* extra damage target will suffer */
-int dieroll; /* d20 that has already scored a hit */
-boolean vis; /* whether the action can be seen */
-char *hittee; /* target's name: "you" or mon_nam(mdef) */
+Mb_hit(struct monst *magr, /* attacker */
+ struct monst *mdef, /* defender */
+ struct obj *mb, /* Magicbane */
+ int *dmgptr, /* extra damage target will suffer */
+ int dieroll, /* d20 that has already scored a hit */
+ boolean vis, /* whether the action can be seen */
+ char *hittee) /* target's name: "you" or mon_nam(mdef) */
{
struct permonst *old_uasmon;
const char *verb;
* Stormbringer it's "killed by Stormbringer" instead of "killed by an orc".
*/
boolean
-artifact_hit(magr, mdef, otmp, dmgptr, dieroll)
-struct monst *magr, *mdef;
-struct obj *otmp;
-int *dmgptr;
-int dieroll; /* needed for Magicbane and vorpal blades */
+artifact_hit(struct monst *magr, struct monst *mdef, struct obj *otmp,
+ int *dmgptr,
+ int dieroll) /* needed for Magicbane and vorpal blades */
{
boolean youattack = (magr == &g.youmonst);
boolean youdefend = (mdef == &g.youmonst);
/* getobj callback for object to be invoked */
static int
-invoke_ok(obj)
-struct obj *obj;
+invoke_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* the #invoke command */
int
-doinvoke()
+doinvoke(void)
{
struct obj *obj;
}
static int
-arti_invoke(obj)
-struct obj *obj;
+arti_invoke(struct obj *obj)
{
register const struct artifact *oart = get_artifact(obj);
if (!obj) {
/* will freeing this object from inventory cause levitation to end? */
boolean
-finesse_ahriman(obj)
-struct obj *obj;
+finesse_ahriman(struct obj *obj)
{
const struct artifact *oart;
struct prop save_Lev;
/* WAC return TRUE if artifact is always lit */
boolean
-artifact_light(obj)
-struct obj *obj;
+artifact_light(struct obj *obj)
{
return (boolean) (get_artifact(obj) && obj->oartifact == ART_SUNSWORD);
}
/* KMH -- Talking artifacts are finally implemented */
void
-arti_speak(obj)
-struct obj *obj;
+arti_speak(struct obj *obj)
{
register const struct artifact *oart = get_artifact(obj);
const char *line;
}
boolean
-artifact_has_invprop(otmp, inv_prop)
-struct obj *otmp;
-uchar inv_prop;
+artifact_has_invprop(struct obj *otmp, uchar inv_prop)
{
const struct artifact *arti = get_artifact(otmp);
/* Return the price sold to the hero of a given artifact or unique item */
long
-arti_cost(otmp)
-struct obj *otmp;
+arti_cost(struct obj *otmp)
{
if (!otmp->oartifact)
return (long) objects[otmp->otyp].oc_cost;
}
static uchar
-abil_to_adtyp(abil)
-long *abil;
+abil_to_adtyp(long *abil)
{
struct abil2adtyp_tag {
long *abil;
}
static unsigned long
-abil_to_spfx(abil)
-long *abil;
+abil_to_spfx(long *abil)
{
static const struct abil2spfx_tag {
long *abil;
* Return the first item that is conveying a particular intrinsic.
*/
struct obj *
-what_gives(abil)
-long *abil;
+what_gives(long *abil)
{
struct obj *obj;
uchar dtyp;
}
const char *
-glow_color(arti_indx)
-int arti_indx;
+glow_color(int arti_indx)
{
int colornum = artilist[arti_indx].acolor;
const char *colorstr = clr2colorname(colornum);
/* relative strength that Sting is glowing (0..3), to select verb */
static int
-glow_strength(count)
-int count;
+glow_strength(int count)
{
/* glow strength should also be proportional to proximity and
probably difficulty, but we don't have that information and
}
const char *
-glow_verb(count, ingsfx)
-int count; /* 0 means blind rather than no applicable creatures */
-boolean ingsfx;
+glow_verb(int count, /* 0 means blind rather than no applicable creatures */
+ boolean ingsfx)
{
static char resbuf[20];
/* use for warning "glow" for Sting, Orcrist, and Grimtooth */
void
-Sting_effects(orc_count)
-int orc_count; /* new count (warn_obj_cnt is old count); -1 is a flag value */
+Sting_effects(int orc_count) /* new count (warn_obj_cnt is old count); -1 is a flag value */
{
if (uwep
&& (uwep->oartifact == ART_STING
after undergoing a transformation (alignment change, lycanthropy,
polymorph) which might affect item access */
int
-retouch_object(objp, loseit)
-struct obj **objp; /* might be destroyed or unintentionally dropped */
-boolean loseit; /* whether to drop it if hero can longer touch it */
+retouch_object(struct obj **objp, /* might be destroyed or unintentionally dropped */
+ boolean loseit) /* whether to drop it if hero can longer touch it */
{
struct obj *obj = *objp;
currently in operation undergoes a touch test; if it fails,
it will be unworn/unwielded and revoked but not dropped */
static boolean
-untouchable(obj, drop_untouchable)
-struct obj *obj;
-boolean drop_untouchable;
+untouchable(struct obj *obj, boolean drop_untouchable)
{
struct artifact *art;
boolean beingworn, carryeffect, invoked;
/* check all items currently in use (mostly worn) for touchability */
void
-retouch_equipment(dropflag)
-int dropflag; /* 0==don't drop, 1==drop all, 2==drop weapon */
+retouch_equipment(int dropflag) /* 0==don't drop, 1==drop all, 2==drop weapon */
{
static int nesting = 0; /* recursion control */
struct obj *obj;
}
static int
-count_surround_traps(x, y)
-int x, y;
+count_surround_traps(int x, int y)
{
struct rm *levp;
struct obj *otmp;
/* sense adjacent traps if wielding MKoT without wearing gloves */
void
-mkot_trap_warn()
+mkot_trap_warn(void)
{
static const char *const heat[7] = {
"cool", "slightly warm", "warm", "very warm",
/* Master Key is magic key if its bless/curse state meets our criteria:
not cursed for rogues or blessed for non-rogues */
boolean
-is_magic_key(mon, obj)
-struct monst *mon; /* if null, non-rogue is assumed */
-struct obj *obj;
+is_magic_key(struct monst *mon, /* if null, non-rogue is assumed */
+ struct obj *obj)
{
if (((obj && obj->oartifact == ART_MASTER_KEY_OF_THIEVERY)
&& ((mon == &g.youmonst) ? Role_if(PM_ROGUE)
/* figure out whether 'mon' (usually youmonst) is carrying the magic key */
struct obj *
-has_magic_key(mon)
-struct monst *mon; /* if null, hero assumed */
+has_magic_key(struct monst *mon) /* if null, hero assumed */
{
struct obj *o;
short key = artilist[ART_MASTER_KEY_OF_THIEVERY].otyp;
hum_abil[] = { { 0, 0, 0, 0 } };
-static void NDECL(exerper);
-static void FDECL(postadjabil, (long *));
-static const struct innate *FDECL(role_abil, (int));
-static const struct innate *FDECL(check_innate_abil, (long *, long));
-static int FDECL(innately, (long *));
+static void exerper(void);
+static void postadjabil(long *);
+static const struct innate *role_abil(int);
+static const struct innate *check_innate_abil(long *, long);
+static int innately(long *);
/* adjust an attribute; return TRUE if change is made, FALSE otherwise */
boolean
-adjattrib(ndx, incr, msgflg)
-int ndx, incr;
-int msgflg; /* positive => no message, zero => message, and */
+adjattrib(int ndx, int incr, int msgflg) /* positive => no message, zero => message, and */
{ /* negative => conditional (msg if change made) */
int old_acurr, old_abase, old_amax, decr;
boolean abonflg;
}
void
-gainstr(otmp, incr, givemsg)
-struct obj *otmp;
-int incr;
-boolean givemsg;
+gainstr(struct obj *otmp, int incr, boolean givemsg)
{
int num = incr;
/* may kill you; cause may be poison or monster like 'a' */
void
-losestr(num)
-register int num;
+losestr(int num)
{
int ustr = ABASE(A_STR) - num;
}
static const struct poison_effect_message {
- void VDECL((*delivery_func), (const char *, ...));
+ void (*delivery_func)(const char *, ...);
const char *effect_msg;
} poiseff[] = {
{ You_feel, "weaker" }, /* A_STR */
/* feedback for attribute loss due to poisoning */
void
-poisontell(typ, exclaim)
-int typ; /* which attribute */
-boolean exclaim; /* emphasis */
+poisontell(int typ, /* which attribute */
+ boolean exclaim) /* emphasis */
{
- void VDECL((*func), (const char *, ...)) = poiseff[typ].delivery_func;
+ void (*func)(const char *, ...) = poiseff[typ].delivery_func;
const char *msg_txt = poiseff[typ].effect_msg;
/*
/* called when an attack or trap has poisoned hero (used to be in mon.c) */
void
-poisoned(reason, typ, pkiller, fatal, thrown_weapon)
-const char *reason, /* controls what messages we display */
- *pkiller; /* for score+log file if fatal */
-int typ, fatal; /* if fatal is 0, limit damage to adjattrib */
-boolean thrown_weapon; /* thrown weapons are less deadly */
+poisoned(const char *reason, /* controls what messages we display */
+ int typ,
+ const char *pkiller, /* for score+log file if fatal */
+ int fatal, /* if fatal is 0, limit damage to adjattrib */
+ boolean thrown_weapon) /* thrown weapons are less deadly */
{
int i, loss, kprefix = KILLED_BY_AN;
boolean blast = !strcmp(reason, "blast");
}
void
-change_luck(n)
-register schar n;
+change_luck(schar n)
{
u.uluck += n;
if (u.uluck < 0 && u.uluck < LUCKMIN)
}
int
-stone_luck(parameter)
-boolean parameter; /* So I can't think up of a good name. So sue me. --KAA */
+stone_luck(boolean parameter) /* So I can't think up of a good name. So sue me. --KAA */
{
register struct obj *otmp;
register long bonchance = 0;
/* there has just been an inventory change affecting a luck-granting item */
void
-set_moreluck()
+set_moreluck(void)
{
int luckbon = stone_luck(TRUE);
}
void
-restore_attrib()
+restore_attrib(void)
{
int i, equilibrium;;
#define AVAL 50 /* tune value for exercise gains */
void
-exercise(i, inc_or_dec)
-int i;
-boolean inc_or_dec;
+exercise(int i, boolean inc_or_dec)
{
debugpline0("Exercise:");
if (i == A_INT || i == A_CHA)
}
static void
-exerper()
+exerper(void)
{
if (!(g.moves % 10)) {
/* Hunger Checks */
};
void
-exerchk()
+exerchk(void)
{
int i, ax, mod_val, lolim, hilim;
}
void
-init_attr(np)
-register int np;
+init_attr(int np)
{
register int i, x, tryct;
}
void
-redist_attr()
+redist_attr(void)
{
register int i, tmp;
static
void
-postadjabil(ability)
-long *ability;
+postadjabil(long *ability)
{
if (!ability)
return;
}
static const struct innate *
-role_abil(r)
-int r;
+role_abil(int r)
{
const struct {
short role;
}
static const struct innate *
-check_innate_abil(ability, frommask)
-long *ability;
-long frommask;
+check_innate_abil(long *ability, long frommask)
{
const struct innate *abil = 0;
/* check whether particular ability has been obtained via innate attribute */
static int
-innately(ability)
-long *ability;
+innately(long *ability)
{
const struct innate *iptr;
}
int
-is_innate(propidx)
-int propidx;
+is_innate(int propidx)
{
int innateness;
}
char *
-from_what(propidx)
-int propidx; /* special cases can have negative values */
+from_what(int propidx) /* special cases can have negative values */
{
static char buf[BUFSZ];
}
void
-adjabil(oldlevel, newlevel)
-int oldlevel, newlevel;
+adjabil(int oldlevel, int newlevel)
{
register const struct innate *abil, *rabil;
long prevabil, mask = FROMEXPER;
}
int
-newhp()
+newhp(void)
{
int hp, conplus;
}
schar
-acurr(x)
-int x;
+acurr(int x)
{
register int tmp = (u.abon.a[x] + u.atemp.a[x] + u.acurr.a[x]);
/* condense clumsy ACURR(A_STR) value into value that fits into game formulas
*/
schar
-acurrstr()
+acurrstr(void)
{
register int str = ACURR(A_STR);
to distinguish between observable +0 result and no-visible-effect
due to an attribute not being able to exceed maximum or minimum */
boolean
-extremeattr(attrindx) /* does attrindx's value match its max or min? */
-int attrindx;
+extremeattr(int attrindx) /* does attrindx's value match its max or min? */
{
/* Fixed_abil and racial MINATTR/MAXATTR aren't relevant here */
int lolimit = 3, hilimit = 25, curval = ACURR(attrindx);
/* avoid possible problems with alignment overflow, and provide a centralized
location for any future alignment limits */
void
-adjalign(n)
-int n;
+adjalign(int n)
{
int newalign = u.ualign.record + n;
/* change hero's alignment type, possibly losing use of artifacts */
void
-uchangealign(newalign, reason)
-int newalign;
-int reason; /* 0==conversion, 1==helm-of-OA on, 2==helm-of-OA off */
+uchangealign(int newalign,
+ int reason) /* 0==conversion, 1==helm-of-OA on, 2==helm-of-OA off */
{
aligntyp oldalign = u.ualign.type;
#include "hack.h"
-static int NDECL(bc_order);
-static void NDECL(litter);
-static void NDECL(placebc_core);
-static void NDECL(unplacebc_core);
-static boolean FDECL(check_restriction, (int));
+static int bc_order(void);
+static void litter(void);
+static void placebc_core(void);
+static void unplacebc_core(void);
+static boolean check_restriction(int);
static int bcrestriction = 0;
#ifdef BREADCRUMBS
#endif
void
-ballrelease(showmsg)
-boolean showmsg;
+ballrelease(boolean showmsg)
{
if (carried(uball)) {
if (showmsg)
/* ball&chain might hit hero when falling through a trap door */
void
-ballfall()
+ballfall(void)
{
boolean gets_hit;
* Should not be called while swallowed except on waterlevel.
*/
static void
-placebc_core()
+placebc_core(void)
{
if (!uchain || !uball) {
impossible("Where are your ball and chain?");
}
static void
-unplacebc_core()
+unplacebc_core(void)
{
if (u.uswallow) {
if (Is_waterlevel(&u.uz)) {
}
static boolean
-check_restriction(restriction)
-int restriction;
+check_restriction(int restriction)
{
boolean ret = FALSE;
#ifndef BREADCRUMBS
void
-placebc()
+placebc(void)
{
if (!check_restriction(0)) {
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
}
void
-unplacebc()
+unplacebc(void)
{
if (bcrestriction) {
impossible("unplacebc denied, restriction in place");
}
int
-unplacebc_and_covet_placebc()
+unplacebc_and_covet_placebc(void)
{
int restriction = 0;
}
void
-lift_covet_and_placebc(pin)
-int pin;
+lift_covet_and_placebc(int pin)
{
if (!check_restriction(pin)) {
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
#else /* BREADCRUMBS */
void
-Placebc(funcnm, linenum)
-const char *funcnm;
-int linenum;
+Placebc(const char *funcnm, int linenum)
{
if (!check_restriction(0)) {
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
}
void
-Unplacebc(funcnm, linenum)
-const char *funcnm;
-int linenum;
+Unplacebc(const char *funcnm, int linenum)
{
if (bcrestriction) {
}
int
-Unplacebc_and_covet_placebc(funcnm, linenum)
-const char *funcnm;
-int linenum;
+Unplacebc_and_covet_placebc(const char *funcnm, int linenum)
{
int restriction = 0;
}
void
-Lift_covet_and_placebc(pin, funcnm, linenum)
-int pin;
-char *funcnm;
-int linenum;
+Lift_covet_and_placebc(int pin, char *funcnm, int linenum)
{
if (!check_restriction(pin)) {
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
* hero is being punished.
*/
static int
-bc_order()
+bc_order(void)
{
struct obj *obj;
* Set up the ball and chain variables so that the ball and chain are "felt".
*/
void
-set_bc(already_blind)
-int already_blind;
+set_bc(int already_blind)
{
int ball_on_floor = !carried(uball);
* Should not be called while swallowed.
*/
void
-move_bc(before, control, ballx, bally, chainx, chainy)
-int before, control;
-xchar ballx, bally, chainx, chainy; /* only matter !before */
+move_bc(int before, int control, xchar ballx, xchar bally,
+ xchar chainx, xchar chainy)
{
if (Blind) {
/*
/* return TRUE if the caller needs to place the ball and chain down again */
boolean
-drag_ball(x, y, bc_control, ballx, bally, chainx, chainy, cause_delay,
- allow_drag)
-xchar x, y;
-int *bc_control;
-xchar *ballx, *bally, *chainx, *chainy;
-boolean *cause_delay;
-boolean allow_drag;
+drag_ball(xchar x, xchar y, int *bc_control,
+ xchar *ballx, xchar *bally, xchar *chainx, xchar *chainy,
+ boolean *cause_delay, boolean allow_drag)
{
struct trap *t = (struct trap *) 0;
boolean already_in_rock;
* Should not be called while swallowed.
*/
void
-drop_ball(x, y)
-xchar x, y;
+drop_ball(xchar x, xchar y)
{
if (Blind) {
/* get the order */
/* ball&chain cause hero to randomly lose stuff from inventory */
static void
-litter()
+litter(void)
{
struct obj *otmp, *nextobj = 0;
int capacity = weight_cap();
}
void
-drag_down()
+drag_down(void)
{
boolean forward;
uchar dragchance = 3;
}
void
-bc_sanity_check()
+bc_sanity_check(void)
{
int otyp, freeball, freechain;
const char *onam;
#include "hack.h"
-static boolean FDECL(no_bones_level, (d_level *));
-static void FDECL(goodfruit, (int));
-static void FDECL(resetobjs, (struct obj *, BOOLEAN_P));
-static boolean FDECL(fixuporacle, (struct monst *));
+static boolean no_bones_level(d_level *);
+static void goodfruit(int);
+static void resetobjs(struct obj *, boolean);
+static boolean fixuporacle(struct monst *);
static boolean
-no_bones_level(lev)
-d_level *lev;
+no_bones_level(d_level *lev)
{
s_level *sptr;
* chain of fruit types, we know to only save the types that exist.
*/
static void
-goodfruit(id)
-int id;
+goodfruit(int id)
{
struct fruit *f = fruit_from_indx(-id);
}
static void
-resetobjs(ochain, restore)
-struct obj *ochain;
-boolean restore;
+resetobjs(struct obj *ochain, boolean restore)
{
struct obj *otmp, *nobj;
/* while loading bones, strip out text possibly supplied by old player
that might accidentally or maliciously disrupt new player's display */
void
-sanitize_name(namebuf)
-char *namebuf;
+sanitize_name(char *namebuf)
{
int c;
boolean strip_8th_bit = (WINDOWPORT("tty")
/* called by savebones(); also by finish_paybill(shk.c) */
void
-drop_upon_death(mtmp, cont, x, y)
-struct monst *mtmp; /* monster if hero turned into one (other than ghost) */
-struct obj *cont; /* container if hero is turned into a statue */
-int x, y;
+drop_upon_death(struct monst *mtmp, /* monster if hero turned into one (other than ghost) */
+ struct obj *cont, /* container if hero is turned into a statue */
+ int x, int y)
{
struct obj *otmp;
/* possibly restore oracle's room and/or put her back inside it; returns
False if she's on the wrong level and should be removed, True otherwise */
static boolean
-fixuporacle(oracle)
-struct monst *oracle;
+fixuporacle(struct monst *oracle)
{
coord cc;
int ridx, o_ridx;
/* check whether bones are feasible */
boolean
-can_make_bones()
+can_make_bones(void)
{
register struct trap *ttmp;
/* save bones and possessions of a deceased adventurer */
void
-savebones(how, when, corpse)
-int how;
-time_t when;
-struct obj *corpse;
+savebones(int how, time_t when, struct obj *corpse)
{
int x, y;
struct trap *ttmp;
}
int
-getbones()
+getbones(void)
{
int ok;
NHFILE *nhfp = (NHFILE *) 0;
/* check whether current level contains bones from a particular player */
boolean
-bones_include_name(name)
-const char *name;
+bones_include_name(const char *name)
{
struct cemetery *bp;
int len;
const char *const enc_stat[] = { "", "Burdened", "Stressed",
"Strained", "Overtaxed", "Overloaded" };
-static const char *NDECL(rank);
-static void NDECL(bot_via_windowport);
-static void NDECL(stat_update_time);
+static const char *rank(void);
+static void bot_via_windowport(void);
+static void stat_update_time(void);
#ifdef STATUS_HILITES
-static unsigned long NDECL(query_conditions);
-static boolean FDECL(status_hilite_remove, (int));
-static boolean FDECL(status_hilite_menu_fld, (int));
-static void NDECL(status_hilites_viewall);
+static unsigned long query_conditions(void);
+static boolean status_hilite_remove(int);
+static boolean status_hilite_menu_fld(int);
+static void status_hilites_viewall(void);
#endif
static char *
-get_strength_str()
+get_strength_str(void)
{
static char buf[32];
int st = ACURR(A_STR);
}
void
-check_gold_symbol()
+check_gold_symbol(void)
{
nhsym goldch = g.showsyms[COIN_CLASS + SYM_OFF_O];
}
char *
-do_statusline1()
+do_statusline1(void)
{
static char newbot1[BUFSZ];
register char *nb;
}
char *
-do_statusline2()
+do_statusline2(void)
{
static char newbot2[BUFSZ], /* MAXCO: botl.h */
/* dungeon location (and gold), hero health (HP, PW, AC),
}
void
-bot()
+bot(void)
{
/* dosave() flags completion by setting u.uhp to -1 */
if (u.uhp != -1 && g.youmonst.data && iflags.status_updates
}
void
-timebot()
+timebot(void)
{
if (flags.time && iflags.status_updates
&& !g.program_state.saving && !g.program_state.restoring) {
/* convert experience level (1..30) to rank index (0..8) */
int
-xlev_to_rank(xlev)
-int xlev;
+xlev_to_rank(int xlev)
{
/*
* 1..2 => 0
/* convert rank index (0..8) to experience level (1..30) */
int
-rank_to_xlev(rank)
-int rank;
+rank_to_xlev(int rank)
{
/*
* 0 => 1..2
}
const char *
-rank_of(lev, monnum, female)
-int lev;
-short monnum;
-boolean female;
+rank_of(int lev, short monnum, boolean female)
{
register const struct Role *role;
register int i;
}
static const char *
-rank()
+rank(void)
{
return rank_of(u.ulevel, Role_switch, flags.female);
}
int
-title_to_mon(str, rank_indx, title_length)
-const char *str;
-int *rank_indx, *title_length;
+title_to_mon(const char *str, int *rank_indx, int *title_length)
{
register int i, j;
}
void
-max_rank_sz()
+max_rank_sz(void)
{
register int i, r, maxr = 0;
for (i = 0; i < 9; i++) {
#ifdef SCORE_ON_BOTL
long
-botl_score()
+botl_score(void)
{
long deepest = deepest_lev_reached(FALSE);
long utotal;
/* provide the name of the current level for display by various ports */
int
-describe_level(buf)
-char *buf;
+describe_level(char *buf)
{
int ret = 1;
#ifdef STATUS_HILITES
#endif /* STATUS_HILITES */
-static boolean FDECL(eval_notify_windowport_field, (int, boolean *, int));
-static void FDECL(evaluate_and_notify_windowport, (boolean *, int));
-static void NDECL(init_blstats);
-static int FDECL(compare_blstats, (struct istat_s *, struct istat_s *));
-static char *FDECL(anything_to_s, (char *, anything *, int));
-static int FDECL(percentage, (struct istat_s *, struct istat_s *));
-static int NDECL(exp_percentage);
-static int FDECL(CFDECLSPEC cond_cmp, (const genericptr, const genericptr));
-static int FDECL(CFDECLSPEC menualpha_cmp, (const genericptr, const genericptr));
+static boolean eval_notify_windowport_field(int, boolean *, int);
+static void evaluate_and_notify_windowport(boolean *, int);
+static void init_blstats(void);
+static int compare_blstats(struct istat_s *, struct istat_s *);
+static char *anything_to_s(char *, anything *, int);
+static int percentage(struct istat_s *, struct istat_s *);
+static int exp_percentage(void);
+static int CFDECLSPEC cond_cmp(const genericptr, const genericptr);
+static int CFDECLSPEC menualpha_cmp(const genericptr, const genericptr);
#ifdef STATUS_HILITES
-static void FDECL(s_to_anything, (anything *, char *, int));
-static enum statusfields FDECL(fldname_to_bl_indx, (const char *));
-static boolean FDECL(hilite_reset_needed, (struct istat_s *, long));
-static boolean FDECL(noneoftheabove, (const char *));
-static struct hilite_s *FDECL(get_hilite, (int, int, genericptr_t,
- int, int, int *));
-static void FDECL(split_clridx, (int, int *, int *));
-static boolean FDECL(is_ltgt_percentnumber, (const char *));
-static boolean FDECL(has_ltgt_percentnumber, (const char *));
-static int FDECL(splitsubfields, (char *, char ***, int));
-static boolean FDECL(is_fld_arrayvalues, (const char *,
- const char *const *,
- int, int, int *));
-static int FDECL(query_arrayvalue, (const char *, const char *const *,
- int, int));
-static void FDECL(status_hilite_add_threshold, (int, struct hilite_s *));
-static boolean FDECL(parse_status_hl2, (char (*)[QBUFSZ], BOOLEAN_P));
-static char *FDECL(conditionbitmask2str, (unsigned long));
-static unsigned long FDECL(match_str2conditionbitmask, (const char *));
-static unsigned long FDECL(str2conditionbitmask, (char *));
-static boolean FDECL(parse_condition, (char (*)[QBUFSZ], int));
-static char *FDECL(hlattr2attrname, (int, char *, int));
-static void FDECL(status_hilite_linestr_add, (int, struct hilite_s *,
- unsigned long, const char *));
-static void NDECL(status_hilite_linestr_done);
-static int FDECL(status_hilite_linestr_countfield, (int));
-static void NDECL(status_hilite_linestr_gather_conditions);
-static void NDECL(status_hilite_linestr_gather);
-static char *FDECL(status_hilite2str, (struct hilite_s *));
-static int NDECL(status_hilite_menu_choose_field);
-static int FDECL(status_hilite_menu_choose_behavior, (int));
-static int FDECL(status_hilite_menu_choose_updownboth, (int, const char *,
- BOOLEAN_P, BOOLEAN_P));
-static boolean FDECL(status_hilite_menu_add, (int));
+static void s_to_anything(anything *, char *, int);
+static enum statusfields fldname_to_bl_indx(const char *);
+static boolean hilite_reset_needed(struct istat_s *, long);
+static boolean noneoftheabove(const char *);
+static struct hilite_s *get_hilite(int, int, genericptr_t, int, int, int *);
+static void split_clridx(int, int *, int *);
+static boolean is_ltgt_percentnumber(const char *);
+static boolean has_ltgt_percentnumber(const char *);
+static int splitsubfields(char *, char ***, int);
+static boolean is_fld_arrayvalues(const char *, const char *const *, int, int,
+ int *);
+static int query_arrayvalue(const char *, const char *const *, int, int);
+static void status_hilite_add_threshold(int, struct hilite_s *);
+static boolean parse_status_hl2(char (*)[QBUFSZ], boolean);
+static char *conditionbitmask2str(unsigned long);
+static unsigned long match_str2conditionbitmask(const char *);
+static unsigned long str2conditionbitmask(char *);
+static boolean parse_condition(char (*)[QBUFSZ], int);
+static char *hlattr2attrname(int, char *, int);
+static void status_hilite_linestr_add(int, struct hilite_s *, unsigned long,
+ const char *);
+static void status_hilite_linestr_done(void);
+static int status_hilite_linestr_countfield(int);
+static void status_hilite_linestr_gather_conditions(void);
+static void status_hilite_linestr_gather(void);
+static char *status_hilite2str(struct hilite_s *);
+static int status_hilite_menu_choose_field(void);
+static int status_hilite_menu_choose_behavior(int);
+static int status_hilite_menu_choose_updownboth(int, const char *, boolean,
+ boolean);
+static boolean status_hilite_menu_add(int);
#define has_hilite(i) (g.blstats[0][(i)].thresholds)
/* TH_UPDOWN encompasses specific 'up' and 'down' also general 'changed' */
#define Is_Temp_Hilite(rule) ((rule) && (rule)->behavior == BL_TH_UPDOWN)
*/
static void
-bot_via_windowport()
+bot_via_windowport(void)
{
char buf[BUFSZ];
const char *titl;
/* update just the status lines' 'time' field */
static void
-stat_update_time()
+stat_update_time(void)
{
int idx = g.now_or_before_idx; /* no 0/1 toggle */
int fld = BL_TIME;
/* deal with player's choice to change processing of a condition */
void
-condopt(idx, addr, negated)
-int idx;
-boolean *addr;
-boolean negated;
+condopt(int idx, boolean *addr, boolean negated)
{
int i;
/* qsort callback routine for sorting the condition index */
static int CFDECLSPEC
-cond_cmp(vptr1, vptr2)
-const genericptr vptr1;
-const genericptr vptr2;
+cond_cmp(const genericptr vptr1, const genericptr vptr2)
{
int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2,
c1 = conditions[indx1].ranking, c2 = conditions[indx2].ranking;
/* qsort callback routine for alphabetical sorting of index */
static int CFDECLSPEC
-menualpha_cmp(vptr1, vptr2)
-const genericptr vptr1;
-const genericptr vptr2;
+menualpha_cmp(const genericptr vptr1, const genericptr vptr2)
{
int indx1 = *(int *) vptr1, indx2 = *(int *) vptr2;
}
int
-parse_cond_option(negated, opts)
-boolean negated;
-char *opts;
+parse_cond_option(boolean negated, char *opts)
{
int i;
size_t sl;
}
void
-cond_menu(VOID_ARGS)
+cond_menu(void)
{
static const char *menutitle[2] = { "alphabetically", "by ranking"};
int i, res, idx = 0;
}
static boolean
-eval_notify_windowport_field(fld, valsetlist, idx)
-int fld, idx;
-boolean *valsetlist;
+eval_notify_windowport_field(int fld, boolean *valsetlist, int idx)
{
static int oldrndencode = 0;
static nhsym oldgoldsym = 0;
}
static void
-evaluate_and_notify_windowport(valsetlist, idx)
-int idx;
-boolean *valsetlist;
+evaluate_and_notify_windowport(boolean *valsetlist, int idx)
{
int i, updated = 0, notpresent = 0;
}
void
-status_initialize(reassessment)
-boolean reassessment; /* TRUE: just recheck fields w/o other initialization */
+status_initialize(boolean reassessment) /* TRUE: just recheck fields w/o other initialization */
{
enum statusfields fld;
boolean fldenabl;
}
void
-status_finish()
+status_finish(void)
{
int i;
}
static void
-init_blstats()
+init_blstats(void)
{
static boolean initalready = FALSE;
int i, j;
*
*/
static int
-compare_blstats(bl1, bl2)
-struct istat_s *bl1, *bl2;
+compare_blstats(struct istat_s *bl1, struct istat_s*bl2)
{
int anytype, result = 0;
}
static char *
-anything_to_s(buf, a, anytype)
-char *buf;
-anything *a;
-int anytype;
+anything_to_s(char *buf, anything *a, int anytype)
{
if (!buf)
return (char *) 0;
#ifdef STATUS_HILITES
static void
-s_to_anything(a, buf, anytype)
-anything *a;
-char *buf;
-int anytype;
+s_to_anything(anything *a, char *buf, int anytype)
{
if (!buf || !a)
return;
#endif /* STATUS_HILITES */
static int
-percentage(bl, maxbl)
-struct istat_s *bl, *maxbl;
+percentage(struct istat_s *bl, struct istat_s *maxbl)
{
int result = 0;
int anytype;
/* percentage for both xp (level) and exp (points) is the percentage for
(curr_exp - this_level_start) in (next_level_start - this_level_start) */
static int
-exp_percentage()
+exp_percentage(void)
{
int res = 0;
/* experience points have changed but experience level hasn't; decide whether
botl update is needed for a different percentage highlight rule for Xp */
boolean
-exp_percent_changing()
+exp_percent_changing(void)
{
int pc;
anything a;
to reconstruct that from the encumbrance string or asking the general
core what the value is */
int
-stat_cap_indx()
+stat_cap_indx(void)
{
int cap;
/* callback so that interface can get hunger index rather than trying to
reconstruct that from the hunger string or dipping into core internals */
int
-stat_hunger_indx()
+stat_hunger_indx(void)
{
int uhs;
/* used by X11 for "tty status" even when STATUS_HILITES is disabled */
const char *
-bl_idx_to_fldname(idx)
-int idx;
+bl_idx_to_fldname(int idx)
{
if (idx >= 0 && idx < MAXBLSTATS)
return initblstats[idx].fldname;
/* field name to bottom line index */
static enum statusfields
-fldname_to_bl_indx(name)
-const char *name;
+fldname_to_bl_indx(const char *name)
{
int i, nmatches = 0, fld = 0;
}
static boolean
-hilite_reset_needed(bl_p, augmented_time)
-struct istat_s *bl_p;
-long augmented_time; /* no longer augmented; it once encoded fractional
- * amounts for multiple moves within same turn */
+hilite_reset_needed(struct istat_s *bl_p,
+ long augmented_time) /* no longer augmented; it once
+ * encoded fractional amounts for
+ * multiple moves within same turn */
{
/*
* This 'multi' handling may need some tuning...
/* called from moveloop(); sets context.botl if temp hilites have timed out */
void
-status_eval_next_unhilite()
+status_eval_next_unhilite(void)
{
int i;
struct istat_s *curr;
/* called by options handling when 'statushilites' value is changed */
void
-reset_status_hilites()
+reset_status_hilites(void)
{
if (iflags.hilite_delta) {
int i;
/* test whether the text from a title rule matches the string for
title-while-polymorphed in the 'textmatch' menu */
static boolean
-noneoftheabove(hl_text)
-const char *hl_text;
+noneoftheabove(const char *hl_text)
{
if (fuzzymatch(hl_text, "none of the above", "\" -_", TRUE)
|| fuzzymatch(hl_text, "(polymorphed)", "\"()", TRUE)
* pointer to rule that applies; Null if no rule does.
*/
static struct hilite_s *
-get_hilite(idx, fldidx, vp, chg, pc, colorptr)
-int idx, fldidx, chg, pc;
-genericptr_t vp;
-int *colorptr;
+get_hilite(int idx, int fldidx, genericptr_t vp, int chg, int pc,
+ int *colorptr)
{
struct hilite_s *hl, *rule = 0;
anything *value = (anything *) vp;
}
static void
-split_clridx(idx, coloridx, attrib)
-int idx;
-int *coloridx, *attrib;
+split_clridx(int idx, int *coloridx, int *attrib)
{
if (coloridx)
*coloridx = idx & 0x00FF;
* and configure the hilite.
*/
boolean
-parse_status_hl1(op, from_configfile)
-char *op;
-boolean from_configfile;
+parse_status_hl1(char *op, boolean from_configfile)
{
#define MAX_THRESH 21
char hsbuf[MAX_THRESH][QBUFSZ];
/* is str in the format of "[<>]?=?[-+]?[0-9]+%?" regex */
static boolean
-is_ltgt_percentnumber(str)
-const char *str;
+is_ltgt_percentnumber(const char *str)
{
const char *s = str;
/* does str only contain "<>=-+0-9%" chars */
static boolean
-has_ltgt_percentnumber(str)
-const char *str;
+has_ltgt_percentnumber(const char *str)
{
const char *s = str;
*/
#define MAX_SUBFIELDS 16
static int
-splitsubfields(str, sfarr, maxsf)
-char *str;
-char ***sfarr;
-int maxsf;
+splitsubfields(char *str, char ***sfarr, int maxsf)
{
static char *subfields[MAX_SUBFIELDS];
char *st = (char *) 0;
#undef MAX_SUBFIELDS
static boolean
-is_fld_arrayvalues(str, arr, arrmin, arrmax, retidx)
-const char *str;
-const char *const *arr;
-int arrmin, arrmax;
-int *retidx;
+is_fld_arrayvalues(const char *str, const char *const *arr,
+ int arrmin, int arrmax, int *retidx)
{
int i;
}
static int
-query_arrayvalue(querystr, arr, arrmin, arrmax)
-const char *querystr;
-const char *const *arr;
-int arrmin, arrmax;
+query_arrayvalue(const char *querystr, const char *const *arr, int arrmin, int arrmax)
{
int i, res, ret = arrmin - 1;
winid tmpwin;
}
static void
-status_hilite_add_threshold(fld, hilite)
-int fld;
-struct hilite_s *hilite;
+status_hilite_add_threshold(int fld, struct hilite_s *hilite)
{
struct hilite_s *new_hilite;
static boolean
-parse_status_hl2(s, from_configfile)
-char (*s)[QBUFSZ];
-boolean from_configfile;
+parse_status_hl2(char (*s)[QBUFSZ], boolean from_configfile)
{
char *tmp, *how;
int sidx = 0, i = -1, dt = -1;
#ifdef STATUS_HILITES
static unsigned long
-query_conditions()
+query_conditions(void)
{
int i,res;
unsigned long ret = 0UL;
}
static char *
-conditionbitmask2str(ul)
-unsigned long ul;
+conditionbitmask2str(unsigned long ul)
{
static char buf[BUFSZ];
int i;
}
static unsigned long
-match_str2conditionbitmask(str)
-const char *str;
+match_str2conditionbitmask(const char *str)
{
int i, nmatches = 0;
unsigned long mask = 0UL;
}
static unsigned long
-str2conditionbitmask(str)
-char *str;
+str2conditionbitmask(char *str)
{
unsigned long conditions_bitmask = 0UL;
char **subfields;
}
static boolean
-parse_condition(s, sidx)
-char (*s)[QBUFSZ];
-int sidx;
+parse_condition(char (*s)[QBUFSZ], int sidx)
{
int i;
int coloridx = NO_COLOR;
}
void
-clear_status_hilites()
+clear_status_hilites(void)
{
int i;
}
static char *
-hlattr2attrname(attrib, buf, bufsz)
-int attrib, bufsz;
-char *buf;
+hlattr2attrname(int attrib, char *buf, int bufsz)
{
if (attrib && buf) {
char attbuf[BUFSZ];
static int status_hilite_str_id = 0;
static void
-status_hilite_linestr_add(fld, hl, mask, str)
-int fld;
-struct hilite_s *hl;
-unsigned long mask;
-const char *str;
+status_hilite_linestr_add(int fld, struct hilite_s *hl,
+ unsigned long mask, const char *str)
{
struct _status_hilite_line_str *tmp, *nxt;
}
static void
-status_hilite_linestr_done()
+status_hilite_linestr_done(void)
{
struct _status_hilite_line_str *nxt, *tmp = status_hilite_str;
}
static int
-status_hilite_linestr_countfield(fld)
-int fld;
+status_hilite_linestr_countfield(int fld)
{
struct _status_hilite_line_str *tmp;
boolean countall = (fld == BL_FLUSH);
/* used by options handling, doset(options.c) */
int
-count_status_hilites(VOID_ARGS)
+count_status_hilites(void)
{
int count;
}
static void
-status_hilite_linestr_gather_conditions()
+status_hilite_linestr_gather_conditions(void)
{
int i;
struct _cond_map {
}
static void
-status_hilite_linestr_gather()
+status_hilite_linestr_gather(void)
{
int i;
struct hilite_s *hl;
static char *
-status_hilite2str(hl)
-struct hilite_s *hl;
+status_hilite2str(struct hilite_s *hl)
{
static char buf[BUFSZ];
int clr = 0, attr = 0;
}
static int
-status_hilite_menu_choose_field()
+status_hilite_menu_choose_field(void)
{
winid tmpwin;
int i, res, fld = BL_FLUSH;
}
static int
-status_hilite_menu_choose_behavior(fld)
-int fld;
+status_hilite_menu_choose_behavior(int fld)
{
winid tmpwin;
int res = 0, beh = BL_TH_NONE-1;
}
static int
-status_hilite_menu_choose_updownboth(fld, str, ltok, gtok)
-int fld;
-const char *str;
-boolean ltok, gtok;
+status_hilite_menu_choose_updownboth(int fld, const char *str,
+ boolean ltok, boolean gtok)
{
int res, ret = NO_LTEQGT;
winid tmpwin;
}
static boolean
-status_hilite_menu_add(origfld)
-int origfld;
+status_hilite_menu_add(int origfld)
{
int fld;
int behavior;
}
static boolean
-status_hilite_remove(id)
-int id;
+status_hilite_remove(int id)
{
struct _status_hilite_line_str *hlstr = status_hilite_str;
}
static boolean
-status_hilite_menu_fld(fld)
-int fld;
+status_hilite_menu_fld(int fld)
{
winid tmpwin;
int i, res;
}
static void
-status_hilites_viewall()
+status_hilites_viewall(void)
{
winid datawin;
struct _status_hilite_line_str *hlstr = status_hilite_str;
}
boolean
-status_hilite_menu()
+status_hilite_menu(void)
{
winid tmpwin;
int i, res;
#define CMD_CLICKLOOK (char) 0x8F
#ifdef DUMB /* stuff commented out in extern.h, but needed here */
-extern int NDECL(doapply); /**/
-extern int NDECL(dorub); /**/
-extern int NDECL(dojump); /**/
-extern int NDECL(doextlist); /**/
-extern int NDECL(enter_explore_mode); /**/
-extern int NDECL(dodrop); /**/
-extern int NDECL(doddrop); /**/
-extern int NDECL(dodown); /**/
-extern int NDECL(doup); /**/
-extern int NDECL(donull); /**/
-extern int NDECL(dowipe); /**/
-extern int NDECL(docallcnd); /**/
-extern int NDECL(dotakeoff); /**/
-extern int NDECL(doremring); /**/
-extern int NDECL(dowear); /**/
-extern int NDECL(doputon); /**/
-extern int NDECL(doddoremarm); /**/
-extern int NDECL(dokick); /**/
-extern int NDECL(dofire); /**/
-extern int NDECL(dothrow); /**/
-extern int NDECL(doeat); /**/
-extern int NDECL(done2); /**/
-extern int NDECL(vanquished); /**/
-extern int NDECL(doengrave); /**/
-extern int NDECL(dopickup); /**/
-extern int NDECL(ddoinv); /**/
-extern int NDECL(dotypeinv); /**/
-extern int NDECL(dolook); /**/
-extern int NDECL(doprgold); /**/
-extern int NDECL(doprwep); /**/
-extern int NDECL(doprarm); /**/
-extern int NDECL(doprring); /**/
-extern int NDECL(dopramulet); /**/
-extern int NDECL(doprtool); /**/
-extern int NDECL(dosuspend); /**/
-extern int NDECL(doforce); /**/
-extern int NDECL(doopen); /**/
-extern int NDECL(doclose); /**/
-extern int NDECL(dosh); /**/
-extern int NDECL(dodiscovered); /**/
-extern int NDECL(doclassdisco); /**/
-extern int NDECL(doset); /**/
-extern int NDECL(dotogglepickup); /**/
-extern int NDECL(dowhatis); /**/
-extern int NDECL(doquickwhatis); /**/
-extern int NDECL(dowhatdoes); /**/
-extern int NDECL(dohelp); /**/
-extern int NDECL(dohistory); /**/
-extern int NDECL(doloot); /**/
-extern int NDECL(dodrink); /**/
-extern int NDECL(dodip); /**/
-extern int NDECL(dosacrifice); /**/
-extern int NDECL(dopray); /**/
-extern int NDECL(dotip); /**/
-extern int NDECL(doturn); /**/
-extern int NDECL(doredraw); /**/
-extern int NDECL(doread); /**/
-extern int NDECL(dosave); /**/
-extern int NDECL(dosearch); /**/
-extern int NDECL(doidtrap); /**/
-extern int NDECL(dopay); /**/
-extern int NDECL(dosit); /**/
-extern int NDECL(dotalk); /**/
-extern int NDECL(docast); /**/
-extern int NDECL(dovspell); /**/
-extern int NDECL(dotelecmd); /**/
-extern int NDECL(dountrap); /**/
-extern int NDECL(doversion); /**/
-extern int NDECL(doextversion); /**/
-extern int NDECL(doswapweapon); /**/
-extern int NDECL(dowield); /**/
-extern int NDECL(dowieldquiver); /**/
-extern int NDECL(dozap); /**/
-extern int NDECL(doorganize); /**/
+extern int doapply(void); /**/
+extern int dorub(void); /**/
+extern int dojump(void); /**/
+extern int doextlist(void); /**/
+extern int enter_explore_mode(void); /**/
+extern int dodrop(void); /**/
+extern int doddrop(void); /**/
+extern int dodown(void); /**/
+extern int doup(void); /**/
+extern int donull(void); /**/
+extern int dowipe(void); /**/
+extern int docallcnd(void); /**/
+extern int dotakeoff(void); /**/
+extern int doremring(void); /**/
+extern int dowear(void); /**/
+extern int doputon(void); /**/
+extern int doddoremarm(void); /**/
+extern int dokick(void); /**/
+extern int dofire(void); /**/
+extern int dothrow(void); /**/
+extern int doeat(void); /**/
+extern int done2(void); /**/
+extern int vanquished(void); /**/
+extern int doengrave(void); /**/
+extern int dopickup(void); /**/
+extern int ddoinv(void); /**/
+extern int dotypeinv(void); /**/
+extern int dolook(void); /**/
+extern int doprgold(void); /**/
+extern int doprwep(void); /**/
+extern int doprarm(void); /**/
+extern int doprring(void); /**/
+extern int dopramulet(void); /**/
+extern int doprtool(void); /**/
+extern int dosuspend(void); /**/
+extern int doforce(void); /**/
+extern int doopen(void); /**/
+extern int doclose(void); /**/
+extern int dosh(void); /**/
+extern int dodiscovered(void); /**/
+extern int doclassdisco(void); /**/
+extern int doset(void); /**/
+extern int dotogglepickup(void); /**/
+extern int dowhatis(void); /**/
+extern int doquickwhatis(void); /**/
+extern int dowhatdoes(void); /**/
+extern int dohelp(void); /**/
+extern int dohistory(void); /**/
+extern int doloot(void); /**/
+extern int dodrink(void); /**/
+extern int dodip(void); /**/
+extern int dosacrifice(void); /**/
+extern int dopray(void); /**/
+extern int dotip(void); /**/
+extern int doturn(void); /**/
+extern int doredraw(void); /**/
+extern int doread(void); /**/
+extern int dosave(void); /**/
+extern int dosearch(void); /**/
+extern int doidtrap(void); /**/
+extern int dopay(void); /**/
+extern int dosit(void); /**/
+extern int dotalk(void); /**/
+extern int docast(void); /**/
+extern int dovspell(void); /**/
+extern int dotelecmd(void); /**/
+extern int dountrap(void); /**/
+extern int doversion(void); /**/
+extern int doextversion(void); /**/
+extern int doswapweapon(void); /**/
+extern int dowield(void); /**/
+extern int dowieldquiver(void); /**/
+extern int dozap(void); /**/
+extern int doorganize(void); /**/
#endif /* DUMB */
-static int NDECL(dosuspend_core);
-static int NDECL(dosh_core);
-static int NDECL(doherecmdmenu);
-static int NDECL(dotherecmdmenu);
-static int NDECL(doprev_message);
-static int NDECL(timed_occupation);
-static int NDECL(doextcmd);
-static int NDECL(dotravel);
-static int NDECL(doterrain);
-static int NDECL(wiz_wish);
-static int NDECL(wiz_identify);
-static int NDECL(wiz_map);
-static int NDECL(wiz_makemap);
-static int NDECL(wiz_genesis);
-static int NDECL(wiz_where);
-static int NDECL(wiz_detect);
-static int NDECL(wiz_panic);
-static int NDECL(wiz_polyself);
-static int NDECL(wiz_load_lua);
-static int NDECL(wiz_level_tele);
-static int NDECL(wiz_level_change);
-static int NDECL(wiz_flip_level);
-static int NDECL(wiz_show_seenv);
-static int NDECL(wiz_show_vision);
-static int NDECL(wiz_smell);
-static int NDECL(wiz_intrinsic);
-static int NDECL(wiz_show_wmodes);
-static int NDECL(wiz_show_stats);
-static int NDECL(wiz_rumor_check);
+static int dosuspend_core(void);
+static int dosh_core(void);
+static int doherecmdmenu(void);
+static int dotherecmdmenu(void);
+static int doprev_message(void);
+static int timed_occupation(void);
+static int doextcmd(void);
+static int dotravel(void);
+static int doterrain(void);
+static int wiz_wish(void);
+static int wiz_identify(void);
+static int wiz_map(void);
+static int wiz_makemap(void);
+static int wiz_genesis(void);
+static int wiz_where(void);
+static int wiz_detect(void);
+static int wiz_panic(void);
+static int wiz_polyself(void);
+static int wiz_load_lua(void);
+static int wiz_level_tele(void);
+static int wiz_level_change(void);
+static int wiz_flip_level(void);
+static int wiz_show_seenv(void);
+static int wiz_show_vision(void);
+static int wiz_smell(void);
+static int wiz_intrinsic(void);
+static int wiz_show_wmodes(void);
+static int wiz_show_stats(void);
+static int wiz_rumor_check(void);
#ifdef DEBUG_MIGRATING_MONS
-static int NDECL(wiz_migrate_mons);
+static int wiz_migrate_mons(void);
#endif
-static void NDECL(wiz_map_levltyp);
-static void NDECL(wiz_levltyp_legend);
+static void wiz_map_levltyp(void);
+static void wiz_levltyp_legend(void);
#if defined(__BORLANDC__) && !defined(_WIN32)
-extern void FDECL(show_borlandc_stats, (winid));
+extern void show_borlandc_stats(winid);
#endif
-static int FDECL(size_monst, (struct monst *, BOOLEAN_P));
-static int FDECL(size_obj, (struct obj *));
-static void FDECL(count_obj, (struct obj *, long *, long *,
- BOOLEAN_P, BOOLEAN_P));
-static void FDECL(obj_chain, (winid, const char *, struct obj *,
- BOOLEAN_P, long *, long *));
-static void FDECL(mon_invent_chain, (winid, const char *, struct monst *,
- long *, long *));
-static void FDECL(mon_chain, (winid, const char *, struct monst *,
- BOOLEAN_P, long *, long *));
-static void FDECL(contained_stats, (winid, const char *, long *, long *));
-static void FDECL(misc_stats, (winid, long *, long *));
-static boolean FDECL(accept_menu_prefix, (int NDECL((*))));
-
-static void FDECL(add_herecmd_menuitem, (winid, int NDECL((*)),
- const char *));
-static char FDECL(here_cmd_menu, (BOOLEAN_P));
-static char FDECL(there_cmd_menu, (BOOLEAN_P, int, int));
-static char *NDECL(parse);
-static void FDECL(show_direction_keys, (winid, CHAR_P, BOOLEAN_P));
-static boolean FDECL(help_dir, (CHAR_P, int, const char *));
-
-static void NDECL(commands_init);
-static boolean FDECL(keylist_func_has_key, (const struct ext_func_tab *,
- boolean *));
-static int FDECL(keylist_putcmds, (winid, BOOLEAN_P, int, int, boolean *));
-static int FDECL(ch2spkeys, (CHAR_P, int, int));
-static boolean FDECL(prefix_cmd, (CHAR_P));
-static const char *FDECL(spkey_name, (int));
-
-static int NDECL((*timed_occ_fn));
-static char *FDECL(doc_extcmd_flagstr, (winid, const struct ext_func_tab *));
+static int size_monst(struct monst *, boolean);
+static int size_obj(struct obj *);
+static void count_obj(struct obj *, long *, long *, boolean, boolean);
+static void obj_chain(winid, const char *, struct obj *, boolean, long *,
+ long *);
+static void mon_invent_chain(winid, const char *, struct monst *, long *,
+ long *);
+static void mon_chain(winid, const char *, struct monst *, boolean, long *,
+ long *);
+static void contained_stats(winid, const char *, long *, long *);
+static void misc_stats(winid, long *, long *);
+static boolean accept_menu_prefix(int (*)(void));
+
+static void add_herecmd_menuitem(winid, int (*)(void), const char *);
+static char here_cmd_menu(boolean);
+static char there_cmd_menu(boolean, int, int);
+static char *parse(void);
+static void show_direction_keys(winid, char, boolean);
+static boolean help_dir(char, int, const char *);
+
+static void commands_init(void);
+static boolean keylist_func_has_key(const struct ext_func_tab *, boolean *);
+static int keylist_putcmds(winid, boolean, int, int, boolean *);
+static int ch2spkeys(char, int, int);
+static boolean prefix_cmd(char);
+static const char *spkey_name(int);
+
+static int (*timed_occ_fn)(void);
+static char *doc_extcmd_flagstr(winid, const struct ext_func_tab *);
static const char *readchar_queue = "";
/* for rejecting attempts to use wizard mode commands */
static const char cmdnotavail[] = "'%s' command not available.";
static int
-doprev_message(VOID_ARGS)
+doprev_message(void)
{
return nh_doprev_message();
}
/* Count down by decrementing multi */
static int
-timed_occupation(VOID_ARGS)
+timed_occupation(void)
{
(*timed_occ_fn)();
if (g.multi > 0)
* Setting traps.
*/
void
-reset_occupations()
+reset_occupations(void)
{
reset_remarm();
reset_pick();
* function times out by its own means.
*/
void
-set_occupation(fn, txt, xtime)
-int NDECL((*fn));
-const char *txt;
-int xtime;
+set_occupation(int (*fn)(void), const char *txt, int xtime)
{
if (xtime) {
g.occupation = timed_occupation;
return;
}
-static char NDECL(popch);
+static char popch(void);
static char
-popch()
+popch(void)
{
/* If occupied, return '\0', letting tgetch know a character should
* be read from the keyboard. If the character read is not the
}
char
-pgetchar() /* courtesy of aeb@cwi.nl */
+pgetchar(void) /* courtesy of aeb@cwi.nl */
{
register int ch;
/* A ch == 0 resets the pushq */
void
-pushch(ch)
-char ch;
+pushch(char ch)
{
if (!ch)
g.phead = g.ptail = 0;
* replaying a previous command.
*/
void
-savech(ch)
-char ch;
+savech(char ch)
{
if (!g.in_doagain) {
if (!ch)
/* here after # - now read a full-word command */
static int
-doextcmd(VOID_ARGS)
+doextcmd(void)
{
int idx, retval;
- int NDECL((*func));
+ int (*func)(void);
/* keep repeating until we don't run help or quit */
do {
/* format extended command flags for display */
static char *
-doc_extcmd_flagstr(menuwin, efp)
-winid menuwin;
-const struct ext_func_tab *efp; /* if Null, add a footnote to the menu */
+doc_extcmd_flagstr(winid menuwin,
+ /* if Null, add a footnote to the menu */
+ const struct ext_func_tab *efp)
{
static char Abuf[10]; /* 5 would suffice: {'[','m','A',']','\0'} */
/* here after #? - now list all full-word commands and provide
some navigation capability through the long list */
int
-doextlist(VOID_ARGS)
+doextlist(void)
{
register const struct ext_func_tab *efp = (struct ext_func_tab *) 0;
char buf[BUFSZ], searchbuf[BUFSZ], promptbuf[QBUFSZ];
* Here after # - now show pick-list of possible commands.
*/
int
-extcmd_via_menu()
+extcmd_via_menu(void)
{
const struct ext_func_tab *efp;
menu_item *pick_list = (menu_item *) 0;
/* #monster command - use special monster ability while polymorphed */
int
-domonability(VOID_ARGS)
+domonability(void)
{
if (can_breathe(g.youmonst.data))
return dobreathe();
}
int
-enter_explore_mode(VOID_ARGS)
+enter_explore_mode(void)
{
if (discover) {
You("are already in explore mode.");
/* ^W command - wish for something */
static int
-wiz_wish(VOID_ARGS) /* Unlimited wishes for debug mode by Paul Polderman */
+wiz_wish(void) /* Unlimited wishes for debug mode by Paul Polderman */
{
if (wizard) {
boolean save_verbose = flags.verbose;
/* ^I command - reveal and optionally identify hero's inventory */
static int
-wiz_identify(VOID_ARGS)
+wiz_identify(void)
{
if (wizard) {
iflags.override_ID = (int) cmd_from_func(wiz_identify);
}
void
-makemap_prepost(pre, wiztower)
-boolean pre, wiztower;
+makemap_prepost(boolean pre, boolean wiztower)
{
NHFILE tmpnhfp;
struct monst *mtmp;
/* #wizmakemap - discard current dungeon level and replace with a new one */
static int
-wiz_makemap(VOID_ARGS)
+wiz_makemap(void)
{
if (wizard) {
boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz);
/* ^F command - reveal the level map and any traps on it */
static int
-wiz_map(VOID_ARGS)
+wiz_map(void)
{
if (wizard) {
struct trap *t;
/* ^G command - generate monster(s); a count prefix will be honored */
static int
-wiz_genesis(VOID_ARGS)
+wiz_genesis(void)
{
if (wizard)
(void) create_particular();
/* ^O command - display dungeon layout */
static int
-wiz_where(VOID_ARGS)
+wiz_where(void)
{
if (wizard)
(void) print_dungeon(FALSE, (schar *) 0, (xchar *) 0);
/* ^E command - detect unseen (secret doors, traps, hidden monsters) */
static int
-wiz_detect(VOID_ARGS)
+wiz_detect(void)
{
if (wizard)
(void) findit();
}
static int
-wiz_load_lua(VOID_ARGS)
+wiz_load_lua(void)
{
if (wizard && !iflags.debug_fuzzer) {
char buf[BUFSZ];
}
static int
-wiz_load_splua(VOID_ARGS)
+wiz_load_splua(void)
{
if (wizard && !iflags.debug_fuzzer) {
boolean was_in_W_tower = In_W_tower(u.ux, u.uy, &u.uz);
/* ^V command - level teleport */
static int
-wiz_level_tele(VOID_ARGS)
+wiz_level_tele(void)
{
if (wizard)
level_tele();
/* #wizfliplevel - transpose the current level */
static int
-wiz_flip_level(VOID_ARGS)
+wiz_flip_level(void)
{
static const char choices[] = "0123",
prmpt[] = "Flip 0=randomly, 1=vertically, 2=horizonally, 3=both:";
/* #levelchange command - adjust hero's experience level */
static int
-wiz_level_change(VOID_ARGS)
+wiz_level_change(void)
{
char buf[BUFSZ] = DUMMY;
int newlevel = 0;
/* #panic command - test program's panic handling */
static int
-wiz_panic(VOID_ARGS)
+wiz_panic(void)
{
if (iflags.debug_fuzzer) {
u.uhp = u.uhpmax = 1000;
/* #polyself command - change hero's form */
static int
-wiz_polyself(VOID_ARGS)
+wiz_polyself(void)
{
polyself(1);
return 0;
/* #seenv command */
static int
-wiz_show_seenv(VOID_ARGS)
+wiz_show_seenv(void)
{
winid win;
int x, y, v, startx, stopx, curx;
/* #vision command */
static int
-wiz_show_vision(VOID_ARGS)
+wiz_show_vision(void)
{
winid win;
int x, y, v;
/* #wmode command */
static int
-wiz_show_wmodes(VOID_ARGS)
+wiz_show_wmodes(void)
{
winid win;
int x, y;
/* wizard mode variant of #terrain; internal levl[][].typ values in base-36 */
static void
-wiz_map_levltyp(VOID_ARGS)
+wiz_map_levltyp(void)
{
winid win;
int x, y, terrain;
};
const char *
-levltyp_to_name(typ)
-int typ;
+levltyp_to_name(int typ)
{
if (typ >= 0 && typ < MAX_TYPE)
return levltyp[typ];
/* explanation of base-36 output from wiz_map_levltyp() */
static void
-wiz_levltyp_legend(VOID_ARGS)
+wiz_levltyp_legend(void)
{
winid win;
int i, j, last, c;
/* #wizsmell command - test usmellmon(). */
static int
-wiz_smell(VOID_ARGS)
+wiz_smell(void)
{
int ans = 0;
int mndx; /* monster index */
/* #wizinstrinsic command to set some intrinsics for testing */
static int
-wiz_intrinsic(VOID_ARGS)
+wiz_intrinsic(void)
{
if (wizard) {
extern const struct propname {
/* #wizrumorcheck command - verify each rumor access */
static int
-wiz_rumor_check(VOID_ARGS)
+wiz_rumor_check(void)
{
rumor_check();
return 0;
/* #terrain command -- show known map, inspired by crawl's '|' command */
static int
-doterrain(VOID_ARGS)
+doterrain(void)
{
winid men;
menu_item *sel;
int extcmdlist_length = SIZE(extcmdlist) - 1;
const char *
-key2extcmddesc(key)
-uchar key;
+key2extcmddesc(uchar key)
{
static char key2cmdbuf[QBUFSZ];
const struct movcmd *mov;
}
boolean
-bind_key(key, command)
-uchar key;
-const char *command;
+bind_key(uchar key, const char *command)
{
struct ext_func_tab *extcmd;
/* initialize all keyboard commands */
static void
-commands_init()
+commands_init(void)
{
struct ext_func_tab *extcmd;
}
static boolean
-keylist_func_has_key(extcmd, skip_keys_used)
-const struct ext_func_tab *extcmd;
-boolean *skip_keys_used; /* boolean keys_used[256] */
+keylist_func_has_key(const struct ext_func_tab *extcmd,
+ boolean *skip_keys_used) /* boolean keys_used[256] */
{
int i;
}
static int
-keylist_putcmds(datawin, docount, incl_flags, excl_flags, keys_used)
-winid datawin;
-boolean docount;
-int incl_flags, excl_flags;
-boolean *keys_used; /* boolean keys_used[256] */
+keylist_putcmds(winid datawin, boolean docount, int incl_flags, int excl_flags,
+ boolean *keys_used) /* boolean keys_used[256] */
{
const struct ext_func_tab *extcmd;
int i;
/* list all keys and their bindings, like dat/hh but dynamic */
void
-dokeylist(VOID_ARGS)
+dokeylist(void)
{
const struct ext_func_tab *extcmd;
winid datawin;
}
char
-cmd_from_func(fn)
-int NDECL((*fn));
+cmd_from_func(int (*fn)(void))
{
int i;
/* return extended command name (without leading '#') for command (*fn)() */
const char *
-cmdname_from_func(fn, outbuf, fullname)
-int NDECL((*fn));
-char outbuf[];
-boolean fullname; /* False: just enough to disambiguate */
+cmdname_from_func(int (*fn)(void), char outbuf[],
+ boolean fullname) /* False: just enough to disambiguate */
{
const struct ext_func_tab *extcmd, *cmdptr = 0;
const char *res = 0;
static const char stats_sep[] = "--------------------------- ----- -------";
static int
-size_obj(otmp)
-struct obj *otmp;
+size_obj(struct obj *otmp)
{
int sz = (int) sizeof (struct obj);
}
static void
-count_obj(chain, total_count, total_size, top, recurse)
-struct obj *chain;
-long *total_count;
-long *total_size;
-boolean top;
-boolean recurse;
+count_obj(struct obj *chain, long *total_count, long *total_size,
+ boolean top, boolean recurse)
{
long count, size;
struct obj *obj;
}
static void
-obj_chain(win, src, chain, force, total_count, total_size)
-winid win;
-const char *src;
-struct obj *chain;
-boolean force;
-long *total_count;
-long *total_size;
+obj_chain(winid win, const char *src, struct obj *chain, boolean force,
+ long *total_count, long *total_size)
{
char buf[BUFSZ];
long count = 0L, size = 0L;
}
static void
-mon_invent_chain(win, src, chain, total_count, total_size)
-winid win;
-const char *src;
-struct monst *chain;
-long *total_count;
-long *total_size;
+mon_invent_chain(winid win, const char *src, struct monst *chain,
+ long *total_count, long *total_size)
{
char buf[BUFSZ];
long count = 0, size = 0;
}
static void
-contained_stats(win, src, total_count, total_size)
-winid win;
-const char *src;
-long *total_count;
-long *total_size;
+contained_stats(winid win, const char *src, long *total_count,
+ long *total_size)
{
char buf[BUFSZ];
long count = 0, size = 0;
}
static int
-size_monst(mtmp, incl_wsegs)
-struct monst *mtmp;
-boolean incl_wsegs;
+size_monst(struct monst *mtmp, boolean incl_wsegs)
{
int sz = (int) sizeof (struct monst);
}
static void
-mon_chain(win, src, chain, force, total_count, total_size)
-winid win;
-const char *src;
-struct monst *chain;
-boolean force;
-long *total_count;
-long *total_size;
+mon_chain(winid win, const char *src, struct monst *chain,
+ boolean force, long *total_count, long *total_size)
{
char buf[BUFSZ];
long count, size;
}
static void
-misc_stats(win, total_count, total_size)
-winid win;
-long *total_count;
-long *total_size;
+misc_stats(winid win, long *total_count, long *total_size)
{
char buf[BUFSZ], hdrbuf[QBUFSZ];
long count, size;
* Display memory usage of all monsters and objects on the level.
*/
static int
-wiz_show_stats()
+wiz_show_stats(void)
{
char buf[BUFSZ];
winid win;
}
void
-sanity_check()
+sanity_check(void)
{
obj_sanity_check();
timer_sanity_check();
#ifdef DEBUG_MIGRATING_MONS
static int
-wiz_migrate_mons()
+wiz_migrate_mons(void)
{
int mcount = 0;
char inbuf[BUFSZ] = DUMMY;
};
boolean
-bind_specialkey(key, command)
-uchar key;
-const char *command;
+bind_specialkey(uchar key, const char *command)
{
int i;
}
static const char *
-spkey_name(nhkf)
-int nhkf;
+spkey_name(int nhkf)
{
const char *name = 0;
int i;
/* returns a one-byte character from the text; may change txt[] */
uchar
-txt2key(txt)
-char *txt;
+txt2key(char *txt)
{
uchar uc;
boolean makemeta = FALSE;
/* returns the text for a one-byte encoding;
* must be shorter than a tab for proper formatting */
char *
-key2txt(c, txt)
-uchar c;
-char *txt; /* sufficiently long buffer */
+key2txt(uchar c, char *txt) /* sufficiently long buffer */
{
/* should probably switch to "SPC", "ESC", "RET"
since nethack's documentation uses ESC for <escape> */
void
-parseautocomplete(autocomplete, condition)
-char *autocomplete;
-boolean condition;
+parseautocomplete(char *autocomplete, boolean condition)
{
struct ext_func_tab *efp;
register char *autoc;
/* called at startup and after number_pad is twiddled */
void
-reset_commands(initial)
-boolean initial;
+reset_commands(boolean initial)
{
static const char sdir[] = "hykulnjb><",
sdir_swap_yz[] = "hzkulnjb><",
/* non-movement commands which accept 'm' prefix to request menu operation */
static boolean
-accept_menu_prefix(cmd_func)
-int NDECL((*cmd_func));
+accept_menu_prefix(int (*cmd_func)(void))
{
if (cmd_func == dopickup || cmd_func == dotip
/* eat, #offer, and apply tinning-kit all use floorfood() to pick
}
char
-randomkey()
+randomkey(void)
{
static unsigned i = 0;
char c;
}
void
-random_response(buf, sz)
-char *buf;
-int sz;
+random_response(char *buf, int sz)
{
char c;
int count = 0;
}
int
-rnd_extcmd_idx(VOID_ARGS)
+rnd_extcmd_idx(void)
{
return rn2(extcmdlist_length + 1) - 1;
}
static int
-ch2spkeys(c, start, end)
-char c;
-int start,end;
+ch2spkeys(char c, int start, int end)
{
int i;
}
void
-rhack(cmd)
-register char *cmd;
+rhack(char *cmd)
{
int spkey;
boolean prefix_seen, bad_command,
if (cmd[0] == g.Cmd.spkeys[NHKF_REQMENU]) {
/* (for func_tab cast, see below) */
const struct ext_func_tab *ft = g.Cmd.commands[cmd[1] & 0xff];
- int NDECL((*func)) = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0;
+ int (*func)(void) = ft ? ((struct ext_func_tab *) ft)->ef_funct : 0;
if (func && accept_menu_prefix(func)) {
iflags.menu_requested = TRUE;
/* handle all other commands */
} else {
register const struct ext_func_tab *tlist;
- int res, NDECL((*func));
+ int res, (*func)(void);
/* current - use *cmd to directly index cmdlist array */
if ((tlist = g.Cmd.commands[*cmd & 0xff]) != 0) {
/* convert an x,y pair into a direction code */
int
-xytod(x, y)
-schar x, y;
+xytod(schar x, schar y)
{
register int dd;
/* convert a direction code into an x,y pair */
void
-dtoxy(cc, dd)
-coord *cc;
-register int dd;
+dtoxy(coord *cc, int dd)
{
cc->x = xdir[dd];
cc->y = ydir[dd];
/* also sets u.dz, but returns false for <> */
int
-movecmd(sym)
-char sym;
+movecmd(char sym)
{
register const char *dp = index(g.Cmd.dirchars, sym);
/* grid bug handling which used to be in movecmd() */
int
-dxdy_moveok()
+dxdy_moveok(void)
{
if (u.dx && u.dy && NODIAG(u.umonnum))
u.dx = u.dy = 0;
/* decide whether character (user input keystroke) requests screen repaint */
boolean
-redraw_cmd(c)
-char c;
+redraw_cmd(char c)
{
return (boolean) (c == g.Cmd.spkeys[NHKF_REDRAW]
|| (g.Cmd.num_pad && c == g.Cmd.spkeys[NHKF_REDRAW2]));
}
static boolean
-prefix_cmd(c)
-char c;
+prefix_cmd(char c)
{
return (c == g.Cmd.spkeys[NHKF_REQMENU]
|| c == g.Cmd.spkeys[NHKF_RUSH]
* Returns non-zero if coordinates in cc are valid.
*/
int
-get_adjacent_loc(prompt, emsg, x, y, cc)
-const char *prompt, *emsg;
-xchar x, y;
-coord *cc;
+get_adjacent_loc(const char *prompt, const char *emsg,
+ xchar x, xchar y, coord *cc)
{
xchar new_x, new_y;
if (!getdir(prompt)) {
}
int
-getdir(s)
-const char *s;
+getdir(const char *s)
{
char dirsym;
int is_mov;
}
static void
-show_direction_keys(win, centerchar, nodiag)
-winid win; /* should specify a window which is using a fixed-width font... */
-char centerchar; /* '.' or '@' or ' ' */
-boolean nodiag;
+show_direction_keys(winid win, /* should specify a window which is using a fixed-width font... */
+ char centerchar, /* '.' or '@' or ' ' */
+ boolean nodiag)
{
char buf[BUFSZ];
an invalid direction after a prefix key ('F', 'g', 'm', &c), which
might be bogus but could be up, down, or self when not applicable */
static boolean
-help_dir(sym, spkey, msg)
-char sym;
-int spkey; /* NHKF_ code for prefix key, if one was used, or for ESC */
-const char *msg;
+help_dir(char sym,
+ int spkey, /* NHKF_ code for prefix key, if one was used, or for ESC */
+ const char *msg)
{
static const char wiz_only_list[] = "EFGIVW";
char ctrl;
}
void
-confdir()
+confdir(void)
{
register int x = NODIAG(u.umonnum) ? 2 * rn2(4) : rn2(8);
}
const char *
-directionname(dir)
-int dir;
+directionname(int dir)
{
static NEARDATA const char *const dirnames[] = {
"west", "northwest", "north", "northeast", "east",
}
int
-isok(x, y)
-register int x, y;
+isok(register int x, register int y)
{
/* x corresponds to curx, so x==1 is the first column. Ach. %% */
return x >= 1 && x <= COLNO - 1 && y >= 0 && y <= ROWNO - 1;
/* #herecmdmenu command */
static int
-doherecmdmenu(VOID_ARGS)
+doherecmdmenu(void)
{
char ch = here_cmd_menu(TRUE);
/* #therecmdmenu command, a way to test there_cmd_menu without mouse */
static int
-dotherecmdmenu(VOID_ARGS)
+dotherecmdmenu(void)
{
char ch;
}
static void
-add_herecmd_menuitem(win, func, text)
-winid win;
-int NDECL((*func));
-const char *text;
+add_herecmd_menuitem(winid win, int (*func)(void), const char *text)
{
char ch;
anything any;
does not work as intended because the actions that get invoked
ask for a direction or target instead of using our <x,y> */
static char
-there_cmd_menu(doit, x, y)
-boolean doit;
-int x, y;
+there_cmd_menu(boolean doit, int x, int y)
{
winid win;
char ch;
destroy_nhwindow(win);
ch = '\033';
if (npick > 0) {
- int NDECL((*func)) = picks->item.a_nfunc;
+ int (*func)(void) = picks->item.a_nfunc;
free((genericptr_t) picks);
if (doit) {
}
static char
-here_cmd_menu(doit)
-boolean doit;
+here_cmd_menu(boolean doit)
{
winid win;
char ch;
destroy_nhwindow(win);
ch = '\033';
if (npick > 0) {
- int NDECL((*func)) = picks->item.a_nfunc;
+ int (*func)(void) = picks->item.a_nfunc;
free((genericptr_t) picks);
if (doit) {
* convert a MAP window position into a movecmd
*/
const char *
-click_to_cmd(x, y, mod)
-int x, y, mod;
+click_to_cmd(int x, int y, int mod)
{
static char cmd[4];
struct obj *o;
}
char
-get_count(allowchars, inkey, maxcount, count, historicmsg)
-char *allowchars;
-char inkey;
-long maxcount;
-long *count;
-boolean historicmsg; /* whether to include in message history: True => yes */
+get_count(char *allowchars, char inkey,
+ long maxcount, long *count,
+ boolean historicmsg) /* whether to include in message history: True => yes */
{
char qbuf[QBUFSZ];
int key;
static char *
-parse()
+parse(void)
{
#ifdef LINT /* static char in_line[COLNO]; */
char in_line[COLNO];
the return value so we should be safe using `void' unconditionally */
/*ARGUSED*/
void
-hangup(sig_unused) /* called as signal() handler, so sent at least one arg */
-int sig_unused UNUSED;
+hangup(int sig_unused UNUSED) /* called as signal() handler, so sent
+ at least one arg */
{
if (g.program_state.exiting)
g.program_state.in_moveloop = 0;
}
void
-end_of_input()
+end_of_input(void)
{
#ifdef NOSAVEONHANGUP
#ifdef INSURANCE
#endif /* HANGUPHANDLING */
char
-readchar()
+readchar(void)
{
register int sym;
int x = u.ux, y = u.uy, mod = 0;
/* '_' command, #travel, via keyboard rather than mouse click */
static int
-dotravel(VOID_ARGS)
+dotravel(void)
{
static char cmd[2];
coord cc;
* window port causing a buffer overflow there.
*/
char
-yn_function(query, resp, def)
-const char *query, *resp;
-char def;
+yn_function(const char *query, const char *resp, char def)
{
char res, qbuf[QBUFSZ];
#ifdef DUMPLOG
/* for paranoid_confirm:quit,die,attack prompting */
boolean
-paranoid_query(be_paranoid, prompt)
-boolean be_paranoid;
-const char *prompt;
+paranoid_query(boolean be_paranoid, const char *prompt)
{
boolean confirmed_ok;
/* ^Z command, #suspend */
static int
-dosuspend_core(VOID_ARGS)
+dosuspend_core(void)
{
#ifdef SUSPEND
/* Does current window system support suspend? */
/* '!' command, #shell */
static int
-dosh_core(VOID_ARGS)
+dosh_core(void)
{
#ifdef SHELL
/* access restrictions, if any, are handled in port code */
#include "hack.h"
-static void FDECL(get_wall_for_db, (int *, int *));
-static struct entity *FDECL(e_at, (int, int));
-static void FDECL(m_to_e, (struct monst *, int, int, struct entity *));
-static void FDECL(u_to_e, (struct entity *));
-static void FDECL(set_entity, (int, int, struct entity *));
-static const char *FDECL(e_nam, (struct entity *));
-static const char *FDECL(E_phrase, (struct entity *, const char *));
-static boolean FDECL(e_survives_at, (struct entity *, int, int));
-static void FDECL(e_died, (struct entity *, int, int));
-static boolean FDECL(automiss, (struct entity *));
-static boolean FDECL(e_missed, (struct entity *, BOOLEAN_P));
-static boolean FDECL(e_jumps, (struct entity *));
-static void FDECL(do_entity, (struct entity *));
+static void get_wall_for_db(int *, int *);
+static struct entity *e_at(int, int);
+static void m_to_e(struct monst *, int, int, struct entity *);
+static void u_to_e(struct entity *);
+static void set_entity(int, int, struct entity *);
+static const char *e_nam(struct entity *);
+static const char *E_phrase(struct entity *, const char *);
+static boolean e_survives_at(struct entity *, int, int);
+static void e_died(struct entity *, int, int);
+static boolean automiss(struct entity *);
+static boolean e_missed(struct entity *, boolean);
+static boolean e_jumps(struct entity *);
+static void do_entity(struct entity *);
boolean
-is_pool(x, y)
-int x, y;
+is_pool(int x, int y)
{
schar ltyp;
}
boolean
-is_lava(x, y)
-int x, y;
+is_lava(int x, int y)
{
schar ltyp;
}
boolean
-is_pool_or_lava(x, y)
-int x, y;
+is_pool_or_lava(int x, int y)
{
if (is_pool(x, y) || is_lava(x, y))
return TRUE;
}
boolean
-is_ice(x, y)
-int x, y;
+is_ice(int x, int y)
{
schar ltyp;
}
boolean
-is_moat(x, y)
-int x, y;
+is_moat(int x, int y)
{
schar ltyp;
}
schar
-db_under_typ(mask)
-int mask;
+db_under_typ(int mask)
{
switch (mask & DB_UNDER) {
case DB_ICE:
*/
int
-is_drawbridge_wall(x, y)
-int x, y;
+is_drawbridge_wall(int x, int y)
{
struct rm *lev;
* (instead of UP or DOWN, as with is_drawbridge_wall).
*/
boolean
-is_db_wall(x, y)
-int x, y;
+is_db_wall(int x, int y)
{
return (boolean) (levl[x][y].typ == DBWALL);
}
* a drawbridge or drawbridge wall.
*/
boolean
-find_drawbridge(x, y)
-int *x, *y;
+find_drawbridge(int *x, int *y)
{
int dir;
* Find the drawbridge wall associated with a drawbridge.
*/
static void
-get_wall_for_db(x, y)
-int *x, *y;
+get_wall_for_db(int *x, int *y)
{
switch (levl[*x][*y].drawbridgemask & DB_DIR) {
case DB_NORTH:
* flag must be put to TRUE if we want the drawbridge to be opened.
*/
boolean
-create_drawbridge(x, y, dir, flag)
-int x, y, dir;
-boolean flag;
+create_drawbridge(int x, int y, int dir, boolean flag)
{
int x2, y2;
boolean horiz;
return TRUE;
}
-static
-struct entity *
-e_at(x, y)
-int x, y;
+static struct entity *
+e_at(int x, int y)
{
int entitycnt;
}
static void
-m_to_e(mtmp, x, y, etmp)
-struct monst *mtmp;
-int x, y;
-struct entity *etmp;
+m_to_e(struct monst *mtmp, int x, int y, struct entity *etmp)
{
etmp->emon = mtmp;
if (mtmp) {
}
static void
-u_to_e(etmp)
-struct entity *etmp;
+u_to_e(struct entity *etmp)
{
etmp->emon = &g.youmonst;
etmp->ex = u.ux;
}
static void
-set_entity(x, y, etmp)
-int x, y;
-struct entity *etmp;
+set_entity(int x, int y, struct entity *etmp)
{
if ((x == u.ux) && (y == u.uy))
u_to_e(etmp);
/* #define e_strg(etmp, func) (is_u(etmp)? (char *)0 : func(etmp->emon)) */
static const char *
-e_nam(etmp)
-struct entity *etmp;
+e_nam(struct entity *etmp)
{
return is_u(etmp) ? "you" : mon_nam(etmp->emon);
}
* verb, where necessary.
*/
static const char *
-E_phrase(etmp, verb)
-struct entity *etmp;
-const char *verb;
+E_phrase(struct entity *etmp, const char *verb)
{
static char wholebuf[80];
* Simple-minded "can it be here?" routine
*/
static boolean
-e_survives_at(etmp, x, y)
-struct entity *etmp;
-int x, y;
+e_survives_at(struct entity *etmp, int x, int y)
{
if (noncorporeal(etmp->edata))
return TRUE;
}
static void
-e_died(etmp, xkill_flags, how)
-struct entity *etmp;
-int xkill_flags, how;
+e_died(struct entity *etmp, int xkill_flags, int how)
{
if (is_u(etmp)) {
if (how == DROWNING) {
* These are never directly affected by a bridge or portcullis.
*/
static boolean
-automiss(etmp)
-struct entity *etmp;
+automiss(struct entity *etmp)
{
return (boolean) ((is_u(etmp) ? Passes_walls : passes_walls(etmp->edata))
|| noncorporeal(etmp->edata));
* Does falling drawbridge or portcullis miss etmp?
*/
static boolean
-e_missed(etmp, chunks)
-struct entity *etmp;
-boolean chunks;
+e_missed(struct entity *etmp, boolean chunks)
{
int misses;
* Can etmp jump from death?
*/
static boolean
-e_jumps(etmp)
-struct entity *etmp;
+e_jumps(struct entity *etmp)
{
int tmp = 4; /* out of 10 */
}
static void
-do_entity(etmp)
-struct entity *etmp;
+do_entity(struct entity *etmp)
{
int newx, newy, at_portcullis, oldx, oldy;
boolean must_jump = FALSE, relocates = FALSE, e_inview;
* Close the drawbridge located at x,y
*/
void
-close_drawbridge(x, y)
-int x, y;
+close_drawbridge(int x, int y)
{
register struct rm *lev1, *lev2;
struct trap *t;
* Open the drawbridge located at x,y
*/
void
-open_drawbridge(x, y)
-int x, y;
+open_drawbridge(int x, int y)
{
register struct rm *lev1, *lev2;
struct trap *t;
* Let's destroy the drawbridge located at x,y
*/
void
-destroy_drawbridge(x, y)
-int x, y;
+destroy_drawbridge(int x, int y)
{
register struct rm *lev1, *lev2;
struct trap *t;
#define ZERO(x) memset(&x, 0, sizeof(x))
void
-decl_globals_init()
+decl_globals_init(void)
{
g = g_init;
#include "hack.h"
#include "artifact.h"
-static boolean NDECL(unconstrain_map);
-static void NDECL(reconstrain_map);
-static void NDECL(map_redisplay);
-static void FDECL(browse_map, (int, const char *));
-static void FDECL(map_monst, (struct monst *, BOOLEAN_P));
-static void FDECL(do_dknown_of, (struct obj *));
-static boolean FDECL(check_map_spot, (int, int, CHAR_P, unsigned));
-static boolean FDECL(clear_stale_map, (CHAR_P, unsigned));
-static void FDECL(sense_trap, (struct trap *, XCHAR_P, XCHAR_P, int));
-static int FDECL(detect_obj_traps, (struct obj *, BOOLEAN_P, int));
-static int NDECL(furniture_detect);
-static void FDECL(show_map_spot, (int, int));
-static void FDECL(findone, (int, int, genericptr_t));
-static void FDECL(openone, (int, int, genericptr_t));
-static int FDECL(mfind0, (struct monst *, BOOLEAN_P));
-static int FDECL(reveal_terrain_getglyph, (int, int, int,
- unsigned, int, int));
+static boolean unconstrain_map(void);
+static void reconstrain_map(void);
+static void map_redisplay(void);
+static void browse_map(int, const char *);
+static void map_monst(struct monst *, boolean);
+static void do_dknown_of(struct obj *);
+static boolean check_map_spot(int, int, char, unsigned);
+static boolean clear_stale_map(char, unsigned);
+static void sense_trap(struct trap *, xchar, xchar, int);
+static int detect_obj_traps(struct obj *, boolean, int);
+static int furniture_detect(void);
+static void show_map_spot(int, int);
+static void findone(int, int, genericptr_t);
+static void openone(int, int, genericptr_t);
+static int mfind0(struct monst *, boolean);
+static int reveal_terrain_getglyph(int, int, int, unsigned, int, int);
/* wildcard class for clear_stale_map - this used to be used as a getobj() input
* but it's no longer used for that function */
/* bring hero out from underwater or underground or being engulfed;
return True iff any change occurred */
static boolean
-unconstrain_map()
+unconstrain_map(void)
{
boolean res = u.uinwater || u.uburied || u.uswallow;
/* put hero back underwater or underground or engulfed */
static void
-reconstrain_map()
+reconstrain_map(void)
{
u.uinwater = iflags.save_uinwater, iflags.save_uinwater = 0; /* set_uinwater() */
u.uburied = iflags.save_uburied, iflags.save_uburied = 0;
}
static void
-map_redisplay()
+map_redisplay(void)
{
reconstrain_map();
docrt(); /* redraw the screen to remove unseen traps from the map */
/* use getpos()'s 'autodescribe' to view whatever is currently shown on map */
static void
-browse_map(ter_typ, ter_explain)
-int ter_typ;
-const char *ter_explain;
+browse_map(int ter_typ, const char *ter_explain)
{
coord dummy_pos; /* don't care whether player actually picks a spot */
boolean save_autodescribe;
/* extracted from monster_detection() so can be shared by do_vicinity_map() */
static void
-map_monst(mtmp, showtail)
-struct monst *mtmp;
-boolean showtail;
+map_monst(struct monst *mtmp, boolean showtail)
{
if (def_monsyms[(int) mtmp->data->mlet].sym == ' ')
show_glyph(mtmp->mx, mtmp->my,
/* this is checking whether a trap symbol represents a trapped chest,
not whether a trapped chest is actually present */
boolean
-trapped_chest_at(ttyp, x, y)
-int ttyp;
-int x, y;
+trapped_chest_at(int ttyp, int x, int y)
{
struct monst *mtmp;
struct obj *otmp;
/* this is checking whether a trap symbol represents a trapped door,
not whether the door here is actually trapped */
boolean
-trapped_door_at(ttyp, x, y)
-int ttyp;
-int x, y;
+trapped_door_at(int ttyp, int x, int y)
{
struct rm *lev;
/* recursively search obj for an object in class oclass, return 1st found */
struct obj *
-o_in(obj, oclass)
-struct obj *obj;
-char oclass;
+o_in(struct obj *obj, char oclass)
{
register struct obj *otmp;
struct obj *temp;
* Return first found.
*/
struct obj *
-o_material(obj, material)
-struct obj *obj;
-unsigned material;
+o_material(struct obj *obj, unsigned material)
{
register struct obj *otmp;
struct obj *temp;
}
static void
-do_dknown_of(obj)
-struct obj *obj;
+do_dknown_of(struct obj *obj)
{
struct obj *otmp;
/* Check whether the location has an outdated object displayed on it. */
static boolean
-check_map_spot(x, y, oclass, material)
-int x, y;
-char oclass;
-unsigned material;
+check_map_spot(int x, int y, char oclass, unsigned material)
{
int glyph;
register struct obj *otmp;
* change occurs.
*/
static boolean
-clear_stale_map(oclass, material)
-char oclass;
-unsigned material;
+clear_stale_map(char oclass, unsigned material)
{
register int zx, zy;
boolean change_made = FALSE;
/* look for gold, on the floor or in monsters' possession */
int
-gold_detect(sobj)
-register struct obj *sobj;
+gold_detect(struct obj *sobj)
{
register struct obj *obj;
register struct monst *mtmp;
/* returns 1 if nothing was detected, 0 if something was detected */
int
-food_detect(sobj)
-register struct obj *sobj;
+food_detect(struct obj *sobj)
{
register struct obj *obj;
register struct monst *mtmp;
* 0 - something was detected
*/
int
-object_detect(detector, class)
-struct obj *detector; /* object doing the detecting */
-int class; /* an object class, 0 for all */
+object_detect(struct obj *detector, /* object doing the detecting */
+ int class) /* an object class, 0 for all */
{
register int x, y;
char stuff[BUFSZ];
* Returns 0 if something was detected.
*/
int
-monster_detect(otmp, mclass)
-register struct obj *otmp; /* detecting object (if any) */
-int mclass; /* monster class, 0 for all */
+monster_detect(struct obj *otmp, /* detecting object (if any) */
+ int mclass) /* monster class, 0 for all */
{
register struct monst *mtmp;
int mcnt = 0;
}
static void
-sense_trap(trap, x, y, src_cursed)
-struct trap *trap;
-xchar x, y;
-int src_cursed;
+sense_trap(struct trap *trap, xchar x, xchar y, int src_cursed)
{
if (Hallucination || src_cursed) {
struct obj obj; /* fake object */
2 if found at some other spot, 3 if both, 0 otherwise; optionally
update the map to show where such traps were found */
static int
-detect_obj_traps(objlist, show_them, how)
-struct obj *objlist;
-boolean show_them;
-int how; /* 1 for misleading map feedback */
+detect_obj_traps(struct obj *objlist, boolean show_them,
+ int how) /* 1 for misleading map feedback */
{
struct obj *otmp;
xchar x, y;
* returns 0 if something was detected
*/
int
-trap_detect(sobj)
-struct obj *sobj; /* null if crystal ball, *scroll if gold detection scroll */
+trap_detect(struct obj *sobj) /* null if crystal ball,
+ *scroll if gold detection scroll */
{
register struct trap *ttmp;
struct monst *mon;
}
static int
-furniture_detect()
+furniture_detect(void)
{
struct monst *mon;
int x, y, glyph, sym, found = 0, revealed = 0;
}
const char *
-level_distance(where)
-d_level *where;
+level_distance(d_level *where)
{
register schar ll = depth(&u.uz) - depth(where);
register boolean indun = (u.uz.dnum == where->dnum);
};
void
-use_crystal_ball(optr)
-struct obj **optr;
+use_crystal_ball(struct obj **optr)
{
char ch;
int oops;
}
static void
-show_map_spot(x, y)
-register int x, y;
+show_map_spot(int x, int y)
{
struct rm *lev;
struct trap *t;
}
void
-do_mapping()
+do_mapping(void)
{
register int zx, zy;
boolean unconstrained;
/* clairvoyance */
void
-do_vicinity_map(sobj)
-struct obj *sobj; /* scroll--actually fake spellbook--object */
+do_vicinity_map(struct obj *sobj) /* scroll--actually fake spellbook--object */
{
register int zx, zy;
struct monst *mtmp;
/* convert a secret door into a normal door */
void
-cvt_sdoor_to_door(lev)
-struct rm *lev;
+cvt_sdoor_to_door(struct rm *lev)
{
int newmask = lev->doormask & ~WM_MASK;
/* find something at one location; it should find all somethings there
since it is used for magical detection rather than physical searching */
static void
-findone(zx, zy, num)
-int zx, zy;
-genericptr_t num;
+findone(int zx, int zy, genericptr_t num)
{
register struct trap *ttmp;
register struct monst *mtmp;
}
static void
-openone(zx, zy, num)
-int zx, zy;
-genericptr_t num;
+openone(int zx, int zy, genericptr_t num)
{
register struct trap *ttmp;
register struct obj *otmp;
/* returns number of things found */
int
-findit()
+findit(void)
{
int num = 0;
/* returns number of things found and opened */
int
-openit()
+openit(void)
{
int num = 0;
/* callback hack for overriding vision in do_clear_area() */
boolean
-detecting(func)
-void FDECL((*func), (int, int, genericptr_t));
+detecting(void (*func)(int, int, genericptr_t))
{
return (func == findone || func == openone);
}
void
-find_trap(trap)
-struct trap *trap;
+find_trap(struct trap *trap)
{
boolean cleared = FALSE;
}
static int
-mfind0(mtmp, via_warning)
-struct monst *mtmp;
-boolean via_warning;
+mfind0(struct monst *mtmp, boolean via_warning)
{
int x = mtmp->mx, y = mtmp->my;
boolean found_something = FALSE;
}
int
-dosearch0(aflag)
-register int aflag; /* intrinsic autosearch vs explicit searching */
+dosearch0(int aflag) /* intrinsic autosearch vs explicit searching */
{
xchar x, y;
register struct trap *trap;
/* the 's' command -- explicit searching */
int
-dosearch()
+dosearch(void)
{
if (cmd_safety_prevention("another search",
"You already found a monster.",
}
void
-warnreveal()
+warnreveal(void)
{
int x, y;
struct monst *mtmp;
/* Pre-map the sokoban levels */
void
-sokoban_detect()
+sokoban_detect(void)
{
register int x, y;
register struct trap *ttmp;
}
static int
-reveal_terrain_getglyph(x, y, full, swallowed, default_glyph, which_subset)
-int x, y, full;
-unsigned swallowed;
-int default_glyph, which_subset;
+reveal_terrain_getglyph(int x, int y, int full, unsigned swallowed,
+ int default_glyph, int which_subset)
{
int glyph, levl_glyph;
uchar seenv;
#ifdef DUMPLOG
void
-dump_map()
+dump_map(void)
{
int x, y, glyph, skippedrows, lastnonblank;
int subset = TER_MAP | TER_TRP | TER_OBJ | TER_MON;
/* idea from crawl; show known portion of map without any monsters,
objects, or traps occluding the view of the underlying terrain */
void
-reveal_terrain(full, which_subset)
-int full; /* wizard|explore modes allow player to request full map */
-int which_subset; /* when not full, whether to suppress objs and/or traps */
+reveal_terrain(int full, /* wizard|explore modes allow player
+ to request full map */
+ int which_subset) /* when not full, whether to suppress
+ objs and/or traps */
{
if ((Hallucination || Stunned || Confusion) && !full) {
You("are too disoriented for this.");
}
int
-wiz_mgender(VOID_ARGS)
+wiz_mgender(void)
{
iflags.wizmgender = !iflags.wizmgender;
pline("wizmgender toggled %s", iflags.wizmgender ? "on" : "off");
#include "hack.h"
-static boolean NDECL(rm_waslit);
-static void FDECL(mkcavepos,
- (XCHAR_P, XCHAR_P, int, BOOLEAN_P, BOOLEAN_P));
-static void FDECL(mkcavearea, (BOOLEAN_P));
-static int NDECL(dig);
-static void FDECL(dig_up_grave, (coord *));
-static int FDECL(adj_pit_checks, (coord *, char *));
-static void FDECL(pit_flow, (struct trap *, SCHAR_P));
-static boolean FDECL(furniture_handled, (int, int, BOOLEAN_P));
+static boolean rm_waslit(void);
+static void mkcavepos(xchar, xchar, int, boolean, boolean);
+static void mkcavearea(boolean);
+static int dig(void);
+static void dig_up_grave(coord *);
+static int adj_pit_checks(coord *, char *);
+static void pit_flow(struct trap *, schar);
+static boolean furniture_handled(int, int, boolean);
/* Indices returned by dig_typ() */
enum dig_types {
};
static boolean
-rm_waslit()
+rm_waslit(void)
{
register xchar x, y;
* immediately after the effect is complete.
*/
static void
-mkcavepos(x, y, dist, waslit, rockit)
-xchar x, y;
-int dist;
-boolean waslit, rockit;
+mkcavepos(xchar x, xchar y, int dist, boolean waslit, boolean rockit)
{
register struct rm *lev;
}
static void
-mkcavearea(rockit)
-register boolean rockit;
+mkcavearea(boolean rockit)
{
int dist;
xchar xmin = u.ux, xmax = u.ux;
/* When digging into location <x,y>, what are you actually digging into? */
int
-dig_typ(otmp, x, y)
-struct obj *otmp;
-xchar x, y;
+dig_typ(struct obj *otmp, xchar x, xchar y)
{
boolean ispick;
}
boolean
-is_digging()
+is_digging(void)
{
if (g.occupation == dig) {
return TRUE;
#define BY_OBJECT ((struct monst *) 0)
boolean
-dig_check(madeby, verbose, x, y)
-struct monst *madeby;
-boolean verbose;
-int x, y;
+dig_check(struct monst *madeby, boolean verbose, int x, int y)
{
struct trap *ttmp = t_at(x, y);
const char *verb =
}
static int
-dig(VOID_ARGS)
+dig(void)
{
register struct rm *lev;
register xchar dpx = g.context.digging.pos.x, dpy = g.context.digging.pos.y;
}
static boolean
-furniture_handled(x, y, madeby_u)
-int x, y;
-boolean madeby_u;
+furniture_handled(int x, int y, boolean madeby_u)
{
struct rm *lev = &levl[x][y];
/* When will hole be finished? Very rough indication used by shopkeeper. */
int
-holetime()
+holetime(void)
{
if (g.occupation != dig || !*u.ushops)
return -1;
/* Return typ of liquid to fill a hole with, or ROOM, if no liquid nearby */
schar
-fillholetyp(x, y, fill_if_any)
-int x, y;
-boolean fill_if_any; /* force filling if it exists at all */
+fillholetyp(int x, int y,
+ boolean fill_if_any) /* force filling if it exists at all */
{
register int x1, y1;
int lo_x = max(1, x - 1), hi_x = min(x + 1, COLNO - 1),
}
void
-digactualhole(x, y, madeby, ttyp)
-register int x, y;
-struct monst *madeby;
-int ttyp;
+digactualhole(int x, int y, struct monst *madeby, int ttyp)
{
struct obj *oldobjs, *newobjs;
register struct trap *ttmp;
* in apply.c.
*/
void
-liquid_flow(x, y, typ, ttmp, fillmsg)
-xchar x, y;
-schar typ;
-struct trap *ttmp;
-const char *fillmsg;
+liquid_flow(xchar x, xchar y, schar typ, struct trap *ttmp,
+ const char *fillmsg)
{
struct obj *objchain;
struct monst *mon;
/* return TRUE if digging succeeded, FALSE otherwise */
boolean
-dighole(pit_only, by_magic, cc)
-boolean pit_only, by_magic;
-coord *cc;
+dighole(boolean pit_only, boolean by_magic, coord *cc)
{
register struct trap *ttmp;
struct rm *lev;
}
static void
-dig_up_grave(cc)
-coord *cc;
+dig_up_grave(coord *cc)
{
struct obj *otmp;
xchar dig_x, dig_y;
}
int
-use_pick_axe(obj)
-struct obj *obj;
+use_pick_axe(struct obj *obj)
{
const char *sdp, *verb;
char *dsp, dirsyms[12], qbuf[BUFSZ];
/* the "In what direction do you want to dig?" query. */
/* use_pick_axe2() uses the existing u.dx, u.dy and u.dz */
int
-use_pick_axe2(obj)
-struct obj *obj;
+use_pick_axe2(struct obj *obj)
{
register int rx, ry;
register struct rm *lev;
* zap == TRUE if wand/spell of digging, FALSE otherwise (chewing)
*/
void
-watch_dig(mtmp, x, y, zap)
-struct monst *mtmp;
-xchar x, y;
-boolean zap;
+watch_dig(struct monst *mtmp, xchar x, xchar y, boolean zap)
{
struct rm *lev = &levl[x][y];
/* Return TRUE if monster died, FALSE otherwise. Called from m_move(). */
boolean
-mdig_tunnel(mtmp)
-register struct monst *mtmp;
+mdig_tunnel(struct monst *mtmp)
{
register struct rm *here;
int pile = rnd(12);
/* draft refers to air currents, but can be a pun on "draft" as conscription
for military service (probably not a good pun if it has to be explained) */
void
-draft_message(unexpected)
-boolean unexpected;
+draft_message(boolean unexpected)
{
/*
* [Bug or TODO? Have caller pass coordinates and use the travel
/* digging via wand zap or spell cast */
void
-zap_dig()
+zap_dig(void)
{
struct rm *room;
struct monst *mtmp;
* down in the pit.
*/
static int
-adj_pit_checks(cc, msg)
-coord *cc;
-char *msg;
+adj_pit_checks(coord *cc, char *msg)
{
int ltyp;
struct rm *room;
* Ensure that all conjoined pits fill up.
*/
static void
-pit_flow(trap, filltyp)
-struct trap *trap;
-schar filltyp;
+pit_flow(struct trap *trap, schar filltyp)
{
/*
* FIXME?
}
struct obj *
-buried_ball(cc)
-coord *cc;
+buried_ball(coord *cc)
{
int odist, bdist = COLNO;
struct obj *otmp, *ball = 0;
}
void
-buried_ball_to_punishment()
+buried_ball_to_punishment(void)
{
coord cc;
struct obj *ball;
}
void
-buried_ball_to_freedom()
+buried_ball_to_freedom(void)
{
coord cc;
struct obj *ball;
/* move objects from fobj/nexthere lists to buriedobjlist, keeping position
information */
struct obj *
-bury_an_obj(otmp, dealloced)
-struct obj *otmp;
-boolean *dealloced;
+bury_an_obj(struct obj *otmp, boolean *dealloced)
{
struct obj *otmp2;
boolean under_ice;
}
void
-bury_objs(x, y)
-int x, y;
+bury_objs(int x, int y)
{
struct obj *otmp, *otmp2;
struct monst *shkp;
/* move objects from buriedobjlist to fobj/nexthere lists */
void
-unearth_objs(x, y)
-int x, y;
+unearth_objs(int x, int y)
{
struct obj *otmp, *otmp2, *bball;
coord cc;
*/
/* ARGSUSED */
void
-rot_organic(arg, timeout)
-anything *arg;
-long timeout UNUSED;
+rot_organic(anything *arg, long timeout UNUSED)
{
struct obj *obj = arg->a_obj;
* Called when a corpse has rotted completely away.
*/
void
-rot_corpse(arg, timeout)
-anything *arg;
-long timeout;
+rot_corpse(anything *arg, long timeout)
{
xchar x = 0, y = 0;
struct obj *obj = arg->a_obj;
#if 0
void
-bury_monst(mtmp)
-struct monst *mtmp;
+bury_monst(struct monst *mtmp)
{
debugpline1("bury_monst: %s", mon_nam(mtmp));
if (canseemon(mtmp)) {
}
void
-bury_you()
+bury_you(void)
{
debugpline0("bury_you");
if (!Levitation && !Flying) {
}
void
-unearth_you()
+unearth_you(void)
{
debugpline0("unearth_you");
u.uburied = FALSE;
}
void
-escape_tomb()
+escape_tomb(void)
{
debugpline0("escape_tomb");
if ((Teleportation || can_teleport(g.youmonst.data))
#ifdef DEBUG
/* bury everything at your loc and around */
int
-wiz_debug_cmd_bury()
+wiz_debug_cmd_bury(void)
{
int x, y;
*/
#include "hack.h"
-static void FDECL(show_mon_or_warn, (int, int, int));
-static void FDECL(display_monster, (XCHAR_P, XCHAR_P, struct monst *, int,
- BOOLEAN_P));
-static int FDECL(swallow_to_glyph, (int, int));
-static void FDECL(display_warning, (struct monst *));
-
-static int FDECL(check_pos, (int, int, int));
-static int FDECL(get_bk_glyph, (XCHAR_P, XCHAR_P));
-static int FDECL(tether_glyph, (int, int));
+static void show_mon_or_warn(int, int, int);
+static void display_monster(xchar, xchar, struct monst *, int, boolean);
+static int swallow_to_glyph(int, int);
+static void display_warning(struct monst *);
+
+static int check_pos(int, int, int);
+static int get_bk_glyph(xchar, xchar);
+static int tether_glyph(int, int);
#ifdef UNBUFFERED_GLYPHINFO
-static glyph_info *FDECL(glyphinfo_at, (XCHAR_P, XCHAR_P, int));
+static glyph_info *glyphinfo_at(xchar, xchar, int);
#endif
/*#define WA_VERBOSE*/ /* give (x,y) locations for all "bad" spots */
#ifdef WA_VERBOSE
-static boolean FDECL(more_than_one, (int, int, int, int, int));
+static boolean more_than_one(int, int, int, int, int);
#endif
-static int FDECL(set_twall, (int, int, int, int, int, int, int, int));
-static int FDECL(set_wall, (int, int, int));
-static int FDECL(set_corn, (int, int, int, int, int, int, int, int));
-static int FDECL(set_crosswall, (int, int));
-static void FDECL(set_seenv, (struct rm *, int, int, int, int));
-static void FDECL(t_warn, (struct rm *));
-static int FDECL(wall_angle, (struct rm *));
+static int set_twall(int, int, int, int, int, int, int, int);
+static int set_wall(int, int, int);
+static int set_corn(int, int, int, int, int, int, int, int);
+static int set_crosswall(int, int);
+static void set_seenv(struct rm *, int, int, int, int);
+static void t_warn(struct rm *);
+static int wall_angle(struct rm *);
#define remember_topology(x, y) (g.lastseentyp[x][y] = levl[x][y].typ)
* attention to and correct unexplored, lit ROOM and CORR spots.
*/
void
-magic_map_background(x, y, show)
-xchar x, y;
-int show;
+magic_map_background(xchar x, xchar y, int show)
{
int glyph = back_to_glyph(x, y); /* assumes hero can see x,y */
struct rm *lev = &levl[x][y];
* the hero can physically see the location. Update the screen if directed.
*/
void
-map_background(x, y, show)
-register xchar x, y;
-register int show;
+map_background(register xchar x, register xchar y, register int show)
{
register int glyph = back_to_glyph(x, y);
* hero can physically see the location.
*/
void
-map_trap(trap, show)
-register struct trap *trap;
-register int show;
+map_trap(register struct trap *trap, register int show)
{
register int x = trap->tx, y = trap->ty;
register int glyph = trap_to_glyph(trap);
* see the location of the object. Update the screen if directed.
*/
void
-map_object(obj, show)
-register struct obj *obj;
-register int show;
+map_object(register struct obj *obj, register int show)
{
register int x = obj->ox, y = obj->oy;
register int glyph = obj_to_glyph(obj, newsym_rn2);
* by newsym() if necessary.
*/
void
-map_invisible(x, y)
-register xchar x, y;
+map_invisible(register xchar x, register xchar y)
{
if (x != u.ux || y != u.uy) { /* don't display I at hero's location */
if (g.level.flags.hero_memory)
}
boolean
-unmap_invisible(x, y)
-int x, y;
+unmap_invisible(int x, int y)
{
if (isok(x,y) && glyph_is_invisible(levl[x][y].glyph)) {
unmap_object(x, y);
* to call newsym().
*/
void
-unmap_object(x, y)
-register int x, y;
+unmap_object(register int x, register int y)
{
register struct trap *trap;
}
void
-map_location(x, y, show)
-int x, y, show;
+map_location(int x, int y, int show)
{
_map_location(x, y, show);
}
/* display something on monster layer; may need to fixup object layer */
static void
-show_mon_or_warn(x, y, monglyph)
-int x, y, monglyph;
+show_mon_or_warn(int x, int y, int monglyph)
{
struct obj *o;
*
*/
static void
-display_monster(x, y, mon, sightflags, worm_tail)
-register xchar x, y; /* display position */
-register struct monst *mon; /* monster to display */
-int sightflags; /* 1 if the monster is physically seen;
- 2 if detected using Detect_monsters */
-boolean worm_tail; /* mon is actually a worm tail */
+display_monster(xchar x, xchar y, /* display position */
+ struct monst *mon, /* monster to display */
+ int sightflags, /* 1 if the monster is physically seen;
+ 2 if detected using Detect_monsters */
+ boolean worm_tail) /* mon is actually a worm tail */
{
boolean mon_mimic = (M_AP_TYPE(mon) != M_AP_NOTHING);
int sensed = (mon_mimic && (Protection_from_shape_changers
* Do not call for worm tails.
*/
static void
-display_warning(mon)
-register struct monst *mon;
+display_warning(struct monst *mon)
{
int x = mon->mx, y = mon->my;
int glyph;
}
int
-warning_of(mon)
-struct monst *mon;
+warning_of(struct monst *mon)
{
int wl = 0, tmp = 0;
* When hero knows what happened to location, even when blind.
*/
void
-feel_newsym(x, y)
-xchar x, y;
+feel_newsym(xchar x, xchar y)
{
if (Blind)
feel_location(x, y);
* searching only finds one monster per turn so we must check that separately.
*/
void
-feel_location(x, y)
-xchar x, y;
+feel_location(xchar x, xchar y)
{
struct rm *lev;
struct obj *boulder;
* Possibly put a new glyph at the given location.
*/
void
-newsym(x, y)
-register int x, y;
+newsym(register int x, register int y)
{
struct monst *mon;
int see_it;
* pulled into a platform dependent routine for fancier graphics if desired.
*/
void
-shieldeff(x, y)
-xchar x, y;
+shieldeff(xchar x, xchar y)
{
register int i;
}
static int
-tether_glyph(x, y)
-int x, y;
+tether_glyph(int x, int y)
{
int tdx, tdy;
tdx = u.ux - x;
} tgfirst;
void
-tmp_at(x, y)
-int x, y;
+tmp_at(int x, int y)
{
static struct tmp_glyph *tglyph = (struct tmp_glyph *) 0;
struct tmp_glyph *tmp;
* meant to be at the location.
*/
void
-flash_glyph_at(x, y, tg, rpt)
-int x, y;
-int tg, rpt;
+flash_glyph_at(int x, int y, int tg, int rpt)
{
int i, glyph[2];
* being swallowed.
*/
void
-swallowed(first)
-int first;
+swallowed(int first)
{
static xchar lastx, lasty; /* last swallowed position */
int swallower, left_ok, rght_ok;
* except when in water level. Special routines exist for that.
*/
void
-under_water(mode)
-int mode;
+under_water(int mode)
{
static xchar lastx, lasty;
static boolean dela;
* Very restricted display. You can only see yourself.
*/
void
-under_ground(mode)
-int mode;
+under_ground(int mode)
{
static boolean dela;
* sit.c]
*/
void
-see_monsters()
+see_monsters(void)
{
register struct monst *mon;
int new_warn_obj_cnt = 0;
* changes.
*/
void
-set_mimic_blocking()
+set_mimic_blocking(void)
{
register struct monst *mon;
* + hallucinating.
*/
void
-see_objects()
+see_objects(void)
{
register struct obj *obj;
* Update hallucinated traps.
*/
void
-see_traps()
+see_traps(void)
{
struct trap *trap;
int glyph;
* Put the cursor on the hero. Flush all accumulated glyphs before doing it.
*/
void
-curs_on_u()
+curs_on_u(void)
{
flush_screen(1); /* Flush waiting glyphs & put cursor on hero */
}
int
-doredraw()
+doredraw(void)
{
docrt();
return 0;
}
void
-docrt()
+docrt(void)
{
register int x, y;
register struct rm *lev;
/* for panning beyond a clipped region; resend the current map data to
the interface rather than use docrt()'s regeneration of that data */
void
-redraw_map()
+redraw_map(void)
{
int x, y, glyph;
glyph_info bkglyphinfo = nul_glyphinfo;
* =======================================================
*/
void
-reglyph_darkroom()
+reglyph_darkroom(void)
{
xchar x, y;
* between object piles and single objects, it doesn't mark the location
* for update. */
void
-newsym_force(x, y)
-register int x, y;
+newsym_force(int x, int y)
{
newsym(x, y);
g.gbuf[y][x].gnew = 1;
* Store the glyph in the 3rd screen for later flushing.
*/
void
-show_glyph(x, y, glyph)
-int x, y, glyph;
+show_glyph(int x, int y, int glyph)
{
#ifndef UNBUFFERED_GLYPHINFO
glyph_info glyphinfo;
* Turn the 3rd screen into UNEXPLORED that needs to be refreshed.
*/
void
-clear_glyph_buffer()
+clear_glyph_buffer(void)
{
register int x, y;
gbuf_entry *gptr = &g.gbuf[0][0];
/* used by tty after menu or text popup has temporarily overwritten the map
and it has been erased so shows spaces, not necessarily S_unexplored */
void
-row_refresh(start, stop, y)
-int start, stop, y;
+row_refresh(int start, int stop, int y)
{
register int x, glyph;
register boolean force;
}
void
-cls()
+cls(void)
{
static boolean in_cls = 0;
* Synch the third screen with the display.
*/
void
-flush_screen(cursor_on_u)
-int cursor_on_u;
+flush_screen(int cursor_on_u)
{
/* Prevent infinite loops on errors:
* flush_screen->print_glyph->impossible->pline->flush_screen
* variables.
*/
int
-back_to_glyph(x, y)
-xchar x, y;
+back_to_glyph(xchar x, xchar y)
{
int idx;
struct rm *ptr = &(levl[x][y]);
* a random monster in swallowed() and don't use what_mon() here.
*/
static int
-swallow_to_glyph(mnum, loc)
-int mnum;
-int loc;
+swallow_to_glyph(int mnum, int loc)
{
if (loc < S_sw_tl || S_sw_br < loc) {
impossible("swallow_to_glyph: bad swallow location");
* / S_rslant (-1, 1) or ( 1,-1)
*/
int
-zapdir_to_glyph(dx, dy, beam_type)
-register int dx, dy;
-int beam_type;
+zapdir_to_glyph(int dx, int dy, int beam_type)
{
if (beam_type >= NUM_ZAP) {
impossible("zapdir_to_glyph: illegal beam type");
* structure, so we must check the "third screen".
*/
int
-glyph_at(x, y)
-xchar x, y;
+glyph_at(xchar x, xchar y)
{
if (x < 0 || y < 0 || x >= COLNO || y >= ROWNO)
return cmap_to_glyph(S_room); /* XXX */
#ifdef UNBUFFERED_GLYPHINFO
glyph_info *
-glyphinfo_at(x, y, glyph)
-xchar x, y;
-int glyph;
+glyphinfo_at(xchar x, xchar y, int glyph)
{
map_glyphinfo(x, y, glyph, 0, &ginfo);
return &ginfo;
*/
static int
-get_bk_glyph(x, y)
-xchar x, y;
+get_bk_glyph(xchar x, xchar y)
{
int idx, bkglyph = GLYPH_UNEXPLORED;
struct rm *lev = &levl[x][y];
#define GMAP_ALTARCOLOR 0x00000004
void
-map_glyphinfo(x, y, glyph, mgflags, glyphinfo)
-xchar x, y;
-int glyph;
-unsigned mgflags;
-glyph_info *glyphinfo;
+map_glyphinfo(xchar x, xchar y, int glyph,
+ unsigned mgflags, glyph_info *glyphinfo)
{
register int offset, idx;
int color = NO_COLOR;
#ifdef WA_VERBOSE
-static const char *FDECL(type_to_name, (int));
-static void FDECL(error4, (int, int, int, int, int, int));
+static const char *type_to_name(int);
+static void error4(int, int, int, int, int, int);
static int bad_count[MAX_TYPE]; /* count of positions flagged as bad */
static const char *type_names[MAX_TYPE] = {
};
static const char *
-type_to_name(type)
-int type;
+type_to_name(int type)
{
return (type < 0 || type >= MAX_TYPE) ? "unknown" : type_names[type];
}
static void
-error4(x, y, a, b, c, dd)
-int x, y, a, b, c, dd;
+error4(int x, int y, int a, int b, int c, int dd)
{
pline("set_wall_state: %s @ (%d,%d) %s%s%s%s",
type_to_name(levl[x][y].typ), x, y,
* Things that are ambiguous: lava
*/
static int
-check_pos(x, y, which)
-int x, y, which;
+check_pos(int x, int y, int which)
{
int type;
/*ARGSUSED*/
#ifdef WA_VERBOSE
static boolean
-more_than_one(x, y, a, b, c)
-int x, y, a, b, c;
+more_than_one(int x, int y, int a, int b, int c)
{
if ((a && (b | c)) || (b && (a | c)) || (c && (a | b))) {
error4(x, y, a, b, c, 0);
/* Return the wall mode for a T wall. */
static int
-set_twall(x0, y0, x1, y1, x2, y2, x3, y3)
+set_twall(
#ifdef WA_VERBOSE
-int x0, y0; /* used #if WA_VERBOSE */
+ int x0, int y0, /* used #if WA_VERBOSE */
#else
-int x0 UNUSED, y0 UNUSED;
+ int x0 UNUSED, int y0 UNUSED,
#endif
-int x1, y1, x2, y2, x3, y3;
+ int x1, int y1, int x2, int y2, int x3, int y3)
{
int wmode, is_1, is_2, is_3;
/* Return wall mode for a horizontal or vertical wall. */
static int
-set_wall(x, y, horiz)
-int x, y, horiz;
+set_wall(int x, int y, int horiz)
{
int wmode, is_1, is_2;
/* Return a wall mode for a corner wall. (x4,y4) is the "inner" position. */
static int
-set_corn(x1, y1, x2, y2, x3, y3, x4, y4)
-int x1, y1, x2, y2, x3, y3, x4, y4;
+set_corn(int x1, int y1, int x2, int y2, int x3, int y3, int x4, int y4)
{
int wmode, is_1, is_2, is_3, is_4;
/* Return mode for a crosswall. */
static int
-set_crosswall(x, y)
-int x, y;
+set_crosswall(int x, int y)
{
int wmode, is_1, is_2, is_3, is_4;
/* Called from mklev. Scan the level and set the wall modes. */
void
-set_wall_state()
+set_wall_state(void)
{
int x, y;
int wmode;
/* Set the seen vector of lev as if seen from (x0,y0) to (x,y). */
static void
-set_seenv(lev, x0, y0, x, y)
-struct rm *lev;
-int x0, y0, x, y; /* from, to */
+set_seenv(struct rm *lev,
+ int x0, int y0, int x, int y) /* from, to */
{
int dx = x - x0, dy = y0 - y;
/* Called by blackout(vault.c) when vault guard removes temporary corridor,
turning spot <x0,y0> back into stone; <x1,y1> is an adjacent spot. */
void
-unset_seenv(lev, x0, y0, x1, y1)
-struct rm *lev; /* &levl[x1][y1] */
-int x0, y0, x1, y1; /* from, to; abs(x1-x0)==1 && abs(y0-y1)==1 */
+unset_seenv(struct rm *lev, /* &levl[x1][y1] */
+ int x0, int y0, int x1, int y1) /* from, to; abs(x1-x0)==1
+ && abs(y0-y1)==1 */
{
int dx = x1 - x0, dy = y0 - y1;
/* Print out a T wall warning and all interesting info. */
static void
-t_warn(lev)
-struct rm *lev;
+t_warn(struct rm *lev)
{
static const char warn_str[] = "wall_angle: %s: case %d: seenv = 0x%x";
const char *wname;
* seen vector (SV).
*/
static int
-wall_angle(lev)
-struct rm *lev;
+wall_angle(struct rm *lev)
{
register unsigned int seenv = lev->seenv & 0xff;
const int *row;
*/
typedef struct dlb_procs {
- boolean NDECL((*dlb_init_proc));
- void NDECL((*dlb_cleanup_proc));
- boolean FDECL((*dlb_fopen_proc), (DLB_P, const char *, const char *));
- int FDECL((*dlb_fclose_proc), (DLB_P));
- int FDECL((*dlb_fread_proc), (char *, int, int, DLB_P));
- int FDECL((*dlb_fseek_proc), (DLB_P, long, int));
- char *FDECL((*dlb_fgets_proc), (char *, int, DLB_P));
- int FDECL((*dlb_fgetc_proc), (DLB_P));
- long FDECL((*dlb_ftell_proc), (DLB_P));
+ boolean (*dlb_init_proc)(void);
+ void (*dlb_cleanup_proc)(void);
+ boolean (*dlb_fopen_proc)(DLB_P, const char *, const char *);
+ int (*dlb_fclose_proc)(DLB_P);
+ int (*dlb_fread_proc)(char *, int, int, DLB_P);
+ int (*dlb_fseek_proc)(DLB_P, long, int);
+ char *(*dlb_fgets_proc)(char *, int, DLB_P);
+ int (*dlb_fgetc_proc)(DLB_P);
+ long (*dlb_ftell_proc)(DLB_P);
} dlb_procs_t;
#if defined(VERSION_IN_DLB_FILENAME)
#endif
/* without extern.h via hack.h, these haven't been declared for us */
-extern FILE *FDECL(fopen_datafile, (const char *, const char *, int));
+extern FILE *fopen_datafile(const char *, const char *, int);
#ifdef DLBLIB
/*
#define MAX_LIBS 4
static library dlb_libs[MAX_LIBS];
-static boolean FDECL(readlibdir, (library * lp));
-static boolean FDECL(find_file, (const char *name, library **lib,
- long *startp, long *sizep));
-static boolean NDECL(lib_dlb_init);
-static void NDECL(lib_dlb_cleanup);
-static boolean FDECL(lib_dlb_fopen, (dlb *, const char *, const char *));
-static int FDECL(lib_dlb_fclose, (dlb *));
-static int FDECL(lib_dlb_fread, (char *, int, int, dlb *));
-static int FDECL(lib_dlb_fseek, (dlb *, long, int));
-static char *FDECL(lib_dlb_fgets, (char *, int, dlb *));
-static int FDECL(lib_dlb_fgetc, (dlb *));
-static long FDECL(lib_dlb_ftell, (dlb *));
+static boolean readlibdir(library * lp);
+static boolean find_file(const char *name, library **lib, long *startp,
+ long *sizep);
+static boolean lib_dlb_init(void);
+static void lib_dlb_cleanup(void);
+static boolean lib_dlb_fopen(dlb *, const char *, const char *);
+static int lib_dlb_fclose(dlb *);
+static int lib_dlb_fread(char *, int, int, dlb *);
+static int lib_dlb_fseek(dlb *, long, int);
+static char *lib_dlb_fgets(char *, int, dlb *);
+static int lib_dlb_fgetc(dlb *);
+static long lib_dlb_ftell(dlb *);
/* not static because shared with dlb_main.c */
-boolean FDECL(open_library, (const char *lib_name, library *lp));
-void FDECL(close_library, (library * lp));
+boolean open_library(const char *lib_name, library *lp);
+void close_library(library * lp);
/* without extern.h via hack.h, these haven't been declared for us */
-extern char *FDECL(eos, (char *));
+extern char *eos(char *);
/*
* Read the directory out of the library. Return 1 if successful,
* Return TRUE on success, FALSE on failure.
*/
static boolean
-readlibdir(lp)
-library *lp; /* library pointer to fill in */
+readlibdir(library *lp) /* library pointer to fill in */
{
int i;
char *sp;
* 0 if not found. Fill in the size and starting position.
*/
static boolean
-find_file(name, lib, startp, sizep)
-const char *name;
-library **lib;
-long *startp, *sizep;
+find_file(const char *name, library **lib, long *startp, long *sizep)
{
int i, j;
library *lp;
* structure. Return TRUE if successful, FALSE otherwise.
*/
boolean
-open_library(lib_name, lp)
-const char *lib_name;
-library *lp;
+open_library(const char *lib_name, library *lp)
{
boolean status = FALSE;
}
void
-close_library(lp)
-library *lp;
+close_library(library *lp)
{
(void) fclose(lp->fdata);
free((genericptr_t) lp->dir);
* keep track of the file position.
*/
static boolean
-lib_dlb_init(VOID_ARGS)
+lib_dlb_init(void)
{
/* zero out array */
(void) memset((char *) &dlb_libs[0], 0, sizeof(dlb_libs));
}
static void
-lib_dlb_cleanup(VOID_ARGS)
+lib_dlb_cleanup(void)
{
int i;
#ifdef VERSION_IN_DLB_FILENAME
char *
-build_dlb_filename(lf)
-const char *lf;
+build_dlb_filename(const char *lf)
{
Sprintf(dlbfilename, "%s%d%d%d",
lf ? lf : DLBBASENAME, VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
/*ARGSUSED*/
static boolean
-lib_dlb_fopen(dp, name, mode)
-dlb *dp;
-const char *name;
-const char *mode UNUSED;
+lib_dlb_fopen(dlb *dp, const char *name, const char *mode UNUSED)
{
long start, size;
library *lp;
/*ARGUSED*/
static int
-lib_dlb_fclose(dp)
-dlb *dp UNUSED;
+lib_dlb_fclose(dlb *dp UNUSED)
{
/* nothing needs to be done */
return 0;
}
static int
-lib_dlb_fread(buf, size, quan, dp)
-char *buf;
-int size, quan;
-dlb *dp;
+lib_dlb_fread(char *buf, int size, int quan, dlb *dp)
{
long pos, nread, nbytes;
}
static int
-lib_dlb_fseek(dp, pos, whence)
-dlb *dp;
-long pos;
-int whence;
+lib_dlb_fseek(dlb *dp, long pos, int whence)
{
long curpos;
}
static char *
-lib_dlb_fgets(buf, len, dp)
-char *buf;
-int len;
-dlb *dp;
+lib_dlb_fgets(char *buf, int len, dlb *dp)
{
int i;
char *bp, c = 0;
}
static int
-lib_dlb_fgetc(dp)
-dlb *dp;
+lib_dlb_fgetc(dlb *dp)
{
char c;
}
static long
-lib_dlb_ftell(dp)
-dlb *dp;
+lib_dlb_ftell(dlb *dp)
{
return dp->mark;
}
static boolean dlb_initialized = FALSE;
boolean
-dlb_init()
+dlb_init(void)
{
if (!dlb_initialized) {
#ifdef DLBLIB
}
void
-dlb_cleanup()
+dlb_cleanup(void)
{
if (dlb_initialized) {
do_dlb_cleanup();
}
dlb *
-dlb_fopen(name, mode)
-const char *name, *mode;
+dlb_fopen(const char *name, const char *mode)
{
FILE *fp;
dlb *dp;
}
int
-dlb_fclose(dp)
-dlb *dp;
+dlb_fclose(dlb *dp)
{
int ret = 0;
}
int
-dlb_fread(buf, size, quan, dp)
-char *buf;
-int size, quan;
-dlb *dp;
+dlb_fread(char *buf, int size, int quan, dlb *dp)
{
if (!dlb_initialized || size <= 0 || quan <= 0)
return 0;
}
int
-dlb_fseek(dp, pos, whence)
-dlb *dp;
-long pos;
-int whence;
+dlb_fseek(dlb *dp, long pos, int whence)
{
if (!dlb_initialized)
return EOF;
}
char *
-dlb_fgets(buf, len, dp)
-char *buf;
-int len;
-dlb *dp;
+dlb_fgets(char *buf, int len, dlb *dp)
{
if (!dlb_initialized)
return (char *) 0;
}
int
-dlb_fgetc(dp)
-dlb *dp;
+dlb_fgetc(dlb *dp)
{
if (!dlb_initialized)
return EOF;
}
long
-dlb_ftell(dp)
-dlb *dp;
+dlb_ftell(dlb *dp)
{
if (!dlb_initialized)
return 0;
#include "hack.h"
-static void FDECL(trycall, (struct obj *));
-static void NDECL(polymorph_sink);
-static boolean NDECL(teleport_sink);
-static void FDECL(dosinkring, (struct obj *));
-static int FDECL(drop, (struct obj *));
-static boolean FDECL(engulfer_digests_food, (struct obj *));
-static int NDECL(wipeoff);
-static int FDECL(menu_drop, (int));
-static NHFILE *NDECL(currentlevel_rewrite);
-static void NDECL(final_level);
-/* static boolean FDECL(badspot, (XCHAR_P,XCHAR_P)); */
+static void trycall(struct obj *);
+static void polymorph_sink(void);
+static boolean teleport_sink(void);
+static void dosinkring(struct obj *);
+static int drop(struct obj *);
+static boolean engulfer_digests_food(struct obj *);
+static int wipeoff(void);
+static int menu_drop(int);
+static NHFILE *currentlevel_rewrite(void);
+static void final_level(void);
+
+/* static boolean badspot(xchar,xchar); */
/* 'd' command: drop one inventory item */
int
-dodrop()
+dodrop(void)
{
int result;
* it's gone for good... If the destination is not a pool, returns FALSE.
*/
boolean
-boulder_hits_pool(otmp, rx, ry, pushing)
-struct obj *otmp;
-register int rx, ry;
-boolean pushing;
+boulder_hits_pool(struct obj *otmp, int rx, int ry, boolean pushing)
{
if (!otmp || otmp->otyp != BOULDER) {
impossible("Not a boulder?");
* away.
*/
boolean
-flooreffects(obj, x, y, verb)
-struct obj *obj;
-int x, y;
-const char *verb;
+flooreffects(struct obj *obj, int x, int y, const char *verb)
{
struct trap *t;
struct monst *mtmp;
/* obj is an object dropped on an altar */
void
-doaltarobj(obj)
-register struct obj *obj;
+doaltarobj(struct obj *obj)
{
if (Blind)
return;
}
static void
-trycall(obj)
-register struct obj *obj;
+trycall(struct obj *obj)
{
if (!objects[obj->otyp].oc_name_known && !objects[obj->otyp].oc_uname)
docall(obj);
/* Transforms the sink at the player's position into
a fountain, throne, altar or grave. */
static void
-polymorph_sink()
+polymorph_sink(void)
{
uchar sym = S_sink;
boolean sinklooted;
/* Teleports the sink at the player's position;
return True if sink teleported. */
static boolean
-teleport_sink()
+teleport_sink(void)
{
int cx, cy;
int cnt = 0;
/* obj is a ring being dropped over a kitchen sink */
static void
-dosinkring(obj)
-register struct obj *obj;
+dosinkring(struct obj *obj)
{
struct obj *otmp, *otmp2;
boolean ideed = TRUE;
/* some common tests when trying to drop or throw items */
boolean
-canletgo(obj, word)
-struct obj *obj;
-const char *word;
+canletgo(struct obj *obj, const char *word)
{
if (obj->owornmask & (W_ARMOR | W_ACCESSORY)) {
if (*word)
}
static int
-drop(obj)
-register struct obj *obj;
+drop(struct obj *obj)
{
if (!obj)
return 0;
called in several places - may produce output
(eg ship_object() and dropy() -> sellobj() both produce output) */
void
-dropx(obj)
-register struct obj *obj;
+dropx(struct obj *obj)
{
freeinv(obj);
if (!u.uswallow) {
/* dropy - put dropped object at destination; called from lots of places */
void
-dropy(obj)
-struct obj *obj;
+dropy(struct obj *obj)
{
dropz(obj, FALSE);
}
/* dropz - really put dropped object at its destination... */
void
-dropz(obj, with_impact)
-struct obj *obj;
-boolean with_impact;
+dropz(struct obj *obj, boolean with_impact)
{
if (obj == uwep)
setuwep((struct obj *) 0);
for purple worm, immediately eat any corpse, glob, or special meat item
from object polymorph; return True if object is used up, False otherwise */
static boolean
-engulfer_digests_food(obj)
-struct obj *obj;
+engulfer_digests_food(struct obj *obj)
{
/* animal swallower (purple worn, trapper, lurker above) eats any
corpse, glob, or meat <item> but not other types of food */
/* things that must change when not held; recurse into containers.
Called for both player and monsters */
void
-obj_no_longer_held(obj)
-struct obj *obj;
+obj_no_longer_held(struct obj *obj)
{
if (!obj) {
return;
/* 'D' command: drop several things */
int
-doddrop()
+doddrop(void)
{
int result = 0;
/* Drop things from the hero's inventory, using a menu. */
static int
-menu_drop(retry)
-int retry;
+menu_drop(int retry)
{
int n, i, n_dropped = 0;
long cnt;
/* the '>' command */
int
-dodown()
+dodown(void)
{
struct trap *trap = 0;
stairway *stway = stairway_at(u.ux, u.uy);
/* the '<' command */
int
-doup()
+doup(void)
{
stairway *stway = stairway_at(u.ux,u.uy);
/* check that we can write out the current level */
static NHFILE *
-currentlevel_rewrite()
+currentlevel_rewrite(void)
{
NHFILE *nhfp;
char whynot[BUFSZ];
#ifdef INSURANCE
void
-save_currentstate()
+save_currentstate(void)
{
NHFILE *nhfp;
/*
static boolean
-badspot(x, y)
-register xchar x, y;
+badspot(register xchar x, register xchar y)
{
return (boolean) ((levl[x][y].typ != ROOM
&& levl[x][y].typ != AIR
/* when arriving on a level, if hero and a monster are trying to share same
spot, move one; extracted from goto_level(); also used by wiz_makemap() */
void
-u_collide_m(mtmp)
-struct monst *mtmp;
+u_collide_m(struct monst *mtmp)
{
coord cc;
}
void
-goto_level(newlevel, at_stairs, falling, portal)
-d_level *newlevel;
-boolean at_stairs, falling, portal;
+goto_level(d_level *newlevel, boolean at_stairs, boolean falling, boolean portal)
{
int l_idx, save_mode;
NHFILE *nhfp;
/* usually called from goto_level(); might be called from Sting_effects() */
void
-maybe_lvltport_feedback()
+maybe_lvltport_feedback(void)
{
if (g.dfr_post_msg && !strncmpi(g.dfr_post_msg, "You materialize", 15)) {
/* "You materialize on a different level." */
}
static void
-final_level()
+final_level(void)
{
struct monst *mtmp;
/* change levels at the end of this turn, after monsters finish moving */
void
-schedule_goto(tolev, utotype_flags, pre_msg, post_msg)
-d_level *tolev;
-int utotype_flags;
-const char *pre_msg, *post_msg;
+schedule_goto(d_level *tolev, int utotype_flags,
+ const char *pre_msg, const char *post_msg)
{
/* UTOTYPE_DEFERRED is used, so UTOTYPE_NONE can trigger deferred_goto() */
u.utotype = utotype_flags | UTOTYPE_DEFERRED;
/* handle something like portal ejection */
void
-deferred_goto()
+deferred_goto(void)
{
if (!on_level(&u.uz, &u.utolev)) {
d_level dest, oldlev;
* corpse is gone.
*/
boolean
-revive_corpse(corpse)
-struct obj *corpse;
+revive_corpse(struct obj *corpse)
{
struct monst *mtmp, *mcarry;
boolean is_uwep, chewed;
/* Revive the corpse via a timeout. */
/*ARGSUSED*/
void
-revive_mon(arg, timeout)
-anything *arg;
-long timeout UNUSED;
+revive_mon(anything *arg, long timeout UNUSED)
{
struct obj *body = arg->a_obj;
struct permonst *mptr = &mons[body->corpsenm];
/* Timeout callback. Revive the corpse as a zombie. */
/*ARGSUSED*/
void
-zombify_mon(arg, timeout)
-anything *arg;
-long timeout UNUSED;
+zombify_mon(anything *arg, long timeout UNUSED)
{
struct obj *body = arg->a_obj;
int zmon = zombie_form(&mons[body->corpsenm]);
}
boolean
-cmd_safety_prevention(cmddesc, act, flagcounter)
-const char *cmddesc;
-const char *act;
-int *flagcounter;
+cmd_safety_prevention(const char *cmddesc, const char *act, int *flagcounter)
{
if (flags.safe_wait && !iflags.menu_requested
&& !g.multi && monster_nearby()) {
/* '.' command: do nothing == rest; also the
' ' command iff 'rest_on_space' option is On */
int
-donull()
+donull(void)
{
if (cmd_safety_prevention("a no-op (to rest)",
"Are you waiting to get hit?",
}
static int
-wipeoff(VOID_ARGS)
+wipeoff(void)
{
if (u.ucreamed < 4)
u.ucreamed = 0;
}
int
-dowipe()
+dowipe(void)
{
if (u.ucreamed) {
static NEARDATA char buf[39];
/* common wounded legs feedback */
void
-legs_in_no_shape(for_what, by_steed)
-const char *for_what; /* jumping, kicking, riding */
-boolean by_steed;
+legs_in_no_shape(const char *for_what, /* jumping, kicking, riding */
+ boolean by_steed)
{
if (by_steed && u.usteed) {
pline("%s is in no shape for %s.", Monnam(u.usteed), for_what);
}
void
-set_wounded_legs(side, timex)
-long side;
-int timex;
+set_wounded_legs(long side, int timex)
{
/* KMH -- STEED
* If you are riding, your steed gets the wounded legs instead.
}
void
-heal_legs(how)
-int how; /* 0: ordinary, 1: dismounting steed, 2: limbs turn to stone */
+heal_legs(int how) /* 0: ordinary, 1: dismounting steed,
+ 2: limbs turn to stone */
{
if (Wounded_legs) {
g.context.botl = 1;
#include "hack.h"
-static char *NDECL(nextmbuf);
-static void FDECL(getpos_help_keyxhelp, (winid, const char *,
- const char *, int));
-static void FDECL(getpos_help, (BOOLEAN_P, const char *));
-static int FDECL(CFDECLSPEC cmp_coord_distu, (const void *, const void *));
-static int FDECL(gloc_filter_classify_glyph, (int));
-static int FDECL(gloc_filter_floodfill_matcharea, (int, int));
-static void FDECL(gloc_filter_floodfill, (int, int));
-static void NDECL(gloc_filter_init);
-static void NDECL(gloc_filter_done);
-static boolean FDECL(gather_locs_interesting, (int, int, int));
-static void FDECL(gather_locs, (coord **, int *, int));
-static void FDECL(auto_describe, (int, int));
-static void NDECL(do_mgivenname);
-static boolean FDECL(alreadynamed, (struct monst *, char *, char *));
-static void FDECL(do_oname, (struct obj *));
-static int FDECL(name_ok, (struct obj *));
-static int FDECL(call_ok, (struct obj *));
-static char *FDECL(docall_xname, (struct obj *));
-static void NDECL(namefloorobj);
+static char *nextmbuf(void);
+static void getpos_help_keyxhelp(winid, const char *, const char *, int);
+static void getpos_help(boolean, const char *);
+static int CFDECLSPEC cmp_coord_distu(const void *, const void *);
+static int gloc_filter_classify_glyph(int);
+static int gloc_filter_floodfill_matcharea(int, int);
+static void gloc_filter_floodfill(int, int);
+static void gloc_filter_init(void);
+static void gloc_filter_done(void);
+static boolean gather_locs_interesting(int, int, int);
+static void gather_locs(coord **, int *, int);
+static void auto_describe(int, int);
+static void do_mgivenname(void);
+static boolean alreadynamed(struct monst *, char *, char *);
+static void do_oname(struct obj *);
+static int name_ok(struct obj *);
+static int call_ok(struct obj *);
+static char *docall_xname(struct obj *);
+static void namefloorobj(void);
extern const char what_is_an_unknown_object[]; /* from pager.c */
/* manage a pool of BUFSZ buffers, so callers don't have to */
static char *
-nextmbuf()
+nextmbuf(void)
{
static char NEARDATA bufs[NUMMBUF][BUFSZ];
static int bufidx = 0;
/* function for getpos() to highlight desired map locations.
* parameter value 0 = initialize, 1 = highlight, 2 = done
*/
-static void FDECL((*getpos_hilitefunc), (int)) = (void FDECL((*), (int))) 0;
-static boolean FDECL((*getpos_getvalid), (int, int)) =
- (boolean FDECL((*), (int, int))) 0;
+static void (*getpos_hilitefunc)(int) = (void (*)(int)) 0;
+static boolean (*getpos_getvalid)(int, int) = (boolean (*)(int, int)) 0;
void
-getpos_sethilite(gp_hilitef, gp_getvalidf)
-void FDECL((*gp_hilitef), (int));
-boolean FDECL((*gp_getvalidf), (int, int));
+getpos_sethilite(void (*gp_hilitef)(int), boolean (*gp_getvalidf)(int, int))
{
getpos_hilitefunc = gp_hilitef;
getpos_getvalid = gp_getvalidf;
};
static void
-getpos_help_keyxhelp(tmpwin, k1, k2, gloc)
-winid tmpwin;
-const char *k1;
-const char *k2;
-int gloc;
+getpos_help_keyxhelp(winid tmpwin, const char *k1, const char *k2, int gloc)
{
char sbuf[BUFSZ], fbuf[QBUFSZ];
const char *move_cursor_to = "move the cursor to ",
/* the response for '?' help request in getpos() */
static void
-getpos_help(force, goal)
-boolean force;
-const char *goal;
+getpos_help(boolean force, const char *goal)
{
static const char *const fastmovemode[2] = { "8 units at a time",
"skipping same glyphs" };
}
static int
-cmp_coord_distu(a, b)
-const void *a;
-const void *b;
+cmp_coord_distu(const void *a, const void *b)
{
const coord *c1 = a;
const coord *c2 = b;
&& (selection_getpoint((x),(y), g.gloc_filter_map)))
static int
-gloc_filter_classify_glyph(glyph)
-int glyph;
+gloc_filter_classify_glyph(int glyph)
{
int c;
}
static int
-gloc_filter_floodfill_matcharea(x, y)
-int x, y;
+gloc_filter_floodfill_matcharea(int x, int y)
{
int glyph = back_to_glyph(x, y);
}
static void
-gloc_filter_floodfill(x, y)
-int x, y;
+gloc_filter_floodfill(int x, int y)
{
g.gloc_filter_floodfill_match_glyph = back_to_glyph(x, y);
}
static void
-gloc_filter_init()
+gloc_filter_init(void)
{
if (iflags.getloc_filter == GFILTER_AREA) {
if (!g.gloc_filter_map) {
}
static void
-gloc_filter_done()
+gloc_filter_done(void)
{
if (g.gloc_filter_map) {
selection_free(g.gloc_filter_map, TRUE);
}
static boolean
-gather_locs_interesting(x, y, gloc)
-int x, y, gloc;
+gather_locs_interesting(int x, int y, int gloc)
{
int glyph, sym;
/* gather locations for monsters or objects shown on the map */
static void
-gather_locs(arr_p, cnt_p, gloc)
-coord **arr_p;
-int *cnt_p;
-int gloc;
+gather_locs(coord **arr_p, int *cnt_p, int gloc)
{
int x, y, pass, idx;
}
char *
-dxdy_to_dist_descr(dx, dy, fulldir)
-int dx, dy;
-boolean fulldir;
+dxdy_to_dist_descr(int dx, int dy, boolean fulldir)
{
static char buf[30];
int dst;
/* coordinate formatting for 'whatis_coord' option */
char *
-coord_desc(x, y, outbuf, cmode)
-int x, y;
-char *outbuf, cmode;
+coord_desc(int x, int y, char *outbuf, char cmode)
{
static char screen_fmt[16]; /* [12] suffices: "[%02d,%02d]" */
int dx, dy;
}
static void
-auto_describe(cx, cy)
-int cx, cy;
+auto_describe(int cx, int cy)
{
coord cc;
int sym = 0;
}
boolean
-getpos_menu(ccp, gloc)
-coord *ccp;
-int gloc;
+getpos_menu(coord *ccp, int gloc)
{
coord *garr = DUMMY;
int gcount = 0;
}
int
-getpos(ccp, force, goal)
-coord *ccp;
-boolean force;
-const char *goal;
+getpos(coord *ccp, boolean force, const char *goal)
{
const char *cp;
static struct {
for (i = 0; i < NUM_GLOCS; i++)
if (garr[i])
free((genericptr_t) garr[i]);
- getpos_hilitefunc = (void FDECL((*), (int))) 0;
- getpos_getvalid = (boolean FDECL((*), (int, int))) 0;
+ getpos_hilitefunc = (void (*)(int)) 0;
+ getpos_getvalid = (boolean (*)(int, int)) 0;
return result;
}
/* allocate space for a monster's name; removes old name if there is one */
void
-new_mgivenname(mon, lth)
-struct monst *mon;
-int lth; /* desired length (caller handles adding 1 for terminator) */
+new_mgivenname(struct monst *mon,
+ int lth) /* desired length (caller handles adding 1
+ for terminator) */
{
if (lth) {
/* allocate mextra if necessary; otherwise get rid of old name */
/* release a monster's name; retains mextra even if all fields are now null */
void
-free_mgivenname(mon)
-struct monst *mon;
+free_mgivenname(struct monst *mon)
{
if (has_mgivenname(mon)) {
free((genericptr_t) MGIVENNAME(mon));
/* allocate space for an object's name; removes old name if there is one */
void
-new_oname(obj, lth)
-struct obj *obj;
-int lth; /* desired length (caller handles adding 1 for terminator) */
+new_oname(struct obj *obj,
+ int lth) /* desired length (caller handles adding 1
+ for terminator) */
{
if (lth) {
/* allocate oextra if necessary; otherwise get rid of old name */
/* release an object's name; retains oextra even if all fields are now null */
void
-free_oname(obj)
-struct obj *obj;
+free_oname(struct obj *obj)
{
if (has_oname(obj)) {
free((genericptr_t) ONAME(obj));
* if it doesn't.
*/
const char *
-safe_oname(obj)
-struct obj *obj;
+safe_oname(struct obj *obj)
{
if (has_oname(obj))
return ONAME(obj);
/* historical note: this returns a monster pointer because it used to
allocate a new bigger block of memory to hold the monster and its name */
struct monst *
-christen_monst(mtmp, name)
-struct monst *mtmp;
-const char *name;
+christen_monst(struct monst *mtmp, const char *name)
{
int lth;
char buf[PL_PSIZ];
/* check whether user-supplied name matches or nearly matches an unnameable
monster's name; if so, give an alternate reject message for do_mgivenname() */
static boolean
-alreadynamed(mtmp, monnambuf, usrbuf)
-struct monst *mtmp;
-char *monnambuf, *usrbuf;
+alreadynamed(struct monst *mtmp, char *monnambuf, char *usrbuf)
{
char pronounbuf[10], *p;
/* allow player to assign a name to some chosen monster */
static void
-do_mgivenname()
+do_mgivenname(void)
{
char buf[BUFSZ], monnambuf[BUFSZ], qbuf[QBUFSZ];
coord cc;
* used with extreme care. Applying a name to an object no longer
* allocates a replacement object, so that old risk is gone.
*/
-static
-void
-do_oname(obj)
-register struct obj *obj;
+static void
+do_oname(register struct obj *obj)
{
char *bufp, buf[BUFSZ], bufcpy[BUFSZ], qbuf[QBUFSZ];
const char *aname;
}
struct obj *
-oname(obj, name)
-struct obj *obj;
-const char *name;
+oname(struct obj *obj, const char *name)
{
int lth;
char buf[PL_PSIZ];
}
boolean
-objtyp_is_callable(i)
-int i;
+objtyp_is_callable(int i)
{
if (objects[i].oc_uname)
return TRUE;
/* getobj callback for object to name (specific item) - anything but gold */
static int
-name_ok(obj)
-struct obj *obj;
+name_ok(struct obj *obj)
{
if (!obj || obj->oclass == COIN_CLASS)
return GETOBJ_EXCLUDE;
/* getobj callback for object to call (name its type) */
static int
-call_ok(obj)
-struct obj *obj;
+call_ok(struct obj *obj)
{
if (!obj || !objtyp_is_callable(obj->otyp))
return GETOBJ_EXCLUDE;
/* C and #name commands - player can name monster or object or type of obj */
int
-docallcmd()
+docallcmd(void)
{
struct obj *obj;
winid win;
/* for use by safe_qbuf() */
static char *
-docall_xname(obj)
-struct obj *obj;
+docall_xname(struct obj *obj)
{
struct obj otemp;
}
void
-docall(obj)
-struct obj *obj;
+docall(struct obj *obj)
{
char buf[BUFSZ], qbuf[QBUFSZ];
char **str1;
}
static void
-namefloorobj()
+namefloorobj(void)
{
coord cc;
int glyph;
/* ghost names formerly set by x_monnam(), now by makemon() instead */
const char *
-rndghostname()
+rndghostname(void)
{
return rn2(7) ? ghostnames[rn2(SIZE(ghostnames))] : (const char *) g.plname;
}
* article newt art xan art invisible orc art dog
*/
-/* Bug: if the monster is a priest or shopkeeper, not every one of these
- * options works, since those are special cases.
- */
-char *
-x_monnam(mtmp, article, adjective, suppress, called)
-register struct monst *mtmp;
-int article;
-/* ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious
+/*
+ * article
+ *
+ * ARTICLE_NONE, ARTICLE_THE, ARTICLE_A: obvious
* ARTICLE_YOUR: "your" on pets, "the" on everything else
*
* If the monster would be referred to as "it" or if the monster has a name
* _and_ there is no adjective, "invisible", "saddled", etc., override this
* and always use no article.
- */
-const char *adjective;
-int suppress;
-/* SUPPRESS_IT, SUPPRESS_INVISIBLE, SUPPRESS_HALLUCINATION, SUPPRESS_SADDLE.
+ *
+ * suppress
+ *
+ * SUPPRESS_IT, SUPPRESS_INVISIBLE, SUPPRESS_HALLUCINATION, SUPPRESS_SADDLE.
* EXACT_NAME: combination of all the above
* SUPPRESS_NAME: omit monster's assigned name (unless uniq w/ pname).
+ *
+ * Bug: if the monster is a priest or shopkeeper, not every one of these
+ * options works, since those are special cases.
*/
-boolean called;
+char *
+x_monnam(register struct monst *mtmp, int article,
+ const char *adjective, int suppress, boolean called)
{
char *buf = nextmbuf();
struct permonst *mdat = mtmp->data;
}
char *
-l_monnam(mtmp)
-struct monst *mtmp;
+l_monnam(struct monst *mtmp)
{
return x_monnam(mtmp, ARTICLE_NONE, (char *) 0,
(has_mgivenname(mtmp)) ? SUPPRESS_SADDLE : 0, TRUE);
}
char *
-mon_nam(mtmp)
-struct monst *mtmp;
+mon_nam(struct monst *mtmp)
{
return x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mgivenname(mtmp)) ? SUPPRESS_SADDLE : 0, FALSE);
* the player with a cursed potion of invisibility
*/
char *
-noit_mon_nam(mtmp)
-struct monst *mtmp;
+noit_mon_nam(struct monst *mtmp)
{
return x_monnam(mtmp, ARTICLE_THE, (char *) 0,
(has_mgivenname(mtmp)) ? (SUPPRESS_SADDLE | SUPPRESS_IT)
}
char *
-Monnam(mtmp)
-struct monst *mtmp;
+Monnam(struct monst *mtmp)
{
register char *bp = mon_nam(mtmp);
}
char *
-noit_Monnam(mtmp)
-struct monst *mtmp;
+noit_Monnam(struct monst *mtmp)
{
register char *bp = noit_mon_nam(mtmp);
/* return "a dog" rather than "Fido", honoring hallucination and visibility */
char *
-noname_monnam(mtmp, article)
-struct monst *mtmp;
-int article;
+noname_monnam(struct monst *mtmp, int article)
{
return x_monnam(mtmp, article, (char *) 0, SUPPRESS_NAME, FALSE);
}
/* monster's own name -- overrides hallucination and [in]visibility
so shouldn't be used in ordinary messages (mainly for disclosure) */
char *
-m_monnam(mtmp)
-struct monst *mtmp;
+m_monnam(struct monst *mtmp)
{
return x_monnam(mtmp, ARTICLE_NONE, (char *) 0, EXACT_NAME, FALSE);
}
/* pet name: "your little dog" */
char *
-y_monnam(mtmp)
-struct monst *mtmp;
+y_monnam(struct monst *mtmp)
{
int prefix, suppression_flag;
}
char *
-Adjmonnam(mtmp, adj)
-struct monst *mtmp;
-const char *adj;
+Adjmonnam(struct monst *mtmp, const char *adj)
{
char *bp = x_monnam(mtmp, ARTICLE_THE, adj,
has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE);
}
char *
-a_monnam(mtmp)
-struct monst *mtmp;
+a_monnam(struct monst *mtmp)
{
return x_monnam(mtmp, ARTICLE_A, (char *) 0,
has_mgivenname(mtmp) ? SUPPRESS_SADDLE : 0, FALSE);
}
char *
-Amonnam(mtmp)
-struct monst *mtmp;
+Amonnam(struct monst *mtmp)
{
char *bp = a_monnam(mtmp);
/* used for monster ID by the '/', ';', and 'C' commands to block remote
identification of the endgame altars via their attending priests */
char *
-distant_monnam(mon, article, outbuf)
-struct monst *mon;
-int article; /* only ARTICLE_NONE and ARTICLE_THE are handled here */
-char *outbuf;
+distant_monnam(struct monst *mon,
+ int article, /* only ARTICLE_NONE and ARTICLE_THE
+ are handled here */
+ char *outbuf)
{
/* high priest(ess)'s identity is concealed on the Astral Plane,
unless you're adjacent (overridden for hallucination which does
/* returns mon_nam(mon) relative to other_mon; normal name unless they're
the same, in which case the reference is to {him|her|it} self */
char *
-mon_nam_too(mon, other_mon)
-struct monst *mon, *other_mon;
+mon_nam_too(struct monst *mon, struct monst *other_mon)
{
char *outbuf;
/* construct "<monnamtext> <verb> <othertext> {him|her|it}self" which might
be distorted by Hallu; if that's plural, adjust monnamtext and verb */
char *
-monverbself(mon, monnamtext, verb, othertext)
-struct monst *mon;
-char *monnamtext; /* modifiable 'mbuf' with adequare room at end */
-const char *verb, *othertext;
+monverbself(struct monst *mon,
+ char *monnamtext, /* modifiable 'mbuf' with adequare room at end */
+ const char *verb, const char *othertext)
{
char *verbs, selfbuf[40]; /* sizeof "themselves" suffices */
/* for debugging messages, where data might be suspect and we aren't
taking what the hero does or doesn't know into consideration */
char *
-minimal_monnam(mon, ckloc)
-struct monst *mon;
-boolean ckloc;
+minimal_monnam(struct monst *mon, boolean ckloc)
{
struct permonst *ptr;
char *outbuf = nextmbuf();
#ifndef PMNAME_MACROS
int
-Mgender(mtmp)
-struct monst *mtmp;
+Mgender(struct monst *mtmp)
{
int mgender = MALE;
}
const char *
-pmname(pm, mgender)
-struct permonst *pm;
-int mgender;
+pmname(struct permonst *pm, int mgender)
{
if ((mgender >= MALE && mgender < NUM_MGENDERS) && pm->pmnames[mgender])
return pm->pmnames[mgender];
/* fake monsters used to be in a hard-coded array, now in a data file */
char *
-bogusmon(buf, code)
-char *buf, *code;
+bogusmon(char *buf, char *code)
{
static const char bogon_codes[] = "-_+|="; /* see dat/bonusmon.txt */
char *mnam = buf;
/* return a random monster name, for hallucination */
char *
-rndmonnam(code)
-char *code;
+rndmonnam(char *code)
{
static char buf[BUFSZ];
char *mnam;
/* check bogusmon prefix to decide whether it's a personal name */
boolean
-bogon_is_pname(code)
-char code;
+bogon_is_pname(char code)
{
if (!code)
return FALSE;
/* name of a Rogue player */
const char *
-roguename()
+roguename(void)
{
char *i, *opts;
};
const char *
-hcolor(colorpref)
-const char *colorpref;
+hcolor(const char *colorpref)
{
return (Hallucination || !colorpref)
? hcolors[rn2_on_display_rng(SIZE(hcolors))]
/* return a random real color unless hallucinating */
const char *
-rndcolor()
+rndcolor(void)
{
int k = rn2(CLR_MAX);
/* if hallucinating, return a random liquid instead of 'liquidpref' */
const char *
-hliquid(liquidpref)
-const char *liquidpref; /* use as-is when not hallucinating (unless empty) */
+hliquid(const char *liquidpref) /* use as-is when not hallucinating (unless empty) */
{
if (Hallucination || !liquidpref || !*liquidpref) {
int indx, count = SIZE(hliquids);
};
char *
-coyotename(mtmp, buf)
-struct monst *mtmp;
-char *buf;
+coyotename(struct monst *mtmp, char *buf)
{
if (mtmp && buf) {
Sprintf(buf, "%s - %s",
}
char *
-rndorcname(s)
-char *s;
+rndorcname(char *s)
{
static const char *v[] = { "a", "ai", "og", "u" };
static const char *snd[] = { "gor", "gris", "un", "bane", "ruk",
}
struct monst *
-christen_orc(mtmp, gang, other)
-struct monst *mtmp;
-const char *gang, *other;
+christen_orc(struct monst *mtmp, const char *gang, const char *other)
{
int sz = 0;
char buf[BUFSZ], buf2[BUFSZ], *orcname;
};
const char *
-noveltitle(novidx)
-int *novidx;
+noveltitle(int *novidx)
{
int j, k = SIZE(sir_Terry_novels);
}
const char *
-lookup_novel(lookname, idx)
-const char *lookname;
-int *idx;
+lookup_novel(const char *lookname, int *idx)
{
int k;
WORN_SHIRT, WORN_BOOTS, W_SWAPWEP, W_QUIVER, 0L
};
-static void FDECL(on_msg, (struct obj *));
-static void FDECL(toggle_stealth, (struct obj *, long, BOOLEAN_P));
-static int NDECL(Armor_on);
-/* int NDECL(Boots_on); -- moved to extern.h */
-static int NDECL(Cloak_on);
-static int NDECL(Helmet_on);
-static int NDECL(Gloves_on);
-static void FDECL(wielding_corpse, (struct obj *, BOOLEAN_P));
-static int NDECL(Shield_on);
-static int NDECL(Shirt_on);
-static void NDECL(Amulet_on);
-static void FDECL(learnring, (struct obj *, BOOLEAN_P));
-static void FDECL(Ring_off_or_gone, (struct obj *, BOOLEAN_P));
-static int FDECL(select_off, (struct obj *));
-static struct obj *NDECL(do_takeoff);
-static int NDECL(take_off);
-static int FDECL(menu_remarm, (int));
-static void FDECL(count_worn_stuff, (struct obj **, BOOLEAN_P));
-static int FDECL(armor_or_accessory_off, (struct obj *));
-static int FDECL(accessory_or_armor_on, (struct obj *));
-static void FDECL(already_wearing, (const char *));
-static void FDECL(already_wearing2, (const char *, const char *));
-static int FDECL(equip_ok, (struct obj *, BOOLEAN_P, BOOLEAN_P));
-static int FDECL(puton_ok, (struct obj *));
-static int FDECL(remove_ok, (struct obj *));
-static int FDECL(wear_ok, (struct obj *));
-static int FDECL(takeoff_ok, (struct obj *));
+static void on_msg(struct obj *);
+static void toggle_stealth(struct obj *, long, boolean);
+static int Armor_on(void);
+/* int Boots_on(void); -- moved to extern.h */
+static int Cloak_on(void);
+static int Helmet_on(void);
+static int Gloves_on(void);
+static void wielding_corpse(struct obj *, boolean);
+static int Shield_on(void);
+static int Shirt_on(void);
+static void Amulet_on(void);
+static void learnring(struct obj *, boolean);
+static void Ring_off_or_gone(struct obj *, boolean);
+static int select_off(struct obj *);
+static struct obj *do_takeoff(void);
+static int take_off(void);
+static int menu_remarm(int);
+static void count_worn_stuff(struct obj **, boolean);
+static int armor_or_accessory_off(struct obj *);
+static int accessory_or_armor_on(struct obj *);
+static void already_wearing(const char *);
+static void already_wearing2(const char *, const char *);
+static int equip_ok(struct obj *, boolean, boolean);
+static int puton_ok(struct obj *);
+static int remove_ok(struct obj *);
+static int wear_ok(struct obj *);
+static int takeoff_ok(struct obj *);
/* plural "fingers" or optionally "gloves" */
const char *
-fingers_or_gloves(check_gloves)
-boolean check_gloves;
+fingers_or_gloves(boolean check_gloves)
{
return ((check_gloves && uarmg)
? gloves_simple_name(uarmg) /* "gloves" or "gauntlets" */
}
void
-off_msg(otmp)
-struct obj *otmp;
+off_msg(struct obj *otmp)
{
if (flags.verbose)
You("were wearing %s.", doname(otmp));
/* for items that involve no delay */
static void
-on_msg(otmp)
-struct obj *otmp;
+on_msg(struct obj *otmp)
{
if (flags.verbose) {
char how[BUFSZ];
give feedback and discover it iff stealth state is changing */
static
void
-toggle_stealth(obj, oldprop, on)
-struct obj *obj;
-long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
-boolean on;
+toggle_stealth(struct obj *obj,
+ long oldprop, /* prop[].extrinsic, with obj->owornmask
+ stripped by caller */
+ boolean on)
{
if (on ? g.initial_don : g.context.takeoff.cancelled_don)
return;
hero is able to see self (or sense monsters); for timed, 'obj' is Null
and this is only called for the message */
void
-toggle_displacement(obj, oldprop, on)
-struct obj *obj;
-long oldprop; /* prop[].extrinsic, with obj->owornmask stripped by caller */
-boolean on;
+toggle_displacement(struct obj *obj,
+ long oldprop, /* prop[].extrinsic, with obj->owornmask
+ stripped by caller */
+ boolean on)
{
if (on ? g.initial_don : g.context.takeoff.cancelled_don)
return;
*/
int
-Boots_on(VOID_ARGS)
+Boots_on(void)
{
long oldprop =
u.uprops[objects[uarmf->otyp].oc_oprop].extrinsic & ~WORN_BOOTS;
}
int
-Boots_off(VOID_ARGS)
+Boots_off(void)
{
struct obj *otmp = uarmf;
int otyp = otmp->otyp;
}
static int
-Cloak_on(VOID_ARGS)
+Cloak_on(void)
{
long oldprop =
u.uprops[objects[uarmc->otyp].oc_oprop].extrinsic & ~WORN_CLOAK;
}
int
-Cloak_off(VOID_ARGS)
+Cloak_off(void)
{
struct obj *otmp = uarmc;
int otyp = otmp->otyp;
return 0;
}
-static
-int
-Helmet_on(VOID_ARGS)
+static int
+Helmet_on(void)
{
switch (uarmh->otyp) {
case FEDORA:
}
int
-Helmet_off(VOID_ARGS)
+Helmet_off(void)
{
g.context.takeoff.mask &= ~W_ARMH;
return 0;
}
-static
-int
-Gloves_on(VOID_ARGS)
+static int
+Gloves_on(void)
{
long oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
}
static void
-wielding_corpse(obj, voluntary)
-struct obj *obj;
-boolean voluntary; /* taking gloves off on purpose? */
+wielding_corpse(struct obj *obj,
+ boolean voluntary) /* taking gloves off on purpose? */
{
char kbuf[BUFSZ];
}
int
-Gloves_off(VOID_ARGS)
+Gloves_off(void)
{
long oldprop =
u.uprops[objects[uarmg->otyp].oc_oprop].extrinsic & ~WORN_GLOVES;
}
static int
-Shield_on(VOID_ARGS)
+Shield_on(void)
{
/* no shield currently requires special handling when put on, but we
keep this uncommented in case somebody adds a new one which does
}
int
-Shield_off(VOID_ARGS)
+Shield_off(void)
{
g.context.takeoff.mask &= ~W_ARMS;
}
static int
-Shirt_on(VOID_ARGS)
+Shirt_on(void)
{
/* no shirt currently requires special handling when put on, but we
keep this uncommented in case somebody adds a new one which does */
}
int
-Shirt_off(VOID_ARGS)
+Shirt_off(void)
{
g.context.takeoff.mask &= ~W_ARMU;
return 0;
}
-static
-int
-Armor_on(VOID_ARGS)
+static int
+Armor_on(void)
{
/*
* No suits require special handling. Special properties conferred by
}
int
-Armor_off(VOID_ARGS)
+Armor_off(void)
{
g.context.takeoff.mask &= ~W_ARM;
setworn((struct obj *) 0, W_ARM);
* repeating.]
*/
int
-Armor_gone()
+Armor_gone(void)
{
g.context.takeoff.mask &= ~W_ARM;
setnotworn(uarm);
}
static void
-Amulet_on()
+Amulet_on(void)
{
/* make sure amulet isn't wielded; can't use remove_worn_item()
here because it has already been set worn in amulet slot */
}
void
-Amulet_off()
+Amulet_off(void)
{
g.context.takeoff.mask &= ~W_AMUL;
/* handle ring discovery; comparable to learnwand() */
static void
-learnring(ring, observed)
-struct obj *ring;
-boolean observed;
+learnring(struct obj *ring, boolean observed)
{
int ringtype = ring->otyp;
}
void
-Ring_on(obj)
-register struct obj *obj;
+Ring_on(register struct obj *obj)
{
long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
int old_attrib, which;
}
static void
-Ring_off_or_gone(obj, gone)
-register struct obj *obj;
-boolean gone;
+Ring_off_or_gone(register struct obj *obj, boolean gone)
{
long mask = (obj->owornmask & W_RING);
int old_attrib, which;
}
void
-Ring_off(obj)
-struct obj *obj;
+Ring_off(struct obj *obj)
{
Ring_off_or_gone(obj, FALSE);
}
void
-Ring_gone(obj)
-struct obj *obj;
+Ring_gone(struct obj *obj)
{
Ring_off_or_gone(obj, TRUE);
}
void
-Blindf_on(otmp)
-struct obj *otmp;
+Blindf_on(struct obj *otmp)
{
boolean already_blind = Blind, changed = FALSE;
}
void
-Blindf_off(otmp)
-struct obj *otmp;
+Blindf_off(struct obj *otmp)
{
boolean was_blind = Blind, changed = FALSE,
nooffmsg = !otmp;
/* called in moveloop()'s prologue to set side-effects of worn start-up items;
also used by poly_obj() when a worn item gets transformed */
void
-set_wear(obj)
-struct obj *obj; /* if null, do all worn items; otherwise just obj itself */
+set_wear(struct obj *obj) /* if null, do all worn items;
+ otherwise just obj itself */
{
g.initial_don = !obj;
/* check whether the target object is currently being put on (or taken off--
also checks for doffing--[why?]) */
boolean
-donning(otmp)
-struct obj *otmp;
+donning(struct obj *otmp)
{
boolean result = FALSE;
so that stop_donning() and steal() can vary messages and doname()
can vary "(being worn)" suffix */
boolean
-doffing(otmp)
-struct obj *otmp;
+doffing(struct obj *otmp)
{
long what = g.context.takeoff.what;
boolean result = FALSE;
/* despite their names, cancel_don() and cancel_doff() both apply to both
donning and doffing... */
void
-cancel_doff(obj, slotmask)
-struct obj *obj;
-long slotmask;
+cancel_doff(struct obj *obj, long slotmask)
{
/* Called by setworn() for old item in specified slot or by setnotworn()
* for specified item. We don't want to call cancel_don() if we got
/* despite their names, cancel_don() and cancel_doff() both apply to both
donning and doffing... */
void
-cancel_don()
+cancel_don(void)
{
/* the piece of armor we were donning/doffing has vanished, so stop
* wasting time on it (and don't dereference it when donning would
g.context.takeoff.cancelled_don =
(g.afternmv == Boots_on || g.afternmv == Helmet_on
|| g.afternmv == Gloves_on || g.afternmv == Armor_on);
- g.afternmv = (int NDECL((*))) 0;
+ g.afternmv = (int (*)(void)) 0;
g.nomovemsg = (char *) 0;
g.multi = 0;
g.context.takeoff.delay = 0;
/* called by steal() during theft from hero; interrupt donning/doffing */
int
-stop_donning(stolenobj)
-struct obj *stolenobj; /* no message if stolenobj is already being doffing */
+stop_donning(struct obj *stolenobj) /* no message if stolenobj is already
+ being doffing */
{
char buf[BUFSZ];
struct obj *otmp;
cancel_don();
/* don't want <armor>_on() or <armor>_off() being called
by unmul() since the on or off action isn't completing */
- g.afternmv = (int NDECL((*))) 0;
+ g.afternmv = (int (*)(void)) 0;
if (putting_on || otmp != stolenobj) {
Sprintf(buf, "You stop %s %s.",
putting_on ? "putting on" : "taking off",
/* assign values to Narmorpieces and Naccessories */
static void
-count_worn_stuff(which, accessorizing)
-struct obj **which; /* caller wants this when count is 1 */
-boolean accessorizing;
+count_worn_stuff(struct obj **which, /* caller wants this when count is 1 */
+ boolean accessorizing)
{
struct obj *otmp;
/* take off one piece or armor or one accessory;
shared by dotakeoff('T') and doremring('R') */
static int
-armor_or_accessory_off(obj)
-struct obj *obj;
+armor_or_accessory_off(struct obj *obj)
{
if (!(obj->owornmask & (W_ARMOR | W_ACCESSORY))) {
You("are not wearing that.");
/* the 'T' command */
int
-dotakeoff()
+dotakeoff(void)
{
struct obj *otmp = (struct obj *) 0;
/* the 'R' command */
int
-doremring()
+doremring(void)
{
struct obj *otmp = 0;
/* Check if something worn is cursed _and_ unremovable. */
int
-cursed(otmp)
-struct obj *otmp;
+cursed(struct obj *otmp)
{
if (!otmp) {
impossible("cursed without otmp");
}
int
-armoroff(otmp)
-struct obj *otmp;
+armoroff(struct obj *otmp)
{
static char offdelaybuf[60];
int delay = -objects[otmp->otyp].oc_delay;
}
static void
-already_wearing(cc)
-const char *cc;
+already_wearing(const char *cc)
{
You("are already wearing %s%c", cc, (cc == c_that_) ? '!' : '.');
}
static void
-already_wearing2(cc1, cc2)
-const char *cc1, *cc2;
+already_wearing2(const char *cc1, const char *cc2)
{
You_cant("wear %s because you're wearing %s there already.", cc1, cc2);
}
* output: mask (otmp's armor type)
*/
int
-canwearobj(otmp, mask, noisy)
-struct obj *otmp;
-long *mask;
-boolean noisy;
+canwearobj(struct obj *otmp, long *mask, boolean noisy)
{
int err = 0;
const char *which;
}
static int
-accessory_or_armor_on(obj)
-struct obj *obj;
+accessory_or_armor_on(struct obj *obj)
{
long mask = 0L;
boolean armor, ring, eyewear;
/* the 'W' command */
int
-dowear()
+dowear(void)
{
struct obj *otmp;
/* the 'P' command */
int
-doputon()
+doputon(void)
{
struct obj *otmp;
/* calculate current armor class */
void
-find_ac()
+find_ac(void)
{
int uac = mons[u.umonnum].ac; /* base armor class for current form */
}
void
-glibr()
+glibr(void)
{
register struct obj *otmp;
int xfl = 0;
}
struct obj *
-some_armor(victim)
-struct monst *victim;
+some_armor(struct monst *victim)
{
register struct obj *otmph, *otmp;
/* used for praying to check and fix levitation trouble */
struct obj *
-stuck_ring(ring, otyp)
-struct obj *ring;
-int otyp;
+stuck_ring(struct obj *ring, int otyp)
{
if (ring != uleft && ring != uright) {
impossible("stuck_ring: neither left nor right?");
/* also for praying; find worn item that confers "Unchanging" attribute */
struct obj *
-unchanger()
+unchanger(void)
{
if (uamul && uamul->otyp == AMULET_OF_UNCHANGING)
return uamul;
static
int
-select_off(otmp)
-register struct obj *otmp;
+select_off(register struct obj *otmp)
{
struct obj *why;
char buf[BUFSZ];
}
static struct obj *
-do_takeoff()
+do_takeoff(void)
{
struct obj *otmp = (struct obj *) 0;
boolean was_twoweap = u.twoweap;
}
/* occupation callback for 'A' */
-static
-int
-take_off(VOID_ARGS)
+static int
+take_off(void)
{
register int i;
register struct obj *otmp;
/* clear saved context to avoid inappropriate resumption of interrupted 'A' */
void
-reset_remarm()
+reset_remarm(void)
{
g.context.takeoff.what = g.context.takeoff.mask = 0L;
g.context.takeoff.disrobing[0] = '\0';
/* the 'A' command -- remove multiple worn items */
int
-doddoremarm()
+doddoremarm(void)
{
int result = 0;
}
static int
-menu_remarm(retry)
-int retry;
+menu_remarm(int retry)
{
int n, i = 0;
menu_item *pick_list;
/* hit by destroy armor scroll/black dragon breath/monster spell */
int
-destroy_arm(atmp)
-register struct obj *atmp;
+destroy_arm(register struct obj *atmp)
{
register struct obj *otmp;
#define DESTROY_ARM(o) \
}
void
-adj_abon(otmp, delta)
-register struct obj *otmp;
-register schar delta;
+adj_abon(register struct obj *otmp, register schar delta)
{
if (uarmg && uarmg == otmp && otmp->otyp == GAUNTLETS_OF_DEXTERITY) {
if (delta) {
used for dipping into liquid and applying grease;
some criteria are different than select_off()'s */
boolean
-inaccessible_equipment(obj, verb, only_if_known_cursed)
-struct obj *obj;
-const char *verb; /* "dip" or "grease", or null to avoid messages */
-boolean only_if_known_cursed; /* ignore covering unless known to be cursed */
+inaccessible_equipment(struct obj *obj,
+ const char *verb, /* "dip" or "grease", or null to
+ avoid messages */
+ boolean only_if_known_cursed) /* ignore covering unless
+ known to be cursed */
{
static NEARDATA const char need_to_take_off_outer_armor[] =
"need to take off %s to %s %s.";
/* not a getobj callback - unifies code among the other four getobj callbacks */
static int
-equip_ok(obj, removing, accessory)
-struct obj *obj;
-boolean removing;
-boolean accessory;
+equip_ok(struct obj *obj, boolean removing, boolean accessory)
{
boolean is_worn;
long dummymask = 0;
/* getobj callback for P command */
static int
-puton_ok(obj)
-struct obj *obj;
+puton_ok(struct obj *obj)
{
return equip_ok(obj, FALSE, TRUE);
}
/* getobj callback for R command */
static int
-remove_ok(obj)
-struct obj *obj;
+remove_ok(struct obj *obj)
{
return equip_ok(obj, TRUE, TRUE);
}
/* getobj callback for W command */
static int
-wear_ok(obj)
-struct obj *obj;
+wear_ok(struct obj *obj)
{
return equip_ok(obj, FALSE, FALSE);
}
/* getobj callback for T command */
static int
-takeoff_ok(obj)
-struct obj *obj;
+takeoff_ok(struct obj *obj)
{
return equip_ok(obj, TRUE, FALSE);
}
#include "hack.h"
-static int NDECL(pet_type);
+static int pet_type(void);
void
-newedog(mtmp)
-struct monst *mtmp;
+newedog(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
}
void
-free_edog(mtmp)
-struct monst *mtmp;
+free_edog(struct monst *mtmp)
{
if (mtmp->mextra && EDOG(mtmp)) {
free((genericptr_t) EDOG(mtmp));
}
void
-initedog(mtmp)
-register struct monst *mtmp;
+initedog(struct monst *mtmp)
{
mtmp->mtame = is_domestic(mtmp->data) ? 10 : 5;
mtmp->mpeaceful = 1;
}
static int
-pet_type()
+pet_type(void)
{
if (g.urole.petnum != NON_PM)
return g.urole.petnum;
}
struct monst *
-make_familiar(otmp, x, y, quietly)
-register struct obj *otmp;
-xchar x, y;
-boolean quietly;
+make_familiar(struct obj *otmp, xchar x, xchar y, boolean quietly)
{
struct permonst *pm;
struct monst *mtmp = 0;
}
struct monst *
-makedog()
+makedog(void)
{
register struct monst *mtmp;
register struct obj *otmp;
/* record `last move time' for all monsters prior to level save so that
mon_arrive() can catch up for lost time when they're restored later */
void
-update_mlstmv()
+update_mlstmv(void)
{
struct monst *mon;
}
void
-losedogs()
+losedogs(void)
{
register struct monst *mtmp, *mtmp0, *mtmp2;
int dismissKops = 0;
/* called from resurrect() in addition to losedogs() */
void
-mon_arrive(mtmp, with_you)
-struct monst *mtmp;
-boolean with_you;
+mon_arrive(struct monst *mtmp, boolean with_you)
{
struct trap *t;
xchar xlocale, ylocale, xyloc, xyflags, wander;
/* heal monster for time spent elsewhere */
void
-mon_catchup_elapsed_time(mtmp, nmv)
-struct monst *mtmp;
-long nmv; /* number of moves */
+mon_catchup_elapsed_time(struct monst *mtmp,
+ long nmv) /* number of moves */
{
int imv = 0; /* avoid zillions of casts and lint warnings */
/* called when you move to another level */
void
-keepdogs(pets_only)
-boolean pets_only; /* true for ascension or final escape */
+keepdogs(boolean pets_only) /* true for ascension or final escape */
{
register struct monst *mtmp, *mtmp2;
register struct obj *obj;
}
void
-migrate_to_level(mtmp, tolev, xyloc, cc)
-register struct monst *mtmp;
-xchar tolev; /* destination level */
-xchar xyloc; /* MIGR_xxx destination xy location: */
-coord *cc; /* optional destination coordinates */
+migrate_to_level(struct monst *mtmp,
+ xchar tolev, /* destination level */
+ xchar xyloc, /* MIGR_xxx destination xy location: */
+ coord *cc) /* optional destination coordinates */
{
struct obj *obj;
d_level new_lev;
/* return quality of food; the lower the better */
/* fungi will eat even tainted food */
int
-dogfood(mon, obj)
-struct monst *mon;
-register struct obj *obj;
+dogfood(struct monst *mon, struct obj *obj)
{
struct permonst *mptr = mon->data, *fptr = 0;
boolean carni = carnivorous(mptr), herbi = herbivorous(mptr),
* succeeded.
*/
boolean
-tamedog(mtmp, obj)
-register struct monst *mtmp;
-register struct obj *obj;
+tamedog(struct monst *mtmp, struct obj *obj)
{
/* The Wiz, Medusa and the quest nemeses aren't even made peaceful. */
if (mtmp->iswiz || mtmp->data == &mons[PM_MEDUSA]
* If the pet wasn't abused and was very tame, it might revive tame.
*/
void
-wary_dog(mtmp, was_dead)
-struct monst *mtmp;
-boolean was_dead;
+wary_dog(struct monst *mtmp, boolean was_dead)
{
struct edog *edog;
boolean quietly = was_dead;
}
void
-abuse_dog(mtmp)
-struct monst *mtmp;
+abuse_dog(struct monst *mtmp)
{
if (!mtmp->mtame)
return;
#include "mfndpos.h"
-static boolean FDECL(dog_hunger, (struct monst *, struct edog *));
-static int FDECL(dog_invent, (struct monst *, struct edog *, int));
-static int FDECL(dog_goal, (struct monst *, struct edog *, int, int, int));
-static struct monst *FDECL(find_targ, (struct monst *, int, int, int));
-static int FDECL(find_friends, (struct monst *, struct monst *, int));
-static struct monst *FDECL(best_target, (struct monst *));
-static long FDECL(score_targ, (struct monst *, struct monst *));
-static boolean FDECL(can_reach_location, (struct monst *, XCHAR_P,
- XCHAR_P, XCHAR_P, XCHAR_P));
-static boolean FDECL(could_reach_item, (struct monst *, XCHAR_P, XCHAR_P));
-static void FDECL(quickmimic, (struct monst *));
+static boolean dog_hunger(struct monst *, struct edog *);
+static int dog_invent(struct monst *, struct edog *, int);
+static int dog_goal(struct monst *, struct edog *, int, int, int);
+static struct monst *find_targ(struct monst *, int, int, int);
+static int find_friends(struct monst *, struct monst *, int);
+static struct monst *best_target(struct monst *);
+static long score_targ(struct monst *, struct monst *);
+static boolean can_reach_location(struct monst *, xchar, xchar, xchar,
+ xchar);
+static boolean could_reach_item(struct monst *, xchar, xchar);
+static void quickmimic(struct monst *);
/* pick a carried item for pet to drop */
struct obj *
-droppables(mon)
-struct monst *mon;
+droppables(struct monst *mon)
{
struct obj *obj, *wep, dummy, *pickaxe, *unihorn, *key;
0 };
-static void FDECL(wantdoor, (int, int, genericptr_t));
+static void wantdoor(int, int, genericptr_t);
boolean
-cursed_object_at(x, y)
-int x, y;
+cursed_object_at(int x, int y)
{
struct obj *otmp;
}
int
-dog_nutrition(mtmp, obj)
-struct monst *mtmp;
-struct obj *obj;
+dog_nutrition(struct monst *mtmp, struct obj *obj)
{
int nutrit;
/* returns 2 if pet dies, otherwise 1 */
int
-dog_eat(mtmp, obj, x, y, devour)
-register struct monst *mtmp;
-register struct obj *obj; /* if unpaid, then thrown or kicked by hero */
-int x, y; /* dog's starting location, might be different from current */
-boolean devour;
+dog_eat(struct monst *mtmp,
+ struct obj *obj, /* if unpaid, then thrown or kicked by hero */
+ int x, /* dog's starting location, */
+ int y, /* might be different from current */
+ boolean devour)
{
register struct edog *edog = EDOG(mtmp);
boolean poly, grow, heal, eyes, slimer, deadmimic;
/* hunger effects -- returns TRUE on starvation */
static boolean
-dog_hunger(mtmp, edog)
-struct monst *mtmp;
-struct edog *edog;
+dog_hunger(struct monst *mtmp, struct edog *edog)
{
if (g.monstermoves > edog->hungrytime + 500) {
if (!carnivorous(mtmp->data) && !herbivorous(mtmp->data)) {
* returns 1 if object eaten (since that counts as dog's move), 2 if died
*/
static int
-dog_invent(mtmp, edog, udist)
-register struct monst *mtmp;
-register struct edog *edog;
-int udist;
+dog_invent(struct monst *mtmp, struct edog *edog, int udist)
{
register int omx, omy, carryamt = 0;
struct obj *obj, *otmp;
/* set dog's goal -- gtyp, gx, gy;
returns -1/0/1 (dog's desire to approach player) or -2 (abort move) */
static int
-dog_goal(mtmp, edog, after, udist, whappr)
-register struct monst *mtmp;
-struct edog *edog;
-int after, udist, whappr;
+dog_goal(register struct monst *mtmp, struct edog *edog,
+ int after, int udist, int whappr)
{
register int omx, omy;
boolean in_masters_sight, dog_has_minvent;
}
static struct monst *
-find_targ(mtmp, dx, dy, maxdist)
-register struct monst *mtmp;
-int dx, dy;
-int maxdist;
+find_targ(register struct monst *mtmp, int dx, int dy, int maxdist)
{
struct monst *targ = 0;
int curx = mtmp->mx, cury = mtmp->my;
}
static int
-find_friends(mtmp, mtarg, maxdist)
-struct monst *mtmp, *mtarg;
-int maxdist;
+find_friends(struct monst *mtmp, struct monst *mtarg, int maxdist)
{
struct monst *pal;
int dx = sgn(mtarg->mx - mtmp->mx),
}
static long
-score_targ(mtmp, mtarg)
-struct monst *mtmp, *mtarg;
+score_targ(struct monst *mtmp, struct monst *mtarg)
{
long score = 0L;
}
static struct monst *
-best_target(mtmp)
-struct monst *mtmp; /* Pet */
+best_target(struct monst *mtmp) /* Pet */
{
int dx, dy;
long bestscore = -40000L, currscore;
* (may have attacked something)
*/
int
-dog_move(mtmp, after)
-register struct monst *mtmp;
-int after; /* this is extra fast monster movement */
+dog_move(register struct monst *mtmp,
+ int after) /* this is extra fast monster movement */
{
int omx, omy; /* original mtmp position */
int appr, whappr, udist;
/* check if a monster could pick up objects from a location */
static boolean
-could_reach_item(mon, nx, ny)
-struct monst *mon;
-xchar nx, ny;
+could_reach_item(struct monst *mon, xchar nx, xchar ny)
{
if ((!is_pool(nx, ny) || is_swimmer(mon->data))
&& (!is_lava(nx, ny) || likes_lava(mon->data))
* calls deep.
*/
static boolean
-can_reach_location(mon, mx, my, fx, fy)
-struct monst *mon;
-xchar mx, my, fx, fy;
+can_reach_location(struct monst *mon, xchar mx, xchar my, xchar fx, xchar fy)
{
int i, j;
int dist;
/* do_clear_area client */
static void
-wantdoor(x, y, distance)
-int x, y;
-genericptr_t distance;
+wantdoor(int x, int y, genericptr_t distance)
{
int ndist, *dist_ptr = (int *) distance;
};
void
-finish_meating(mtmp)
-struct monst *mtmp;
+finish_meating(struct monst *mtmp)
{
mtmp->meating = 0;
if (M_AP_TYPE(mtmp) && mtmp->mappearance && mtmp->cham == NON_PM) {
}
static void
-quickmimic(mtmp)
-struct monst *mtmp;
+quickmimic(struct monst *mtmp)
{
int idx = 0, trycnt = 5, spotted, seeloc;
char buf[BUFSZ];
/* g.kickedobj (decl.c) tracks a kicked object until placed or destroyed */
-static void FDECL(kickdmg, (struct monst *, BOOLEAN_P));
-static boolean FDECL(maybe_kick_monster, (struct monst *,
- XCHAR_P, XCHAR_P));
-static void FDECL(kick_monster, (struct monst *, XCHAR_P, XCHAR_P));
-static int FDECL(kick_object, (XCHAR_P, XCHAR_P, char *));
-static int FDECL(really_kick_object, (XCHAR_P, XCHAR_P));
-static char *FDECL(kickstr, (char *, const char *));
-static void FDECL(otransit_msg, (struct obj *, BOOLEAN_P, BOOLEAN_P, long));
-static void FDECL(drop_to, (coord *, SCHAR_P, XCHAR_P, XCHAR_P));
+static void kickdmg(struct monst *, boolean);
+static boolean maybe_kick_monster(struct monst *, xchar, xchar);
+static void kick_monster(struct monst *, xchar, xchar);
+static int kick_object(xchar, xchar, char *);
+static int really_kick_object(xchar, xchar);
+static char *kickstr(char *, const char *);
+static void otransit_msg(struct obj *, boolean, boolean, long);
+static void drop_to(coord *, schar, xchar, xchar);
static const char kick_passes_thru[] = "kick passes harmlessly through";
/* kicking damage when not poly'd into a form with a kick attack */
static void
-kickdmg(mon, clumsy)
-struct monst *mon;
-boolean clumsy;
+kickdmg(struct monst *mon, boolean clumsy)
{
int mdx, mdy;
int dmg = (ACURRSTR + ACURR(A_DEX) + ACURR(A_CON)) / 15;
}
static boolean
-maybe_kick_monster(mon, x, y)
-struct monst *mon;
-xchar x, y;
+maybe_kick_monster(struct monst *mon, xchar x, xchar y)
{
if (mon) {
boolean save_forcefight = g.context.forcefight;
}
static void
-kick_monster(mon, x, y)
-struct monst *mon;
-xchar x, y;
+kick_monster(struct monst *mon, xchar x, xchar y)
{
boolean clumsy = FALSE;
int i, j;
* The gold object is *not* attached to the fobj chain!
*/
boolean
-ghitm(mtmp, gold)
-register struct monst *mtmp;
-register struct obj *gold;
+ghitm(register struct monst *mtmp, register struct obj *gold)
{
boolean msg_given = FALSE;
/* container is kicked, dropped, thrown or otherwise impacted by player.
* Assumes container is on floor. Checks contents for possible damage. */
void
-container_impact_dmg(obj, x, y)
-struct obj *obj;
-xchar x, y; /* coordinates where object was before the impact, not after */
+container_impact_dmg(struct obj *obj, xchar x,
+ xchar y) /* coordinates where object was before the impact, not after */
{
struct monst *shkp;
struct obj *otmp, *otmp2;
/* jacket around really_kick_object */
static int
-kick_object(x, y, kickobjnam)
-xchar x, y;
-char *kickobjnam;
+kick_object(xchar x, xchar y, char *kickobjnam)
{
int res = 0;
/* guts of kick_object */
static int
-really_kick_object(x, y)
-xchar x, y;
+really_kick_object(xchar x, xchar y)
{
int range;
struct monst *mon, *shkp = 0;
(void) snuff_candle(g.kickedobj);
newsym(x, y);
mon = bhit(u.dx, u.dy, range, KICKED_WEAPON,
- (int FDECL((*), (MONST_P, OBJ_P))) 0,
- (int FDECL((*), (OBJ_P, OBJ_P))) 0, &g.kickedobj);
+ (int (*) (struct monst *, struct obj *)) 0,
+ (int (*) (struct obj *, struct obj *)) 0, &g.kickedobj);
if (!g.kickedobj)
return 1; /* object broken */
/* cause of death if kicking kills kicker */
static char *
-kickstr(buf, kickobjnam)
-char *buf;
-const char *kickobjnam;
+kickstr(char *buf, const char *kickobjnam)
{
const char *what;
}
int
-dokick()
+dokick(void)
{
int x, y;
int avrg_attrib;
}
static void
-drop_to(cc, loc, x,y)
-coord *cc;
-schar loc;
-xchar x,y;
+drop_to(coord *cc, schar loc, xchar x, xchar y)
{
stairway *stway = stairway_at(x, y);
/* player or missile impacts location, causing objects to fall down */
void
-impact_drop(missile, x, y, dlev)
-struct obj *missile; /* caused impact, won't drop itself */
-xchar x, y; /* location affected */
-xchar dlev; /* if !0 send to dlev near player */
+impact_drop(struct obj *missile, /* caused impact, won't drop itself */
+ xchar x, xchar y, /* location affected */
+ xchar dlev) /* if !0 send to dlev near player */
{
schar toloc;
register struct obj *obj, *obj2;
* otmp is either a kicked, dropped, or thrown object.
*/
boolean
-ship_object(otmp, x, y, shop_floor_obj)
-xchar x, y;
-struct obj *otmp;
-boolean shop_floor_obj;
+ship_object(struct obj *otmp, xchar x, xchar y, boolean shop_floor_obj)
{
schar toloc;
xchar ox, oy;
}
void
-obj_delivery(near_hero)
-boolean near_hero;
+obj_delivery(boolean near_hero)
{
register struct obj *otmp, *otmp2;
int nx = 0, ny = 0;
}
void
-deliver_obj_to_mon(mtmp, cnt, deliverflags)
-int cnt;
-struct monst *mtmp;
-unsigned long deliverflags;
+deliver_obj_to_mon(struct monst *mtmp, int cnt, unsigned long deliverflags)
{
struct obj *otmp, *otmp2;
int where, maxobj = 1;
}
static void
-otransit_msg(otmp, nodrop, chainthere, num)
-register struct obj *otmp;
-boolean nodrop, chainthere;
-long num;
+otransit_msg(register struct obj *otmp, boolean nodrop, boolean chainthere, long num)
{
char *optr = 0, obuf[BUFSZ], xbuf[BUFSZ];
/* migration destination for objects which fall down to next level */
schar
-down_gate(x, y)
-xchar x, y;
+down_gate(xchar x, xchar y)
{
struct trap *ttmp;
stairway *stway = stairway_at(x, y);
#include "hack.h"
-static int FDECL(throw_obj, (struct obj *, int));
-static boolean FDECL(ok_to_throw, (int *));
-static int FDECL(throw_ok, (struct obj *));
-static void NDECL(autoquiver);
-static int FDECL(gem_accept, (struct monst *, struct obj *));
-static void FDECL(tmiss, (struct obj *, struct monst *, BOOLEAN_P));
-static int FDECL(throw_gold, (struct obj *));
-static void FDECL(check_shop_obj, (struct obj *, XCHAR_P, XCHAR_P,
- BOOLEAN_P));
-static void FDECL(breakmsg, (struct obj *, BOOLEAN_P));
-static boolean FDECL(toss_up, (struct obj *, BOOLEAN_P));
-static void FDECL(sho_obj_return_to_u, (struct obj * obj));
-static boolean FDECL(mhurtle_step, (genericptr_t, int, int));
+static int throw_obj(struct obj *, int);
+static boolean ok_to_throw(int *);
+static int throw_ok(struct obj *);
+static void autoquiver(void);
+static int gem_accept(struct monst *, struct obj *);
+static void tmiss(struct obj *, struct monst *, boolean);
+static int throw_gold(struct obj *);
+static void check_shop_obj(struct obj *, xchar, xchar, boolean);
+static void breakmsg(struct obj *, boolean);
+static boolean toss_up(struct obj *, boolean);
+static void sho_obj_return_to_u(struct obj * obj);
+static boolean mhurtle_step(genericptr_t, int, int);
/* g.thrownobj (decl.c) tracks an object until it lands */
int
-multishot_class_bonus(pm, ammo, launcher)
-int pm;
-struct obj *ammo;
-struct obj *launcher; /* can be NULL */
+multishot_class_bonus(int pm, struct obj *ammo,
+ struct obj *launcher) /* can be NULL */
{
int multishot = 0;
schar skill = objects[ammo->otyp].oc_skill;
/* Throw the selected object, asking for direction */
static int
-throw_obj(obj, shotlimit)
-struct obj *obj;
-int shotlimit;
+throw_obj(struct obj *obj, int shotlimit)
{
struct obj *otmp, *oldslot;
int multishot;
/* common to dothrow() and dofire() */
static boolean
-ok_to_throw(shotlimit_p)
-int *shotlimit_p; /* (see dothrow()) */
+ok_to_throw(int *shotlimit_p) /* (see dothrow()) */
{
/* kludge to work around parse()'s pre-decrement of `multi' */
*shotlimit_p = (g.multi || g.save_cm) ? g.multi + 1 : 0;
/* getobj callback for object to be thrown */
static int
-throw_ok(obj)
-struct obj *obj;
+throw_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* t command - throw */
int
-dothrow()
+dothrow(void)
{
register struct obj *obj;
int shotlimit;
/* KMH -- Automatically fill quiver */
/* Suggested by Jeffrey Bay <jbay@convex.hp.com> */
static void
-autoquiver()
+autoquiver(void)
{
struct obj *otmp, *oammo = 0, *omissile = 0, *omisc = 0, *altammo = 0;
/* f command -- fire: throw from the quiver */
int
-dofire()
+dofire(void)
{
int shotlimit;
struct obj *obj;
/* if in midst of multishot shooting/throwing, stop early */
void
-endmultishot(verbose)
-boolean verbose;
+endmultishot(boolean verbose)
{
if (g.m_shot.i < g.m_shot.n) {
if (verbose && !g.context.mon_moving) {
/* Object hits floor at hero's feet.
Called from drop(), throwit(), hold_another_object(), litter(). */
void
-hitfloor(obj, verbosely)
-struct obj *obj;
-boolean verbosely; /* usually True; False if caller has given drop message */
+hitfloor(struct obj *obj,
+ boolean verbosely) /* usually True; False if caller has given
+ drop message */
{
if (IS_SOFT(levl[u.ux][u.uy].typ) || u.uinwater || u.uswallow) {
dropy(obj);
* before the failed callback.
*/
boolean
-walk_path(src_cc, dest_cc, check_proc, arg)
-coord *src_cc;
-coord *dest_cc;
-boolean FDECL((*check_proc), (genericptr_t, int, int));
-genericptr_t arg;
+walk_path(coord *src_cc, coord *dest_cc,
+ boolean (*check_proc)(genericptr_t, int, int),
+ genericptr_t arg)
{
int x, y, dx, dy, x_change, y_change, err, i, prev_x, prev_y;
boolean keep_going = TRUE;
vs drag-to-dest; original callers use first mode, jumping wants second,
grappling hook backfire and thrown chained ball need third */
boolean
-hurtle_jump(arg, x, y)
-genericptr_t arg;
-int x, y;
+hurtle_jump(genericptr_t arg, int x, int y)
{
boolean res;
long save_EWwalking = EWwalking;
* o let jumps go over boulders
*/
boolean
-hurtle_step(arg, x, y)
-genericptr_t arg;
-int x, y;
+hurtle_step(genericptr_t arg, int x, int y)
{
int ox, oy, *range = (int *) arg;
struct obj *obj;
}
static boolean
-mhurtle_step(arg, x, y)
-genericptr_t arg;
-int x, y;
+mhurtle_step(genericptr_t arg, int x, int y)
{
struct monst *mon = (struct monst *) arg;
* kick or throw and be only.
*/
void
-hurtle(dx, dy, range, verbose)
-int dx, dy, range;
-boolean verbose;
+hurtle(int dx, int dy, int range, boolean verbose)
{
coord uc, cc;
/* Move a monster through the air for a few squares. */
void
-mhurtle(mon, dx, dy, range)
-struct monst *mon;
-int dx, dy, range;
+mhurtle(struct monst *mon, int dx, int dy, int range)
{
coord mc, cc;
}
static void
-check_shop_obj(obj, x, y, broken)
-struct obj *obj;
-xchar x, y;
-boolean broken;
+check_shop_obj(struct obj *obj, xchar x, xchar y, boolean broken)
{
boolean costly_xy;
struct monst *shkp = shop_keeper(*u.ushops);
* Returns FALSE if the object is gone.
*/
static boolean
-toss_up(obj, hitsroof)
-struct obj *obj;
-boolean hitsroof;
+toss_up(struct obj *obj, boolean hitsroof)
{
const char *action;
boolean petrifier = ((obj->otyp == EGG || obj->otyp == CORPSE)
/* return true for weapon meant to be thrown; excludes ammo */
boolean
-throwing_weapon(obj)
-struct obj *obj;
+throwing_weapon(struct obj *obj)
{
return (boolean) (is_missile(obj) || is_spear(obj)
/* daggers and knife (excludes scalpel) */
/* the currently thrown object is returning to you (not for boomerangs) */
static void
-sho_obj_return_to_u(obj)
-struct obj *obj;
+sho_obj_return_to_u(struct obj *obj)
{
/* might already be our location (bounced off a wall) */
if ((u.dx || u.dy) && (g.bhitpos.x != u.ux || g.bhitpos.y != u.uy)) {
/* throw an object, NB: obj may be consumed in the process */
void
-throwit(obj, wep_mask, twoweap, oldslot)
-struct obj *obj;
-long wep_mask; /* used to re-equip returning boomerang */
-boolean twoweap; /* used to restore twoweapon mode if wielded weapon returns */
-struct obj *oldslot; /* for thrown-and-return used with !fixinv */
+throwit(struct obj *obj,
+ long wep_mask, /* used to re-equip returning boomerang */
+ boolean twoweap, /* used to restore twoweapon mode if
+ wielded weapon returns */
+ struct obj *oldslot) /* for thrown-and-return used with !fixinv */
{
register struct monst *mon;
int range, urange;
mon = bhit(u.dx, u.dy, range,
tethered_weapon ? THROWN_TETHERED_WEAPON : THROWN_WEAPON,
- (int FDECL((*), (MONST_P, OBJ_P))) 0,
- (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
+ (int (*)(MONST_P, OBJ_P)) 0,
+ (int (*)(OBJ_P, OBJ_P)) 0, &obj);
g.thrownobj = obj; /* obj may be null now */
/* have to do this after bhit() so u.ux & u.uy are correct */
/* an object may hit a monster; various factors adjust chance of hitting */
int
-omon_adj(mon, obj, mon_notices)
-struct monst *mon;
-struct obj *obj;
-boolean mon_notices;
+omon_adj(struct monst *mon, struct obj *obj, boolean mon_notices)
{
int tmp = 0;
/* thrown object misses target monster */
static void
-tmiss(obj, mon, maybe_wakeup)
-struct obj *obj;
-struct monst *mon;
-boolean maybe_wakeup;
+tmiss(struct obj *obj, struct monst *mon, boolean maybe_wakeup)
{
const char *missile = mshot_xname(obj);
* Also used for kicked objects and for polearms/grapnel applied at range.
*/
int
-thitmonst(mon, obj)
-register struct monst *mon;
-register struct obj *obj; /* g.thrownobj or g.kickedobj or uwep */
+thitmonst(register struct monst *mon,
+ register struct obj *obj) /* g.thrownobj or g.kickedobj or uwep */
{
register int tmp; /* Base chance to hit */
register int disttmp; /* distance modifier */
}
static int
-gem_accept(mon, obj)
-register struct monst *mon;
-register struct obj *obj;
+gem_accept(register struct monst *mon, register struct obj *obj)
{
static NEARDATA const char
nogood[] = " is not interested in your junk.",
* Return 0 if the object didn't break, 1 if the object broke.
*/
int
-hero_breaks(obj, x, y, from_invent)
-struct obj *obj;
-xchar x, y; /* object location (ox, oy may not be right) */
-boolean from_invent; /* thrown or dropped by player; maybe on shop bill */
+hero_breaks(struct obj *obj,
+ xchar x, xchar y, /* object location (ox, oy may not be right) */
+ boolean from_invent) /* thrown or dropped by player;
+ maybe on shop bill */
{
boolean in_view = Blind ? FALSE : (from_invent || cansee(x, y));
* Return 0 if the object doesn't break, 1 if the object broke.
*/
int
-breaks(obj, x, y)
-struct obj *obj;
-xchar x, y; /* object location (ox, oy may not be right) */
+breaks(struct obj *obj,
+ xchar x, xchar y) /* object location (ox, oy may not be right) */
{
boolean in_view = Blind ? FALSE : cansee(x, y);
}
void
-release_camera_demon(obj, x, y)
-struct obj *obj;
-xchar x, y;
+release_camera_demon(struct obj *obj, xchar x, xchar y)
{
struct monst *mtmp;
if (!rn2(3)
* and break messages have been delivered prior to getting here.
*/
void
-breakobj(obj, x, y, hero_caused, from_invent)
-struct obj *obj;
-xchar x, y; /* object location (ox, oy may not be right) */
-boolean hero_caused; /* is this the hero's fault? */
-boolean from_invent;
+breakobj(struct obj *obj,
+ xchar x, xchar y, /* object location (ox, oy may not be right) */
+ boolean hero_caused, /* is this the hero's fault? */
+ boolean from_invent)
{
boolean fracture = FALSE;
* Return 0 if the object isn't going to break, 1 if it is.
*/
boolean
-breaktest(obj)
-struct obj *obj;
+breaktest(struct obj *obj)
{
if (obj_resists(obj, 1, 99))
return 0;
}
static void
-breakmsg(obj, in_view)
-struct obj *obj;
-boolean in_view;
+breakmsg(struct obj *obj, boolean in_view)
{
const char *to_pieces;
}
static int
-throw_gold(obj)
-struct obj *obj;
+throw_gold(struct obj *obj)
{
int range, odx, ody;
register struct monst *mon;
g.bhitpos.y = u.uy;
} else {
mon = bhit(u.dx, u.dy, range, THROWN_WEAPON,
- (int FDECL((*), (MONST_P, OBJ_P))) 0,
- (int FDECL((*), (OBJ_P, OBJ_P))) 0, &obj);
+ (int (*)(MONST_P, OBJ_P)) 0,
+ (int (*)(OBJ_P, OBJ_P)) 0, &obj);
if (!obj)
return 1; /* object is gone */
if (mon) {
* objnam.c, options.c, pickup.c, sp_lev.c, lev_main.c, and tilemap.c.
*/
int
-def_char_to_objclass(ch)
-char ch;
+def_char_to_objclass(char ch)
{
int i;
* Used in detect.c, options.c, read.c, sp_lev.c, and lev_main.c
*/
int
-def_char_to_monclass(ch)
-char ch;
+def_char_to_monclass(char ch)
{
int i;
/* does 'ch' represent a furniture character? returns index into defsyms[] */
int
-def_char_is_furniture(ch)
-char ch;
+def_char_is_furniture(char ch)
{
/* note: these refer to defsyms[] order which is much different from
levl[][].typ order but both keep furniture in a contiguous block */
};
#if 0
-static void FDECL(Fread, (genericptr_t, int, int, dlb *));
+static void Fread(genericptr_t, int, int, dlb *);
#endif
-static xchar FDECL(dname_to_dnum, (const char *));
-static int FDECL(find_branch, (const char *, struct proto_dungeon *));
-static xchar FDECL(parent_dnum, (const char *, struct proto_dungeon *));
-static int FDECL(level_range, (XCHAR_P, int, int, int,
- struct proto_dungeon *, int *));
-static xchar FDECL(parent_dlevel, (const char *, struct proto_dungeon *));
-static int FDECL(correct_branch_type, (struct tmpbranch *));
-static branch *FDECL(add_branch, (int, int, struct proto_dungeon *));
-static void FDECL(add_level, (s_level *));
-static void FDECL(init_level, (int, int, struct proto_dungeon *));
-static int FDECL(possible_places, (int, boolean *,
- struct proto_dungeon *));
-static xchar FDECL(pick_level, (boolean *, int));
-static boolean FDECL(place_level, (int, struct proto_dungeon *));
-static int FDECL(get_dgn_flags, (lua_State *));
-static boolean FDECL(unplaced_floater, (struct dungeon *));
-static boolean FDECL(unreachable_level, (d_level *, BOOLEAN_P));
-static void FDECL(tport_menu, (winid, char *, struct lchoice *, d_level *,
- BOOLEAN_P));
-static const char *FDECL(br_string, (int));
-static char FDECL(chr_u_on_lvl, (d_level *));
-static void FDECL(print_branch, (winid, int, int, int, BOOLEAN_P,
- struct lchoice *));
-static mapseen *FDECL(load_mapseen, (NHFILE *));
-static void FDECL(save_mapseen, (NHFILE *, mapseen *));
-static mapseen *FDECL(find_mapseen, (d_level *));
-static mapseen *FDECL(find_mapseen_by_str, (const char *));
-static void FDECL(print_mapseen, (winid, mapseen *, int, int, BOOLEAN_P));
-static boolean FDECL(interest_mapseen, (mapseen *));
-static void FDECL(traverse_mapseenchn, (BOOLEAN_P, winid,
- int, int, int *));
-static const char *FDECL(seen_string, (XCHAR_P, const char *));
-static const char *FDECL(br_string2, (branch *));
-static const char *FDECL(shop_string, (int));
-static char *FDECL(tunesuffix, (mapseen *, char *));
+static xchar dname_to_dnum(const char *);
+static int find_branch(const char *, struct proto_dungeon *);
+static xchar parent_dnum(const char *, struct proto_dungeon *);
+static int level_range(xchar, int, int, int, struct proto_dungeon *,
+ int *);
+static xchar parent_dlevel(const char *, struct proto_dungeon *);
+static int correct_branch_type(struct tmpbranch *);
+static branch *add_branch(int, int, struct proto_dungeon *);
+static void add_level(s_level *);
+static void init_level(int, int, struct proto_dungeon *);
+static int possible_places(int, boolean *, struct proto_dungeon *);
+static xchar pick_level(boolean *, int);
+static boolean place_level(int, struct proto_dungeon *);
+static int get_dgn_flags(lua_State *);
+static boolean unplaced_floater(struct dungeon *);
+static boolean unreachable_level(d_level *, boolean);
+static void tport_menu(winid, char *, struct lchoice *, d_level *,
+ boolean);
+static const char *br_string(int);
+static char chr_u_on_lvl(d_level *);
+static void print_branch(winid, int, int, int, boolean, struct lchoice *);
+static mapseen *load_mapseen(NHFILE *);
+static void save_mapseen(NHFILE *, mapseen *);
+static mapseen *find_mapseen(d_level *);
+static mapseen *find_mapseen_by_str(const char *);
+static void print_mapseen(winid, mapseen *, int, int, boolean);
+static boolean interest_mapseen(mapseen *);
+static void traverse_mapseenchn(boolean, winid, int, int, int *);
+static const char *seen_string(xchar, const char *);
+static const char *br_string2(branch *);
+static const char *shop_string(int);
+static char *tunesuffix(mapseen *, char *);
#ifdef DEBUG
#define DD g.dungeons[i]
-static void NDECL(dumpit);
+static void dumpit(void);
static void
-dumpit()
+dumpit(void)
{
int i;
s_level *x;
/* Save the dungeon structures. */
void
-save_dungeon(nhfp, perform_write, free_data)
-NHFILE *nhfp;
-boolean perform_write, free_data;
+save_dungeon(NHFILE *nhfp, boolean perform_write, boolean free_data)
{
int count;
branch *curr, *next;
/* Restore the dungeon structures. */
void
-restore_dungeon(nhfp)
-NHFILE *nhfp;
+restore_dungeon(NHFILE *nhfp)
{
branch *curr, *last;
int count = 0, i;
#if 0
static void
-Fread(ptr, size, nitems, stream)
-genericptr_t ptr;
-int size, nitems;
-dlb *stream;
+Fread(genericptr_t ptr, int size, int nitems, dlb *stream)
{
int cnt;
#endif
static xchar
-dname_to_dnum(s)
-const char *s;
+dname_to_dnum(const char *s)
{
xchar i;
}
s_level *
-find_level(s)
-const char *s;
+find_level(const char *s)
{
s_level *curr;
for (curr = g.sp_levchn; curr; curr = curr->next)
/* Find the branch that links the named dungeon. */
static int
-find_branch(s, pd)
-const char *s; /* dungeon name */
-struct proto_dungeon *pd;
+find_branch(const char *s, /* dungeon name */
+ struct proto_dungeon *pd)
{
int i;
* listing, then figuring out to which dungeon it belongs.
*/
static xchar
-parent_dnum(s, pd)
-const char *s; /* dungeon name */
-struct proto_dungeon *pd;
+parent_dnum(const char *s, /* dungeon name */
+ struct proto_dungeon *pd)
{
int i;
xchar pdnum;
* end of the dungeon.
*/
static int
-level_range(dgn, base, randc, chain, pd, adjusted_base)
-xchar dgn;
-int base, randc, chain;
-struct proto_dungeon *pd;
-int *adjusted_base;
+level_range(xchar dgn, int base, int randc, int chain,
+ struct proto_dungeon *pd, int *adjusted_base)
{
int lmax = g.dungeons[dgn].num_dunlevs;
}
static xchar
-parent_dlevel(s, pd)
-const char *s;
-struct proto_dungeon *pd;
+parent_dlevel(const char *s, struct proto_dungeon *pd)
{
int i, j, num, base, dnum = parent_dnum(s, pd);
branch *curr;
/* Convert from the temporary branch type to the dungeon branch type. */
static int
-correct_branch_type(tbr)
-struct tmpbranch *tbr;
+correct_branch_type(struct tmpbranch *tbr)
{
switch (tbr->type) {
case TBR_STAIR:
* but needs to be repositioned.
*/
void
-insert_branch(new_branch, extract_first)
-branch *new_branch;
-boolean extract_first;
+insert_branch(branch *new_branch, boolean extract_first)
{
branch *curr, *prev;
long new_val, curr_val, prev_val;
/* Add a dungeon branch to the branch list. */
static branch *
-add_branch(dgn, child_entry_level, pd)
-int dgn;
-int child_entry_level;
-struct proto_dungeon *pd;
+add_branch(int dgn, int child_entry_level, struct proto_dungeon *pd)
{
static int branch_id = 0;
int branch_num;
* last entry.
*/
static void
-add_level(new_lev)
-s_level *new_lev;
+add_level(s_level *new_lev)
{
s_level *prev, *curr;
}
static void
-init_level(dgn, proto_index, pd)
-int dgn, proto_index;
-struct proto_dungeon *pd;
+init_level(int dgn, int proto_index, struct proto_dungeon *pd)
{
s_level *new_level;
struct tmplevel *tlevel = &pd->tmplevel[proto_index];
}
static int
-possible_places(idx, map, pd)
-int idx; /* prototype index */
-boolean *map; /* array MAXLEVEL+1 in length */
-struct proto_dungeon *pd;
+possible_places(int idx, /* prototype index */
+ boolean *map, /* array MAXLEVEL+1 in length */
+ struct proto_dungeon *pd)
{
int i, start, count;
s_level *lev = pd->final_lev[idx];
/* Pick the nth TRUE entry in the given boolean array. */
static xchar
-pick_level(map, nth)
-boolean *map; /* an array MAXLEVEL+1 in size */
-int nth;
+pick_level(boolean *map, /* an array MAXLEVEL+1 in size */
+ int nth)
{
int i;
for (i = 1; i <= MAXLEVEL; i++)
}
#ifdef DDEBUG
-static void FDECL(indent, (int));
+static void indent(int);
static void
-indent(d)
-int d;
+indent(int d)
{
while (d-- > 0)
fputs(" ", stderr);
* been exhausted, return false.
*/
static boolean
-place_level(proto_index, pd)
-int proto_index;
-struct proto_dungeon *pd;
+place_level(int proto_index, struct proto_dungeon *pd)
{
boolean map[MAXLEVEL + 1]; /* valid levels are 1..MAXLEVEL inclusive */
s_level *lev;
{ "", (d_level *) 0 } };
int
-get_dgn_flags(L)
-lua_State *L;
+get_dgn_flags(lua_State *L)
{
int dgn_flags = 0;
static const char *const flagstrs[] = {
/* initialize the "dungeon" structs */
void
-init_dungeons()
+init_dungeons(void)
{
static const char *const dgnaligns[] = {
"unaligned", "noalign", "lawful", "neutral", "chaotic", NULL
/* return the level number for lev in *this* dungeon */
xchar
-dunlev(lev)
-d_level *lev;
+dunlev(d_level *lev)
{
return lev->dlevel;
}
/* return the lowest level number for *this* dungeon */
xchar
-dunlevs_in_dungeon(lev)
-d_level *lev;
+dunlevs_in_dungeon(d_level *lev)
{
return g.dungeons[lev->dnum].num_dunlevs;
}
/* return the lowest level explored in the game*/
xchar
-deepest_lev_reached(noquest)
-boolean noquest;
+deepest_lev_reached(boolean noquest)
{
/* this function is used for three purposes: to provide a factor
* of difficulty in monster generation; to provide a factor of
/* return a bookkeeping level number for purpose of comparisons and
save/restore */
xchar
-ledger_no(lev)
-d_level *lev;
+ledger_no(d_level *lev)
{
return (xchar) (lev->dlevel + g.dungeons[lev->dnum].ledger_start);
}
* depth visited by the player.
*/
xchar
-maxledgerno()
+maxledgerno(void)
{
return (xchar) (g.dungeons[g.n_dgns - 1].ledger_start
+ g.dungeons[g.n_dgns - 1].num_dunlevs);
/* return the dungeon that this ledgerno exists in */
xchar
-ledger_to_dnum(ledgerno)
-xchar ledgerno;
+ledger_to_dnum(xchar ledgerno)
{
register int i;
/* return the level of the dungeon this ledgerno exists in */
xchar
-ledger_to_dlev(ledgerno)
-xchar ledgerno;
+ledger_to_dlev(xchar ledgerno)
{
return (xchar) (ledgerno
- g.dungeons[ledger_to_dnum(ledgerno)].ledger_start);
/* returns the depth of a level, in floors below the surface
(note levels in different dungeons can have the same depth) */
schar
-depth(lev)
-d_level *lev;
+depth(d_level *lev)
{
return (schar) (g.dungeons[lev->dnum].depth_start + lev->dlevel - 1);
}
/* are "lev1" and "lev2" actually the same? */
boolean
-on_level(lev1, lev2)
-d_level *lev1, *lev2;
+on_level(d_level *lev1, d_level *lev2)
{
return (boolean) (lev1->dnum == lev2->dnum
&& lev1->dlevel == lev2->dlevel);
/* is this level referenced in the special level chain? */
s_level *
-Is_special(lev)
-d_level *lev;
+Is_special(d_level *lev)
{
s_level *levtmp;
* branch. Otherwise, return null.
*/
branch *
-Is_branchlev(lev)
-d_level *lev;
+Is_branchlev(d_level *lev)
{
branch *curr;
/* returns True iff the branch 'lev' is in a branch which builds up */
boolean
-builds_up(lev)
-d_level *lev;
+builds_up(d_level *lev)
{
dungeon *dptr = &g.dungeons[lev->dnum];
/*
/* goto the next level (or appropriate dungeon) */
void
-next_level(at_stairs)
-boolean at_stairs;
+next_level(boolean at_stairs)
{
stairway *stway = stairway_at(u.ux, u.uy);
d_level newlevel;
/* goto the previous level (or appropriate dungeon) */
void
-prev_level(at_stairs)
-boolean at_stairs;
+prev_level(boolean at_stairs)
{
stairway *stway = stairway_at(u.ux, u.uy);
d_level newlevel;
}
void
-u_on_newpos(x, y)
-int x, y;
+u_on_newpos(int x, int y)
{
if (!isok(x, y)) { /* validate location */
- void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2);
+ void (*func)(const char *, ...);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible;
/* place you on a random location when arriving on a level */
void
-u_on_rndspot(upflag)
-int upflag;
+u_on_rndspot(int upflag)
{
int up = (upflag & 1), was_in_W_tower = (upflag & 2);
}
void
-stairway_add(x, y, up, isladder, dest)
-int x, y;
-boolean up, isladder;
-d_level *dest;
+stairway_add(int x, int y, boolean up, boolean isladder, d_level *dest)
{
stairway *tmp = (stairway *)alloc(sizeof(stairway));
}
void
-stairway_free_all()
+stairway_free_all(void)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_at(x,y)
-int x,y;
+stairway_at(int x, int y)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_find(fromdlev)
-d_level *fromdlev;
+stairway_find(d_level *fromdlev)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_find_from(fromdlev, isladder)
-d_level *fromdlev;
-boolean isladder;
+stairway_find_from(d_level *fromdlev, boolean isladder)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_find_dir(up)
-boolean up;
+stairway_find_dir(boolean up)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_find_type_dir(isladder, up)
-boolean isladder, up;
+stairway_find_type_dir(boolean isladder, boolean up)
{
stairway *tmp = g.stairs;
}
stairway *
-stairway_find_special_dir(up)
-boolean up;
+stairway_find_special_dir(boolean up)
{
stairway *tmp = g.stairs;
/* place you on the special staircase */
void
-u_on_sstairs(upflag)
-int upflag;
+u_on_sstairs(int upflag)
{
stairway *stway = stairway_find_special_dir(upflag);
/* place you on upstairs (or special equivalent) */
void
-u_on_upstairs()
+u_on_upstairs(void)
{
stairway *stway = stairway_find_dir(TRUE);
/* place you on dnstairs (or special equivalent) */
void
-u_on_dnstairs()
+u_on_dnstairs(void)
{
stairway *stway = stairway_find_dir(FALSE);
}
boolean
-On_stairs(x, y)
-xchar x, y;
+On_stairs(xchar x, xchar y)
{
return (stairway_at(x,y) != NULL);
}
boolean
-On_ladder(x, y)
-xchar x, y;
+On_ladder(xchar x, xchar y)
{
stairway *stway = stairway_at(x,y);
}
boolean
-On_stairs_up(x, y)
-xchar x, y;
+On_stairs_up(xchar x, xchar y)
{
stairway *stway = stairway_at(x,y);
}
boolean
-On_stairs_dn(x, y)
-xchar x, y;
+On_stairs_dn(xchar x, xchar y)
{
stairway *stway = stairway_at(x,y);
}
boolean
-Is_botlevel(lev)
-d_level *lev;
+Is_botlevel(d_level *lev)
{
return (boolean) (lev->dlevel == g.dungeons[lev->dnum].num_dunlevs);
}
boolean
-Can_dig_down(lev)
-d_level *lev;
+Can_dig_down(d_level *lev)
{
return (boolean) (!g.level.flags.hardfloor
&& !Is_botlevel(lev)
* both digging and falling.
*/
boolean
-Can_fall_thru(lev)
-d_level *lev;
+Can_fall_thru(d_level *lev)
{
return (boolean) (Can_dig_down(lev) || Is_stronghold(lev));
}
* Checks for amulets and such must be done elsewhere.
*/
boolean
-Can_rise_up(x, y, lev)
-int x, y;
-d_level *lev;
+Can_rise_up(int x, int y, d_level *lev)
{
stairway *stway = stairway_find_special_dir(FALSE);
}
boolean
-has_ceiling(lev)
-d_level *lev;
+has_ceiling(d_level *lev)
{
/* [what about level 1 of the quest?] */
return (boolean) (!Is_airlevel(lev) && !Is_waterlevel(lev));
* in dungeons that build up is confined within them.
*/
void
-get_level(newlevel, levnum)
-d_level *newlevel;
-int levnum;
+get_level(d_level *newlevel, int levnum)
{
branch *br;
xchar dgn = u.uz.dnum;
/* are you in the quest dungeon? */
boolean
-In_quest(lev)
-d_level *lev;
+In_quest(d_level *lev)
{
return (boolean) (lev->dnum == quest_dnum);
}
/* are you in the mines dungeon? */
boolean
-In_mines(lev)
-d_level *lev;
+In_mines(d_level *lev)
{
return (boolean) (lev->dnum == mines_dnum);
}
* + Field end2 is the "child" dungeon.
*/
branch *
-dungeon_branch(s)
-const char *s;
+dungeon_branch(const char *s)
{
branch *br;
xchar dnum;
* Assumes that end1 is always the "parent".
*/
boolean
-at_dgn_entrance(s)
-const char *s;
+at_dgn_entrance(const char *s)
{
branch *br;
/* is `lev' part of Vlad's tower? */
boolean
-In_V_tower(lev)
-d_level *lev;
+In_V_tower(d_level *lev)
{
return (boolean) (lev->dnum == tower_dnum);
}
/* is `lev' a level containing the Wizard's tower? */
boolean
-On_W_tower_level(lev)
-d_level *lev;
+On_W_tower_level(d_level *lev)
{
return (boolean) (Is_wiz1_level(lev)
|| Is_wiz2_level(lev)
/* is <x,y> of `lev' inside the Wizard's tower? */
boolean
-In_W_tower(x, y, lev)
-int x, y;
-d_level *lev;
+In_W_tower(int x, int y, d_level *lev)
{
if (!On_W_tower_level(lev))
return FALSE;
/* are you in one of the Hell levels? */
boolean
-In_hell(lev)
-d_level *lev;
+In_hell(d_level *lev)
{
return (boolean) (g.dungeons[lev->dnum].flags.hellish);
}
/* sets *lev to be the gateway to Gehennom... */
void
-find_hell(lev)
-d_level *lev;
+find_hell(d_level *lev)
{
lev->dnum = valley_level.dnum;
lev->dlevel = 1;
/* go directly to hell... */
void
-goto_hell(at_stairs, falling)
-boolean at_stairs, falling;
+goto_hell(boolean at_stairs, boolean falling)
{
d_level lev;
/* equivalent to dest = source */
void
-assign_level(dest, src)
-d_level *dest, *src;
+assign_level(d_level *dest, d_level *src)
{
dest->dnum = src->dnum;
dest->dlevel = src->dlevel;
/* dest = src + rn1(range) */
void
-assign_rnd_level(dest, src, range)
-d_level *dest, *src;
-int range;
+assign_rnd_level(d_level *dest, d_level *src, int range)
{
dest->dnum = src->dnum;
dest->dlevel = src->dlevel + ((range > 0) ? rnd(range) : -rnd(-range));
}
int
-induced_align(pct)
-int pct;
+induced_align(int pct)
{
s_level *lev = Is_special(&u.uz);
aligntyp al;
}
boolean
-Invocation_lev(lev)
-d_level *lev;
+Invocation_lev(d_level *lev)
{
return (boolean) (In_hell(lev)
&& lev->dlevel == g.dungeons[lev->dnum].num_dunlevs - 1);
* dependent on the location in the dungeon (eg. monster creation).
*/
xchar
-level_difficulty()
+level_difficulty(void)
{
int res;
* Recognized levels are as shown by print_dungeon().
*/
schar
-lev_by_name(nam)
-const char *nam;
+lev_by_name(const char *nam)
{
schar lev = 0;
s_level *slev = (s_level *)0;
}
static boolean
-unplaced_floater(dptr)
-struct dungeon *dptr;
+unplaced_floater(struct dungeon *dptr)
{
branch *br;
int idx = (int) (dptr - g.dungeons);
}
static boolean
-unreachable_level(lvl_p, unplaced)
-d_level *lvl_p;
-boolean unplaced;
+unreachable_level(d_level *lvl_p, boolean unplaced)
{
s_level *dummy;
}
static void
-tport_menu(win, entry, lchoices, lvl_p, unreachable)
-winid win;
-char *entry;
-struct lchoice *lchoices;
-d_level *lvl_p;
-boolean unreachable;
+tport_menu(winid win, char *entry, struct lchoice *lchoices,
+ d_level *lvl_p, boolean unreachable)
{
char tmpbuf[BUFSZ];
anything any;
/* Convert a branch type to a string usable by print_dungeon(). */
static const char *
-br_string(type)
-int type;
+br_string(int type)
{
switch (type) {
case BR_PORTAL:
}
static char
-chr_u_on_lvl(dlev)
-d_level *dlev;
+chr_u_on_lvl(d_level *dlev)
{
return u.uz.dnum == dlev->dnum && u.uz.dlevel == dlev->dlevel ? '*' : ' ';
}
/* Print all child branches between the lower and upper bounds. */
static void
-print_branch(win, dnum, lower_bound, upper_bound, bymenu, lchoices_p)
-winid win;
-int dnum;
-int lower_bound;
-int upper_bound;
-boolean bymenu;
-struct lchoice *lchoices_p;
+print_branch(winid win, int dnum, int lower_bound, int upper_bound,
+ boolean bymenu, struct lchoice *lchoices_p)
{
branch *br;
char buf[BUFSZ];
/* Print available dungeon information. */
schar
-print_dungeon(bymenu, rlev, rdgn)
-boolean bymenu;
-schar *rlev;
-xchar *rdgn;
+print_dungeon(boolean bymenu, schar *rlev, xchar *rdgn)
{
int i, last_level, nlev;
char buf[BUFSZ];
* teleport or via the Eye.
*/
void
-recbranch_mapseen(source, dest)
-d_level *source;
-d_level *dest;
+recbranch_mapseen(d_level *source, d_level *dest)
{
mapseen *mptr;
branch *br;
}
char *
-get_annotation(lev)
-d_level *lev;
+get_annotation(d_level *lev)
{
mapseen *mptr;
/* #annotate command - add a custom name to the current level */
int
-donamelevel()
+donamelevel(void)
{
mapseen *mptr;
char nbuf[BUFSZ]; /* Buffer for response */
/* find the particular mapseen object in the chain; may return null */
static mapseen *
-find_mapseen(lev)
-d_level *lev;
+find_mapseen(d_level *lev)
{
mapseen *mptr;
}
static mapseen *
-find_mapseen_by_str(s)
-const char *s;
+find_mapseen_by_str(const char *s)
{
mapseen *mptr;
void
-rm_mapseen(ledger_num)
-int ledger_num;
+rm_mapseen(int ledger_num)
{
mapseen *mptr, *mprev = (mapseen *)0;
struct cemetery *bp, *bpnext;
}
static void
-save_mapseen(nhfp, mptr)
-NHFILE *nhfp;
-mapseen *mptr;
+save_mapseen(NHFILE *nhfp, mapseen *mptr)
{
branch *curr;
int brindx;
}
static mapseen *
-load_mapseen(nhfp)
-NHFILE *nhfp;
+load_mapseen(NHFILE *nhfp)
{
int branchnum = 0, brindx;
mapseen *load;
/* to support '#stats' wizard-mode command */
void
-overview_stats(win, statsfmt, total_count, total_size)
-winid win;
-const char *statsfmt;
-long *total_count, *total_size;
+overview_stats(winid win, const char *statsfmt,
+ long *total_count, long *total_size)
{
char buf[BUFSZ], hdrbuf[QBUFSZ];
long ocount, osize, bcount, bsize, acount, asize;
* ignore such levels, end of game disclosure will include them.]
*/
void
-remdun_mapseen(dnum)
-int dnum;
+remdun_mapseen(int dnum)
{
mapseen *mptr, **mptraddr;
}
void
-init_mapseen(lev)
-d_level *lev;
+init_mapseen(d_level *lev)
{
/* Create a level and insert in "sorted" order. This is an insertion
* sort first by dungeon (in order of discovery) and then by level number.
/* returns true if this level has something interesting to print out */
static boolean
-interest_mapseen(mptr)
-mapseen *mptr;
+interest_mapseen(mapseen *mptr)
{
if (on_level(&u.uz, &mptr->lev))
return TRUE;
/* recalculate mapseen for the current level */
void
-recalc_mapseen()
+recalc_mapseen(void)
{
mapseen *mptr, *oth_mptr;
struct monst *mtmp;
/*ARGUSED*/
/* valley and sanctum levels get automatic annotation once temple is entered */
void
-mapseen_temple(priest)
-struct monst *priest UNUSED; /* currently unused; might be useful someday */
+mapseen_temple(struct monst *priest UNUSED) /* currently unused;
+ might be useful someday */
{
mapseen *mptr = find_mapseen(&u.uz);
/* room entry message has just been delivered so learn room even if blind */
void
-room_discovered(roomno)
-int roomno;
+room_discovered(int roomno)
{
mapseen *mptr = find_mapseen(&u.uz);
/* #overview command */
int
-dooverview()
+dooverview(void)
{
show_overview(0, 0);
return 0;
/* called for #overview or for end of game disclosure */
void
-show_overview(why, reason)
-int why; /* 0 => #overview command,
- 1 or 2 => final disclosure (1: hero lived, 2: hero died) */
-int reason; /* how hero died; used when disclosing end-of-game level */
+show_overview(int why, /* 0 => #overview command,
+ 1 or 2 => final disclosure
+ (1: hero lived, 2: hero died) */
+ int reason) /* how hero died; used when disclosing end-of-game level */
{
winid win;
int lastdun = -1;
/* display endgame levels or non-endgame levels, not both */
static void
-traverse_mapseenchn(viewendgame, win, why, reason, lastdun_p)
-boolean viewendgame;
-winid win;
-int why, reason, *lastdun_p;
+traverse_mapseenchn(boolean viewendgame, winid win, int why, int reason,
+ int *lastdun_p)
{
mapseen *mptr;
boolean showheader;
}
static const char *
-seen_string(x, obj)
-xchar x;
-const char *obj;
+seen_string(xchar x, const char *obj)
{
/* players are computer scientists: 0, 1, 2, n */
switch (x) {
/* better br_string */
static const char *
-br_string2(br)
-branch *br;
+br_string2(branch *br)
{
/* Special case: quest portal says closed if kicked from quest */
boolean closed_portal = (br->end2.dnum == quest_dnum
/* get the name of an endgame level; topten.c does something similar */
const char *
-endgamelevelname(outbuf, indx)
-char *outbuf;
-int indx;
+endgamelevelname(char *outbuf, int indx)
{
const char *planename = 0;
}
static const char *
-shop_string(rtype)
-int rtype;
+shop_string(int rtype)
{
const char *str = "shop"; /* catchall */
/* if player knows about the mastermind tune, append it to Castle annotation;
if drawbridge has been destroyed, flags.castletune will be zero */
static char *
-tunesuffix(mptr, outbuf)
-mapseen *mptr;
-char *outbuf;
+tunesuffix(mapseen *mptr, char *outbuf)
{
*outbuf = '\0';
if (mptr->flags.castletune && u.uevent.uheard_tune) {
} while (0)
static void
-print_mapseen(win, mptr, final, how, printdun)
-winid win;
-mapseen *mptr;
-int final; /* 0: not final; 1: game over, alive; 2: game over, dead */
-int how; /* cause of death; only used if final==2 and mptr->lev==u.uz */
-boolean printdun;
+print_mapseen(winid win, mapseen *mptr,
+ int final, /* 0: not final; 1: game over, alive;
+ 2: game over, dead */
+ int how, /* cause of death; only used if final==2
+ and mptr->lev==u.uz */
+ boolean printdun)
{
char buf[BUFSZ], tmpbuf[BUFSZ];
int i, depthstart, dnum;
#include "hack.h"
-static int NDECL(eatmdone);
-static int NDECL(eatfood);
-static struct obj *FDECL(costly_tin, (int));
-static int NDECL(opentin);
-static int NDECL(unfaint);
-
-static const char *FDECL(food_xname, (struct obj *, BOOLEAN_P));
-static void FDECL(choke, (struct obj *));
-static void NDECL(recalc_wt);
-static unsigned FDECL(obj_nutrition, (struct obj *));
-static struct obj *FDECL(touchfood, (struct obj *));
-static void NDECL(do_reset_eat);
-static void FDECL(done_eating, (BOOLEAN_P));
-static void FDECL(cprefx, (int));
-static int FDECL(intrinsic_possible, (int, struct permonst *));
-static void FDECL(givit, (int, struct permonst *));
-static void FDECL(cpostfx, (int));
-static void FDECL(consume_tin, (const char *));
-static void FDECL(start_tin, (struct obj *));
-static int FDECL(eatcorpse, (struct obj *));
-static void FDECL(start_eating, (struct obj *, BOOLEAN_P));
-static void FDECL(fprefx, (struct obj *));
-static void FDECL(fpostfx, (struct obj *));
-static int NDECL(bite);
-static int FDECL(edibility_prompts, (struct obj *));
-static int FDECL(tinopen_ok, (struct obj *));
-static int FDECL(rottenfood, (struct obj *));
-static void NDECL(eatspecial);
-static int FDECL(bounded_increase, (int, int, int));
-static void FDECL(accessory_has_effect, (struct obj *));
-static void FDECL(eataccessory, (struct obj *));
-static const char *FDECL(foodword, (struct obj *));
-static int FDECL(tin_variety, (struct obj *, BOOLEAN_P));
-static boolean FDECL(maybe_cannibal, (int, BOOLEAN_P));
-static int FDECL(eat_ok, (struct obj *));
-static int FDECL(offer_ok, (struct obj *));
-static int FDECL(tin_ok, (struct obj *));
+static int eatmdone(void);
+static int eatfood(void);
+static struct obj *costly_tin(int);
+static int opentin(void);
+static int unfaint(void);
+
+static const char *food_xname(struct obj *, boolean);
+static void choke(struct obj *);
+static void recalc_wt(void);
+static unsigned obj_nutrition(struct obj *);
+static struct obj *touchfood(struct obj *);
+static void do_reset_eat(void);
+static void done_eating(boolean);
+static void cprefx(int);
+static int intrinsic_possible(int, struct permonst *);
+static void givit(int, struct permonst *);
+static void cpostfx(int);
+static void consume_tin(const char *);
+static void start_tin(struct obj *);
+static int eatcorpse(struct obj *);
+static void start_eating(struct obj *, boolean);
+static void fprefx(struct obj *);
+static void fpostfx(struct obj *);
+static int bite(void);
+static int edibility_prompts(struct obj *);
+static int tinopen_ok(struct obj *);
+static int rottenfood(struct obj *);
+static void eatspecial(void);
+static int bounded_increase(int, int, int);
+static void accessory_has_effect(struct obj *);
+static void eataccessory(struct obj *);
+static const char *foodword(struct obj *);
+static int tin_variety(struct obj *, boolean);
+static boolean maybe_cannibal(int, boolean);
+static int eat_ok(struct obj *);
+static int offer_ok(struct obj *);
+static int tin_ok(struct obj *);
/* also used to see if you're allowed to eat cats and dogs */
#define CANNIBAL_ALLOWED() (Role_if(PM_CAVE_DWELLER) || Race_if(PM_ORC))
* polymorphed character. Not used for monster checks.
*/
boolean
-is_edible(obj)
-register struct obj *obj;
+is_edible(register struct obj *obj)
{
/* protect invocation tools but not Rider corpses (handled elsewhere)*/
/* if (obj->oclass != FOOD_CLASS && obj_resists(obj, 0, 0)) */
/* used for hero init, life saving (if choking), and prayer results of fix
starving, fix weak from hunger, or golden glow boon (if u.uhunger < 900) */
void
-init_uhunger()
+init_uhunger(void)
{
g.context.botl = (u.uhs != NOT_HUNGRY || ATEMP(A_STR) < 0);
u.uhunger = 900;
/* called after mimicing is over */
static int
-eatmdone(VOID_ARGS)
+eatmdone(void)
{
/* release `eatmbuf' */
if (g.eatmbuf) {
/* called when hallucination is toggled */
void
-eatmupdate()
+eatmupdate(void)
{
const char *altmsg = 0;
int altapp = 0; /* lint suppression */
/* ``[the(] singular(food, xname) [)]'' */
static const char *
-food_xname(food, the_pfx)
-struct obj *food;
-boolean the_pfx;
+food_xname(struct obj *food, boolean the_pfx)
{
const char *result;
* To a full belly all food is bad. (It.)
*/
static void
-choke(food)
-struct obj *food;
+choke(struct obj *food)
{
/* only happens if you were satiated */
if (u.uhs != SATIATED) {
/* modify object wt. depending on time spent consuming it */
static void
-recalc_wt()
+recalc_wt(void)
{
struct obj *piece = g.context.victual.piece;
if (!piece) {
/* called when eating interrupted by an event */
void
-reset_eat()
+reset_eat(void)
{
/* we only set a flag here - the actual reset process is done after
* the round is spent eating.
/* base nutrition of a food-class object */
static unsigned
-obj_nutrition(otmp)
-struct obj *otmp;
+obj_nutrition(struct obj *otmp)
{
unsigned nut = (otmp->otyp == CORPSE) ? mons[otmp->corpsenm].cnutrit
: otmp->globby ? otmp->owt
}
static struct obj *
-touchfood(otmp)
-struct obj *otmp;
+touchfood(struct obj *otmp)
{
if (otmp->quan > 1L) {
if (!carried(otmp))
* in do_reset_eat().
*/
void
-food_disappears(obj)
-struct obj *obj;
+food_disappears(struct obj *obj)
{
if (obj == g.context.victual.piece) {
g.context.victual.piece = (struct obj *) 0;
so the sequence start eating/opening, get interrupted, name the food,
resume eating/opening would restart from scratch */
void
-food_substitution(old_obj, new_obj)
-struct obj *old_obj, *new_obj;
+food_substitution(struct obj *old_obj, struct obj *new_obj)
{
if (old_obj == g.context.victual.piece) {
g.context.victual.piece = new_obj;
}
static void
-do_reset_eat()
+do_reset_eat(void)
{
debugpline0("do_reset_eat...");
if (g.context.victual.piece) {
/* called each move during eating process */
static int
-eatfood(VOID_ARGS)
+eatfood(void)
{
if (!g.context.victual.piece
|| (!carried(g.context.victual.piece)
}
static void
-done_eating(message)
-boolean message;
+done_eating(boolean message)
{
struct obj *piece = g.context.victual.piece;
}
void
-eating_conducts(pd)
-struct permonst *pd;
+eating_conducts(struct permonst *pd)
{
u.uconduct.food++;
if (!vegan(pd))
/* handle side-effects of mind flayer's tentacle attack */
int
-eat_brains(magr, mdef, visflag, dmg_p)
-struct monst *magr, *mdef;
-boolean visflag;
-int *dmg_p; /* for dishing out extra damage in lieu of Int loss */
+eat_brains(struct monst *magr, struct monst *mdef,
+ boolean visflag,
+ int *dmg_p) /* for dishing out extra damage in lieu of Int loss */
{
struct permonst *pd = mdef->data;
boolean give_nutrit = FALSE;
/* eating a corpse or egg of one's own species is usually naughty */
static boolean
-maybe_cannibal(pm, allowmsg)
-int pm;
-boolean allowmsg;
+maybe_cannibal(int pm, boolean allowmsg)
{
static NEARDATA long ate_brains = 0L;
struct permonst *fptr = &mons[pm]; /* food type */
}
static void
-cprefx(pm)
-register int pm;
+cprefx(register int pm)
{
(void) maybe_cannibal(pm, TRUE);
if (flesh_petrifies(&mons[pm])) {
}
void
-fix_petrification()
+fix_petrification(void)
{
char buf[BUFSZ];
/* intrinsic_possible() returns TRUE iff a monster can give an intrinsic. */
static int
-intrinsic_possible(type, ptr)
-int type;
-register struct permonst *ptr;
+intrinsic_possible(int type, register struct permonst *ptr)
{
int res = 0;
* and what type of intrinsic it is trying to give you.
*/
static void
-givit(type, ptr)
-int type;
-register struct permonst *ptr;
+givit(int type, register struct permonst *ptr)
{
register int chance;
/* called after completely consuming a corpse */
static void
-cpostfx(pm)
-int pm;
+cpostfx(int pm)
{
int tmp = 0;
int catch_lycanthropy = NON_PM;
}
void
-violated_vegetarian()
+violated_vegetarian(void)
{
u.uconduct.unvegetarian++;
if (Role_if(PM_MONK)) {
/* common code to check and possibly charge for 1 g.context.tin.tin,
* will split() g.context.tin.tin if necessary */
static struct obj *
-costly_tin(alter_type)
-int alter_type; /* COST_xxx */
+costly_tin(int alter_type) /* COST_xxx */
{
struct obj *tin = g.context.tin.tin;
}
int
-tin_variety_txt(s, tinvariety)
-char *s;
-int *tinvariety;
+tin_variety_txt(char *s, int *tinvariety)
{
int k, l;
* as is the case with caller xname().
*/
void
-tin_details(obj, mnum, buf)
-struct obj *obj;
-int mnum;
-char *buf;
+tin_details(struct obj *obj, int mnum, char *buf)
{
char buf2[BUFSZ];
int r = tin_variety(obj, TRUE);
}
void
-set_tin_variety(obj, forcetype)
-struct obj *obj;
-int forcetype;
+set_tin_variety(struct obj *obj, int forcetype)
{
register int r;
}
static int
-tin_variety(obj, disp)
-struct obj *obj;
-boolean disp; /* we're just displaying so leave things alone */
+tin_variety(struct obj *obj,
+ boolean disp) /* we're just displaying so leave things alone */
{
register int r;
}
static void
-consume_tin(mesg)
-const char *mesg;
+consume_tin(const char *mesg)
{
const char *what;
int which, mnum, r;
/* called during each move whilst opening a tin */
static int
-opentin(VOID_ARGS)
+opentin(void)
{
/* perhaps it was stolen (although that should cause interruption) */
if (!carried(g.context.tin.tin)
/* called when starting to open a tin */
static void
-start_tin(otmp)
-struct obj *otmp;
+start_tin(struct obj *otmp)
{
const char *mesg = 0;
register int tmp;
/* called when waking up after fainting */
int
-Hear_again(VOID_ARGS)
+Hear_again(void)
{
/* Chance of deafness going away while fainted/sleeping/etc. */
if (!rn2(2)) {
/* called on the "first bite" of rotten food */
static int
-rottenfood(obj)
-struct obj *obj;
+rottenfood(struct obj *obj)
{
pline("Blecch! Rotten %s!", foodword(obj));
if (!rn2(4)) {
/* called when a corpse is selected as food */
static int
-eatcorpse(otmp)
-struct obj *otmp;
+eatcorpse(struct obj *otmp)
{
int retcode = 0, tp = 0, mnum = otmp->corpsenm;
long rotted = 0L;
/* called as you start to eat */
static void
-start_eating(otmp, already_partly_eaten)
-struct obj *otmp;
-boolean already_partly_eaten;
+start_eating(struct obj *otmp, boolean already_partly_eaten)
{
const char *old_nomovemsg, *save_nomovemsg;
static char msgbuf[BUFSZ];
* finishing at the time they're issued.
*/
static void
-fprefx(otmp)
-struct obj *otmp;
+fprefx(struct obj *otmp)
{
switch (otmp->otyp) {
case FOOD_RATION: /* nutrition 800 */
/* increment a combat intrinsic with limits on its growth */
static int
-bounded_increase(old, inc, typ)
-int old, inc, typ;
+bounded_increase(int old, int inc, int typ)
{
int absold, absinc, sgnold, sgninc;
}
static void
-accessory_has_effect(otmp)
-struct obj *otmp;
+accessory_has_effect(struct obj *otmp)
{
pline("Magic spreads through your body as you digest the %s.",
(otmp->oclass == RING_CLASS) ? "ring" : "amulet");
}
static void
-eataccessory(otmp)
-struct obj *otmp;
+eataccessory(struct obj *otmp)
{
int typ = otmp->otyp;
long oldprop;
/* called after eating non-food */
static void
-eatspecial()
+eatspecial(void)
{
struct obj *otmp = g.context.victual.piece;
};
static const char *
-foodword(otmp)
-struct obj *otmp;
+foodword(struct obj *otmp)
{
if (otmp->oclass == FOOD_CLASS)
return "food";
/* called after consuming (non-corpse) food */
static void
-fpostfx(otmp)
-struct obj *otmp;
+fpostfx(struct obj *otmp)
{
switch (otmp->otyp) {
case SPRIG_OF_WOLFSBANE:
/* intended for eating a spellbook while polymorphed, but not used;
"leather" applied to appearance, not composition, and has been
changed to "leathery" to reflect that */
-static boolean FDECL(leather_cover, (struct obj *));
+static boolean leather_cover(struct obj *);
static boolean
-leather_cover(otmp)
-struct obj *otmp;
+leather_cover(struct obj *otmp)
{
const char *odesc = OBJ_DESCR(objects[otmp->otyp]);
* return 2 if the food was dangerous and you chose to eat it anyway.
*/
static int
-edibility_prompts(otmp)
-struct obj *otmp;
+edibility_prompts(struct obj *otmp)
{
/* Blessed food detection grants hero a one-use
* ability to detect food that is unfit for consumption
/* 'e' command */
int
-doeat()
+doeat(void)
{
struct obj *otmp;
int basenutrit; /* nutrition of full item */
/* getobj callback for object to be opened with a tin opener */
static int
-tinopen_ok(obj)
-struct obj *obj;
+tinopen_ok(struct obj *obj)
{
if (obj && obj->otyp == TIN)
return GETOBJ_SUGGEST;
int
-use_tin_opener(obj)
-struct obj *obj;
+use_tin_opener(struct obj *obj)
{
struct obj *otmp;
int res = 0;
* modifying usedtime. Returns 1 if they choked and survived, 0 otherwise.
*/
static int
-bite()
+bite(void)
{
if (g.context.victual.canchoke && u.uhunger >= 2000) {
choke(g.context.victual.piece);
/* as time goes by - called by moveloop(every move) & domove(melee attack) */
void
-gethungry()
+gethungry(void)
{
int accessorytime;
/* called after vomiting and after performing feats of magic */
void
-morehungry(num)
-int num;
+morehungry(int num)
{
u.uhunger -= num;
newuhs(TRUE);
/* called after eating (and after drinking fruit juice) */
void
-lesshungry(num)
-int num;
+lesshungry(int num)
{
/* See comments in newuhs() for discussion on force_save_hs */
boolean iseating = (g.occupation == eatfood) || g.force_save_hs;
}
static int
-unfaint(VOID_ARGS)
+unfaint(void)
{
(void) Hear_again();
if (u.uhs > FAINTING)
}
boolean
-is_fainted()
+is_fainted(void)
{
return (boolean) (u.uhs == FAINTED);
}
/* call when a faint must be prematurely terminated */
void
-reset_faint()
+reset_faint(void)
{
if (g.afternmv == unfaint)
unmul("You revive.");
/* compute and comment on your (new?) hunger status */
void
-newuhs(incr)
-boolean incr;
+newuhs(boolean incr)
{
unsigned newhs;
static unsigned save_hs;
/* getobj callback for object to eat - effectively just wraps is_edible() */
static int
-eat_ok(obj)
-struct obj *obj;
+eat_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* getobj callback for object to be offered (corpses and things that look like
* the Amulet only */
static int
-offer_ok(obj)
-struct obj *obj;
+offer_ok(struct obj *obj)
{
if (!obj || (obj->oclass != FOOD_CLASS && obj->oclass != AMULET_CLASS))
return GETOBJ_EXCLUDE;
/* getobj callback for object to be tinned */
static int
-tin_ok(obj)
-struct obj *obj;
+tin_ok(struct obj *obj)
{
if (!obj || obj->oclass != FOOD_CLASS)
return GETOBJ_EXCLUDE;
* Object may be either on floor or in inventory.
*/
struct obj *
-floorfood(verb, corpsecheck)
-const char *verb;
-int corpsecheck; /* 0, no check, 1, corpses, 2, tinnable corpses */
+floorfood(const char *verb,
+ int corpsecheck) /* 0, no check, 1, corpses, 2, tinnable corpses */
{
register struct obj *otmp;
char qbuf[QBUFSZ];
/* Side effects of vomiting */
/* added nomul (MRS) - it makes sense, you're too busy being sick! */
void
-vomit() /* A good idea from David Neves */
+vomit(void) /* A good idea from David Neves */
{
if (cantvomit(g.youmonst.data)) {
/* doesn't cure food poisoning; message assumes that we aren't
}
int
-eaten_stat(base, obj)
-int base;
-struct obj *obj;
+eaten_stat(int base, struct obj *obj)
{
long uneaten_amt, full_amount;
/* reduce obj's oeaten field, making sure it never hits or passes 0 */
void
-consume_oeaten(obj, amt)
-struct obj *obj;
-int amt;
+consume_oeaten(struct obj *obj, int amt)
{
/*
* This is a hack to try to squelch several long standing mystery
/* called when eatfood occupation has been interrupted,
or in the case of theft, is about to be interrupted */
boolean
-maybe_finished_meal(stopping)
-boolean stopping;
+maybe_finished_meal(boolean stopping)
{
/* in case consume_oeaten() has decided that the food is all gone */
if (g.occupation == eatfood
effects there take place on first bite rather than at end of occupation.
[Popeye the Sailor gets out of trouble by eating tins of spinach. :-] */
boolean
-Popeye(threat)
-int threat;
+Popeye(int threat)
{
struct obj *otin;
int mndx;
#define nowrap_add(a, b) (a = ((a + b) < 0 ? LONG_MAX : (a + b)))
#ifndef NO_SIGNAL
-static void FDECL(done_intr, (int));
+static void done_intr(int);
#if defined(UNIX) || defined(VMS) || defined(__EMX__)
-static void FDECL(done_hangup, (int));
+static void done_hangup(int);
#endif
#endif
-static void FDECL(disclose, (int, BOOLEAN_P));
-static void FDECL(get_valuables, (struct obj *));
-static void FDECL(sort_valuables, (struct valuable_data *, int));
-static void NDECL(done_object_cleanup);
-static void FDECL(artifact_score, (struct obj *, BOOLEAN_P, winid));
-static void FDECL(really_done, (int)) NORETURN;
-static void FDECL(savelife, (int));
-static boolean FDECL(should_query_disclose_option, (int, char *));
+static void disclose(int, boolean);
+static void get_valuables(struct obj *);
+static void sort_valuables(struct valuable_data *, int);
+static void done_object_cleanup(void);
+static void artifact_score(struct obj *, boolean, winid);
+static void really_done(int) NORETURN;
+static void savelife(int);
+static boolean should_query_disclose_option(int, char *);
#ifdef DUMPLOG
-static void NDECL(dump_plines);
+static void dump_plines(void);
#endif
-static void FDECL(dump_everything, (int, time_t));
+static void dump_everything(int, time_t);
#if defined(__BEOS__) || defined(MICRO) || defined(OS2) || defined(WIN32)
-extern void FDECL(nethack_exit, (int)) NORETURN;
+extern void nethack_exit(int) NORETURN;
#else
#define nethack_exit exit
#endif
#endif
#endif
-static void NDECL(NH_abort);
+static void NH_abort(void);
#ifndef NO_SIGNAL
-static void FDECL(panictrace_handler, (int));
+static void panictrace_handler(int);
#endif
-static boolean NDECL(NH_panictrace_libc);
-static boolean NDECL(NH_panictrace_gdb);
+static boolean NH_panictrace_libc(void);
+static boolean NH_panictrace_gdb(void);
#ifndef NO_SIGNAL
/* called as signal() handler, so sent at least one arg */
/*ARGUSED*/
void
-panictrace_handler(sig_unused)
-int sig_unused UNUSED;
+panictrace_handler(int sig_unused UNUSED)
{
#define SIG_MSG "\nSignal received.\n"
int f2;
}
void
-panictrace_setsignals(set)
-boolean set;
+panictrace_setsignals(boolean set)
{
#define SETSIGNAL(sig) \
(void) signal(sig, set ? (SIG_RET_TYPE) panictrace_handler : SIG_DFL);
#endif /* NO_SIGNAL */
static void
-NH_abort()
+NH_abort(void)
{
int gdb_prio = SYSOPT_PANICTRACE_GDB;
int libc_prio = SYSOPT_PANICTRACE_LIBC;
}
static boolean
-NH_panictrace_libc()
+NH_panictrace_libc(void)
{
#ifdef PANICTRACE_LIBC
void *bt[20];
#endif /* PANICTRACE_GDB */
static boolean
-NH_panictrace_gdb()
+NH_panictrace_gdb(void)
{
#ifdef PANICTRACE_GDB
/* A (more) generic method to get a stack trace - invoke
static boolean Schroedingers_cat = FALSE;
+/* called as signal() handler, so sent at least one arg */
/*ARGSUSED*/
void
-done1(sig_unused) /* called as signal() handler, so sent at least one arg */
-int sig_unused UNUSED;
+done1(int sig_unused UNUSED)
{
#ifndef NO_SIGNAL
(void) signal(SIGINT, SIG_IGN);
/* "#quit" command or keyboard interrupt */
int
-done2()
+done2(void)
{
if (iflags.debug_fuzzer)
return 0;
}
#ifndef NO_SIGNAL
+/* called as signal() handler, so sent at least 1 arg */
/*ARGSUSED*/
static void
-done_intr(sig_unused) /* called as signal() handler, so sent at least 1 arg */
-int sig_unused UNUSED;
+done_intr(int sig_unused UNUSED)
{
done_stopprint++;
(void) signal(SIGINT, SIG_IGN);
#if defined(UNIX) || defined(VMS) || defined(__EMX__)
/* signal() handler */
static void
-done_hangup(sig)
-int sig;
+done_hangup(int sig)
{
g.program_state.done_hup++;
- sethanguphandler((void FDECL((*), (int) )) SIG_IGN);
+ sethanguphandler((void (*)(int)) SIG_IGN);
done_intr(sig);
return;
}
#endif /* NO_SIGNAL */
void
-done_in_by(mtmp, how)
-struct monst *mtmp;
-int how;
+done_in_by(struct monst *mtmp, int how)
{
char buf[BUFSZ];
struct permonst *mptr = mtmp->data,
/* clear away while-helpless when the cause of death caused that
helplessness (ie, "petrified by <foo> while getting stoned") */
static void
-fixup_death(how)
-int how;
+fixup_death(int how)
{
int i;
}
static boolean
-should_query_disclose_option(category, defquery)
-int category;
-char *defquery;
+should_query_disclose_option(int category, char *defquery)
{
int idx;
char disclose, *dop;
#ifdef DUMPLOG
static void
-dump_plines()
+dump_plines(void)
{
int i, j;
char buf[BUFSZ], **strp;
/*ARGSUSED*/
static void
-dump_everything(how, when)
-int how;
-time_t when; /* date+time at end of game */
+dump_everything(int how,
+ time_t when) /* date+time at end of game */
{
#ifdef DUMPLOG
char pbuf[BUFSZ], datetimebuf[24]; /* [24]: room for 64-bit bogus value */
}
static void
-disclose(how, taken)
-int how;
-boolean taken;
+disclose(int how, boolean taken)
{
char c = '\0', defquery;
char qbuf[QBUFSZ];
/* try to get the player back in a viable state after being killed */
static void
-savelife(how)
-int how;
+savelife(int how)
{
int uhpmin = max(2 * u.ulevel, 10);
* intact.
*/
static void
-get_valuables(list)
-struct obj *list; /* inventory or container contents */
+get_valuables(struct obj *list) /* inventory or container contents */
{
register struct obj *obj;
register int i;
* as easily use qsort, but we don't care about efficiency here.
*/
static void
-sort_valuables(list, size)
-struct valuable_data list[];
-int size; /* max value is less than 20 */
+sort_valuables(struct valuable_data list[],
+ int size) /* max value is less than 20 */
{
register int i, j;
struct valuable_data ltmp;
* odds_and_ends() was used for 3.6.0 and 3.6.1.
* Schroedinger's Cat is handled differently as of 3.6.2.
*/
-static boolean FDECL(odds_and_ends, (struct obj *, int));
+static boolean odds_and_ends(struct obj *, int);
#define CAT_CHECK 2
static boolean
-odds_and_ends(list, what)
-struct obj *list;
-int what;
+odds_and_ends(struct obj *list, int what)
{
struct obj *otmp;
/* deal with some objects which may be in an abnormal state at end of game */
static void
-done_object_cleanup()
+done_object_cleanup(void)
{
int ox, oy;
/* called twice; first to calculate total, then to list relevant items */
static void
-artifact_score(list, counting, endwin)
-struct obj *list;
-boolean counting; /* true => add up points; false => display them */
-winid endwin;
+artifact_score(struct obj *list,
+ boolean counting, /* true => add up points;
+ false => display them */
+ winid endwin)
{
char pbuf[BUFSZ];
struct obj *otmp;
/* Be careful not to call panic from here! */
void
-done(how)
-int how;
+done(int how)
{
boolean survive = FALSE;
/* separated from done() in order to specify the __noreturn__ attribute */
static void
-really_done(how)
-int how;
+really_done(int how)
{
boolean taken;
char pbuf[BUFSZ];
}
void
-container_contents(list, identified, all_containers, reportempty)
-struct obj *list;
-boolean identified, all_containers, reportempty;
+container_contents(struct obj *list, boolean identified,
+ boolean all_containers, boolean reportempty)
{
register struct obj *box, *obj;
char buf[BUFSZ];
? SORTLOOT_LOOT : 0)
| (flags.sortpack ? SORTLOOT_PACK : 0));
sortedcobj = sortloot(&box->cobj, sortflags, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0);
+ (boolean (*)(OBJ_P)) 0);
for (srtc = sortedcobj; ((obj = srtc->obj) != 0); ++srtc) {
if (identified) {
discover_object(obj->otyp, TRUE, FALSE);
/* should be called with either EXIT_SUCCESS or EXIT_FAILURE */
void
-nh_terminate(status)
-int status;
+nh_terminate(int status)
{
g.program_state.in_moveloop = 0; /* won't be returning to normal play */
#ifdef MAC
/* set a delayed killer, ensure non-delayed killer is cleared out */
void
-delayed_killer(id, format, killername)
-int id;
-int format;
-const char *killername;
+delayed_killer(int id, int format, const char *killername)
{
struct kinfo *k = find_delayed_killer(id);
}
struct kinfo *
-find_delayed_killer(id)
-int id;
+find_delayed_killer(int id)
{
struct kinfo *k;
}
void
-dealloc_killer(kptr)
-struct kinfo *kptr;
+dealloc_killer(struct kinfo *kptr)
{
struct kinfo *prev = &g.killer, *k;
}
void
-save_killers(nhfp)
-NHFILE *nhfp;
+save_killers(NHFILE *nhfp)
{
struct kinfo *kptr;
}
void
-restore_killers(nhfp)
-NHFILE *nhfp;
+restore_killers(NHFILE *nhfp)
{
struct kinfo *kptr;
}
static int
-wordcount(p)
-char *p;
+wordcount(char *p)
{
int words = 0;
}
static void
-bel_copy1(inp, out)
-char **inp, *out;
+bel_copy1(char **inp, char *out)
{
char *in = *inp;
}
char *
-build_english_list(in)
-char *in;
+build_english_list(char *in)
{
char *out, *p = in;
int len = (int) strlen(p), words = wordcount(p);
#include "hack.h"
-static int FDECL(stylus_ok, (struct obj *));
-static const char *NDECL(blengr);
+static int stylus_ok(struct obj *);
+static const char *blengr(void);
char *
-random_engraving(outbuf)
-char *outbuf;
+random_engraving(char *outbuf)
{
const char *rumor;
/* degrade some of the characters in a string */
void
-wipeout_text(engr, cnt, seed)
-char *engr;
-int cnt;
-unsigned seed; /* for semi-controlled randomization */
+wipeout_text(char *engr, int cnt,
+ unsigned seed) /* for semi-controlled randomization */
{
char *s;
int i, j, nxt, use_rubout, lth = (int) strlen(engr);
/* check whether hero can reach something at ground level */
boolean
-can_reach_floor(check_pit)
-boolean check_pit;
+can_reach_floor(boolean check_pit)
{
struct trap *t;
/* give a message after caller has determined that hero can't reach */
void
-cant_reach_floor(x, y, up, check_pit)
-int x, y;
-boolean up, check_pit;
+cant_reach_floor(int x, int y, boolean up, boolean check_pit)
{
You("can't reach the %s.",
up ? ceiling(x, y)
}
const char *
-surface(x, y)
-register int x, y;
+surface(register int x, register int y)
{
register struct rm *lev = &levl[x][y];
}
const char *
-ceiling(x, y)
-register int x, y;
+ceiling(register int x, register int y)
{
register struct rm *lev = &levl[x][y];
const char *what;
}
struct engr *
-engr_at(x, y)
-xchar x, y;
+engr_at(xchar x, xchar y)
{
register struct engr *ep = head_engr;
* present if it is intact and is the entire content of the engraving.
*/
int
-sengr_at(s, x, y, strict)
-const char *s;
-xchar x, y;
-boolean strict;
+sengr_at(const char *s, xchar x, xchar y, boolean strict)
{
register struct engr *ep = engr_at(x, y);
}
void
-u_wipe_engr(cnt)
-int cnt;
+u_wipe_engr(int cnt)
{
if (can_reach_floor(TRUE))
wipe_engr_at(u.ux, u.uy, cnt, FALSE);
}
void
-wipe_engr_at(x, y, cnt, magical)
-xchar x, y, cnt;
-boolean magical;
+wipe_engr_at(xchar x, xchar y, xchar cnt, boolean magical)
{
register struct engr *ep = engr_at(x, y);
}
void
-read_engr_at(x, y)
-int x, y;
+read_engr_at(int x, int y)
{
register struct engr *ep = engr_at(x, y);
int sensed = 0;
}
void
-make_engr_at(x, y, s, e_time, e_type)
-int x, y;
-const char *s;
-long e_time;
-xchar e_type;
+make_engr_at(int x, int y, const char *s, long e_time, xchar e_type)
{
struct engr *ep;
unsigned smem = strlen(s) + 1;
/* delete any engraving at location <x,y> */
void
-del_engr_at(x, y)
-int x, y;
+del_engr_at(int x, int y)
{
register struct engr *ep = engr_at(x, y);
* freehand - returns true if player has a free hand
*/
int
-freehand()
+freehand(void)
{
return (!uwep || !welded(uwep)
|| (!bimanual(uwep) && (!uarms || !uarms->cursed)));
/* getobj callback for an object to engrave with */
static int
-stylus_ok(obj)
-struct obj *obj;
+stylus_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_SUGGEST;
/* return 1 if action took 1 (or more) moves, 0 if error or aborted */
int
-doengrave()
+doengrave(void)
{
boolean dengr = FALSE; /* TRUE if we wipe out the current engraving */
boolean doblind = FALSE; /* TRUE if engraving blinds the player */
/* while loading bones, clean up text which might accidentally
or maliciously disrupt player's terminal when displayed */
void
-sanitize_engravings()
+sanitize_engravings(void)
{
struct engr *ep;
}
void
-save_engravings(nhfp)
-NHFILE *nhfp;
+save_engravings(NHFILE *nhfp)
{
struct engr *ep, *ep2;
unsigned no_more_engr = 0;
}
void
-rest_engravings(nhfp)
-NHFILE *nhfp;
+rest_engravings(NHFILE *nhfp)
{
struct engr *ep;
unsigned lth = 0;
/* to support '#stats' wizard-mode command */
void
-engr_stats(hdrfmt, hdrbuf, count, size)
-const char *hdrfmt;
-char *hdrbuf;
-long *count, *size;
+engr_stats(const char *hdrfmt, char *hdrbuf, long *count, long *size)
{
struct engr *ep;
}
void
-del_engr(ep)
-register struct engr *ep;
+del_engr(register struct engr *ep)
{
if (ep == head_engr) {
head_engr = ep->nxt_engr;
/* randomly relocate an engraving */
void
-rloc_engr(ep)
-struct engr *ep;
+rloc_engr(struct engr *ep)
{
int tx, ty, tryct = 200;
* The caller is responsible for newsym(x, y).
*/
void
-make_grave(x, y, str)
-int x, y;
-const char *str;
+make_grave(int x, int y, const char *str)
{
char buf[BUFSZ];
};
static const char *
-blengr(VOID_ARGS)
+blengr(void)
{
return blind_writing[rn2(SIZE(blind_writing))];
}
#include <limits.h>
#endif
-static int FDECL(enermod, (int));
+static int enermod(int);
long
-newuexp(lev)
-int lev;
+newuexp(int lev)
{
if (lev < 1) /* for newuexp(u.ulevel - 1) when u.ulevel is 1 */
return 0L;
}
static int
-enermod(en)
-int en;
+enermod(int en)
{
switch (Role_switch) {
case PM_CLERIC:
/* calculate spell power/energy points for new level */
int
-newpw()
+newpw(void)
{
int en = 0, enrnd, enfix;
/* return # of exp points for mtmp after nk killed */
int
-experience(mtmp, nk)
-register struct monst *mtmp;
-register int nk;
+experience(register struct monst *mtmp, register int nk)
{
register struct permonst *ptr = mtmp->data;
int i, tmp, tmp2;
}
void
-more_experienced(exper, rexp)
-register int exper, rexp;
+more_experienced(register int exper, register int rexp)
{
long oldexp = u.uexp,
oldrexp = u.urexp,
/* e.g., hit by drain life attack */
void
-losexp(drainer)
-const char *drainer; /* cause of death, if drain should be fatal */
+losexp(const char *drainer) /* cause of death, if drain should be fatal */
{
register int num;
* at a dragon created with a wand of polymorph??
*/
void
-newexplevel()
+newexplevel(void)
{
if (u.ulevel < MAXULEV && u.uexp >= newuexp(u.ulevel))
pluslvl(TRUE);
}
void
-pluslvl(incr)
-boolean incr; /* true iff via incremental experience growth */
-{ /* (false for potion of gain level) */
+pluslvl(boolean incr) /* true iff via incremental experience growth */
+{ /* (false for potion of gain level) */
int hpinc, eninc;
if (!incr)
experience level: base number of points needed to reach the current
level plus a random portion of what it takes to get to the next level */
long
-rndexp(gaining)
-boolean gaining; /* gaining XP via potion vs setting XP for polyself */
+rndexp(boolean gaining) /* gaining XP via potion vs setting XP for polyself */
{
long minexp, maxexp, diff, factor, result;
* that Half_physical_damage only affects the damage applied to the hero.
*/
void
-explode(x, y, type, dam, olet, expltype)
-int x, y;
-int type; /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */
-int dam;
-char olet;
-int expltype;
+explode(int x, int y,
+ int type, /* the same as in zap.c; passes -(wand typ) for some WAND_CLASS */
+ int dam, char olet, int expltype)
{
int i, j, k, damu = dam;
boolean starting = 1;
/* returns number of scattered objects */
long
-scatter(sx, sy, blastforce, scflags, obj)
-int sx, sy; /* location of objects to scatter */
-int blastforce; /* force behind the scattering */
-unsigned int scflags;
-struct obj *obj; /* only scatter this obj */
+scatter(int sx, int sy, /* location of objects to scatter */
+ int blastforce, /* force behind the scattering */
+ unsigned int scflags,
+ struct obj *obj) /* only scatter this obj */
{
register struct obj *otmp;
register int tmp;
* For now, just perform a "regular" explosion.
*/
void
-splatter_burning_oil(x, y, diluted_oil)
-int x, y;
-boolean diluted_oil;
+splatter_burning_oil(int x, int y, boolean diluted_oil)
{
int dmg = d(diluted_oil ? 3 : 4, 4);
/* lit potion of oil is exploding; extinguish it as a light source before
possibly killing the hero and attempting to save bones */
void
-explode_oil(obj, x, y)
-struct obj *obj;
-int x, y;
+explode_oil(struct obj *obj, int x, int y)
{
boolean diluted_oil = obj->odiluted;
#define LEFT 4
#define RIGHT 8
-static void FDECL(roguejoin, (int, int, int, int, int));
-static void FDECL(roguecorr, (int, int, int));
-static void FDECL(miniwalk, (int, int));
+static void roguejoin(int, int, int, int, int);
+static void roguecorr(int, int, int);
+static void miniwalk(int, int);
static
void
-roguejoin(x1, y1, x2, y2, horiz)
-int x1, y1, x2, y2;
-int horiz;
+roguejoin(int x1, int y1, int x2, int y2, int horiz)
{
register int x, y, middle;
if (horiz) {
static
void
-roguecorr(x, y, dir)
-int x, y, dir;
+roguecorr(int x, int y, int dir)
{
register int fromx, fromy, tox, toy;
/* Modified walkfrom() from mkmaze.c */
static
void
-miniwalk(x, y)
-int x, y;
+miniwalk(int x, int y)
{
register int q, dir;
int dirs[4];
}
void
-makeroguerooms()
+makeroguerooms(void)
{
register int x, y;
/* Rogue levels are structured 3 by 3, with each section containing
}
void
-corr(x, y)
-int x, y;
+corr(int x, int y)
{
if (rn2(50)) {
levl[x][y].typ = CORR;
}
void
-makerogueghost()
+makerogueghost(void)
{
register struct monst *ghost;
struct obj *ghostobj;
#include <share.h>
#endif
-static FILE *NDECL(fopen_wizkit_file);
-static void FDECL(wizkit_addinv, (struct obj *));
+static FILE *fopen_wizkit_file(void);
+static void wizkit_addinv(struct obj *);
#ifdef AMIGA
extern char PATH[]; /* see sys/amiga/amidos.c */
#endif
#include <libraries/dos.h>
-extern void FDECL(amii_set_text_font, (char *, int));
+extern void amii_set_text_font(char *, int);
#endif
#if defined(WIN32) || defined(MSDOS)
#endif
#ifdef WIN32
/*from windmain.c */
-extern char *FDECL(translate_path_variables, (const char *, char *));
+extern char *translate_path_variables(const char *, char *);
#endif
#endif
extern char *sounddir; /* defined in sounds.c */
#endif
-static NHFILE *NDECL(new_nhfile);
-static void FDECL(free_nhfile, (NHFILE *));
+static NHFILE *new_nhfile(void);
+static void free_nhfile(NHFILE *);
#ifdef SELECTSAVED
-static int FDECL(CFDECLSPEC strcmp_wrap, (const void *, const void *));
+static int CFDECLSPEC strcmp_wrap(const void *, const void *);
#endif
-static char *FDECL(set_bonesfile_name, (char *, d_level *));
-static char *NDECL(set_bonestemp_name);
+static char *set_bonesfile_name(char *, d_level *);
+static char *set_bonestemp_name(void);
#ifdef COMPRESS
-static void FDECL(redirect, (const char *, const char *, FILE *,
- BOOLEAN_P));
+static void redirect(const char *, const char *, FILE *, boolean);
#endif
#if defined(COMPRESS) || defined(ZLIB_COMP)
-static void FDECL(docompress_file, (const char *, BOOLEAN_P));
+static void docompress_file(const char *, boolean);
#endif
#if defined(ZLIB_COMP)
-static boolean FDECL(make_compressed_name, (const char *, char *));
+static boolean make_compressed_name(const char *, char *);
#endif
#ifndef USE_FCNTL
-static char *FDECL(make_lockname, (const char *, char *));
-#endif
-static void FDECL(set_configfile_name, (const char *));
-static FILE *FDECL(fopen_config_file, (const char *, int));
-static int FDECL(get_uchars, (char *, uchar *, BOOLEAN_P,
- int, const char *));
-boolean FDECL(proc_wizkit_line, (char *));
-boolean FDECL(parse_config_line, (char *));
-static boolean FDECL(parse_conf_file, (FILE *, boolean (*proc)(char *)));
-static FILE *NDECL(fopen_sym_file);
-boolean FDECL(proc_symset_line, (char *));
-static void FDECL(set_symhandling, (char *, int));
+static char *make_lockname(const char *, char *);
+#endif
+static void set_configfile_name(const char *);
+static FILE *fopen_config_file(const char *, int);
+static int get_uchars(char *, uchar *, boolean, int, const char *);
+boolean proc_wizkit_line(char *);
+boolean parse_config_line(char *);
+static boolean parse_conf_file(FILE *, boolean (*proc)(char *));
+static FILE *fopen_sym_file(void);
+boolean proc_symset_line(char *);
+static void set_symhandling(char *, int);
#ifdef NOCWD_ASSUMPTIONS
-static void FDECL(adjust_prefix, (char *, int));
+static void adjust_prefix(char *, int);
#endif
-static boolean FDECL(config_error_nextline, (const char *));
-static void NDECL(free_config_sections);
-static char *FDECL(choose_random_part, (char *, CHAR_P));
-static char *FDECL(is_config_section, (char *));
-static boolean FDECL(handle_config_section, (char *));
-static char *FDECL(find_optparam, (const char *));
-static void FDECL(parseformat, (int *, char *));
+static boolean config_error_nextline(const char *);
+static void free_config_sections(void);
+static char *choose_random_part(char *, char);
+static char *is_config_section(char *);
+static boolean handle_config_section(char *);
+static char *find_optparam(const char *);
+static void parseformat(int *, char *);
#ifdef SELF_RECOVER
-static boolean FDECL(copy_bytes, (int, int));
+static boolean copy_bytes(int, int);
#endif
-static NHFILE *FDECL(viable_nhfile, (NHFILE *));
+static NHFILE *viable_nhfile(NHFILE *);
/*
* fname_encode()
* "This%20is%20a%20%25%20test%21"
*/
char *
-fname_encode(legal, quotechar, s, callerbuf, bufsz)
-const char *legal;
-char quotechar;
-char *s, *callerbuf;
-int bufsz;
+fname_encode(const char *legal, char quotechar, char *s, char *callerbuf, int bufsz)
{
char *sp, *op;
int cnt = 0;
* bufsz size of callerbuf
*/
char *
-fname_decode(quotechar, s, callerbuf, bufsz)
-char quotechar;
-char *s, *callerbuf;
-int bufsz;
+fname_decode(char quotechar, char *s, char *callerbuf, int bufsz)
{
char *sp, *op;
int k, calc, cnt = 0;
/*ARGSUSED*/
const char *
-fqname(basenam, whichprefix, buffnum)
-const char *basenam;
-int whichprefix UNUSED_if_not_PREFIXES_IN_USE;
-int buffnum UNUSED_if_not_PREFIXES_IN_USE;
+fqname(const char *basenam,
+ int whichprefix UNUSED_if_not_PREFIXES_IN_USE,
+ int buffnum UNUSED_if_not_PREFIXES_IN_USE)
{
#ifdef PREFIXES_IN_USE
char *bufptr;
#endif /* !PREFIXES_IN_USE */
}
+/* reasonbuf must be at least BUFSZ, supplied by caller */
int
-validate_prefix_locations(reasonbuf)
-char *reasonbuf; /* reasonbuf must be at least BUFSZ, supplied by caller */
+validate_prefix_locations(char *reasonbuf)
{
#if defined(NOCWD_ASSUMPTIONS)
FILE *fp;
/* fopen a file, with OS-dependent bells and whistles */
/* NOTE: a simpler version of this routine also exists in util/dlb_main.c */
FILE *
-fopen_datafile(filename, mode, prefix)
-const char *filename, *mode;
-int prefix;
+fopen_datafile(const char *filename, const char *mode, int prefix)
{
FILE *fp;
#define IS_BIGENDIAN() ( (*(char*)&bei) == 0 )
void
-zero_nhfile(nhfp)
-NHFILE *nhfp;
+zero_nhfile(NHFILE *nhfp)
{
if (nhfp) {
nhfp->fd = -1;
}
static NHFILE *
-new_nhfile()
+new_nhfile(void)
{
NHFILE *nhfp = (NHFILE *)alloc(sizeof(NHFILE));
}
static void
-free_nhfile(nhfp)
-NHFILE *nhfp;
+free_nhfile(NHFILE *nhfp)
{
if (nhfp) {
zero_nhfile(nhfp);
}
void
-close_nhfile(nhfp)
-NHFILE *nhfp;
+close_nhfile(NHFILE *nhfp)
{
if (nhfp) {
if (nhfp->structlevel && nhfp->fd != -1)
}
void
-rewind_nhfile(nhfp)
-NHFILE *nhfp;
+rewind_nhfile(NHFILE *nhfp)
{
if (nhfp->structlevel) {
#ifdef BSD
static
NHFILE *
-viable_nhfile(nhfp)
-NHFILE *nhfp;
+viable_nhfile(NHFILE *nhfp)
{
/* perform some sanity checks before returning
the pointer to the nethack file descriptor */
* but be careful if you use it for other things -dgk
*/
void
-set_levelfile_name(file, lev)
-char *file;
-int lev;
+set_levelfile_name(char *file, int lev)
{
char *tf;
}
NHFILE *
-create_levelfile(lev, errbuf)
-int lev;
-char errbuf[];
+create_levelfile(int lev, char errbuf[])
{
const char *fq_lock;
NHFILE *nhfp = (NHFILE *) 0;
}
NHFILE *
-open_levelfile(lev, errbuf)
-int lev;
-char errbuf[];
+open_levelfile(int lev, char errbuf[])
{
const char *fq_lock;
NHFILE *nhfp = (NHFILE *) 0;
}
void
-delete_levelfile(lev)
-int lev;
+delete_levelfile(int lev)
{
/*
* Level 0 might be created by port specific code that doesn't
}
void
-clearlocks()
+clearlocks(void)
{
int x;
#ifndef NO_SIGNAL
(void) signal(SIGINT, SIG_IGN);
#if defined(UNIX) || defined(VMS)
- sethanguphandler((void FDECL((*), (int) )) SIG_IGN);
+ sethanguphandler((void (*)(int)) SIG_IGN);
#endif
#endif /* NO_SIGNAL */
/* can't access maxledgerno() before dungeons are created -dlc */
#if defined(SELECTSAVED)
/* qsort comparison routine */
static int CFDECLSPEC
-strcmp_wrap(p, q)
-const void *p;
-const void *q;
+strcmp_wrap(const void *p, const void *q)
{
#if defined(UNIX) && defined(QT_GRAPHICS)
return strncasecmp(*(char **) p, *(char **) q, 16);
#endif
int
-nhclose(fd)
-int fd;
+nhclose(int fd)
{
int retval = 0;
* bonesid to be read/written in the bones file.
*/
static char *
-set_bonesfile_name(file, lev)
-char *file;
-d_level *lev;
+set_bonesfile_name(char *file, d_level *lev)
{
s_level *sptr;
char *dptr;
* the same array may be used instead of copying.)
*/
static char *
-set_bonestemp_name()
+set_bonestemp_name(void)
{
char *tf;
}
NHFILE *
-create_bonesfile(lev, bonesid, errbuf)
-d_level *lev;
-char **bonesid;
-char errbuf[];
+create_bonesfile(d_level *lev, char **bonesid, char errbuf[])
{
const char *file;
NHFILE *nhfp = (NHFILE *) 0;
/* move completed bones file to proper name */
void
-commit_bonesfile(lev)
-d_level *lev;
+commit_bonesfile(d_level *lev)
{
const char *fq_bones, *tempname;
int ret;
}
NHFILE *
-open_bonesfile(lev, bonesid)
-d_level *lev;
-char **bonesid;
+open_bonesfile(d_level *lev, char **bonesid)
{
const char *fq_bones;
NHFILE *nhfp = (NHFILE *) 0;
}
int
-delete_bonesfile(lev)
-d_level *lev;
+delete_bonesfile(d_level *lev)
{
(void) set_bonesfile_name(g.bones, lev);
return !(unlink(fqname(g.bones, BONESPREFIX, 0)) < 0);
/* assume we're compressing the recently read or created bonesfile, so the
* file name is already set properly */
void
-compress_bonesfile()
+compress_bonesfile(void)
{
nh_compress(fqname(g.bones, BONESPREFIX, 0));
}
/* set savefile name in OS-dependent manner from pre-existing g.plname,
* avoiding troublesome characters */
void
-set_savefile_name(regularize_it)
-boolean regularize_it;
+set_savefile_name(boolean regularize_it)
{
int regoffset = 0, overflow = 0,
indicator_spot = 0; /* 0=no indicator, 1=before ext, 2=after ext */
#ifdef INSURANCE
void
-save_savefile_name(nhfp)
-NHFILE *nhfp;
+save_savefile_name(NHFILE *nhfp)
{
if (nhfp->structlevel)
(void) write(nhfp->fd, (genericptr_t) g.SAVEF, sizeof(g.SAVEF));
#ifndef MICRO
/* change pre-existing savefile name to indicate an error savefile */
void
-set_error_savefile()
+set_error_savefile(void)
{
#ifdef VMS
{
/* create save file, overwriting one if it already exists */
NHFILE *
-create_savefile()
+create_savefile(void)
{
const char *fq_save;
NHFILE *nhfp = (NHFILE *) 0;
/* open savefile for reading */
NHFILE *
-open_savefile()
+open_savefile(void)
{
const char *fq_save;
NHFILE *nhfp = (NHFILE *) 0;
/* delete savefile */
int
-delete_savefile()
+delete_savefile(void)
{
(void) unlink(fqname(g.SAVEF, SAVEPREFIX, 0));
return 0; /* for restore_saved_game() (ex-xxxmain.c) test */
/* try to open up a save file and prepare to restore it */
NHFILE *
-restore_saved_game()
+restore_saved_game(void)
{
const char *fq_save;
NHFILE *nhfp = (NHFILE *) 0;
#if defined(SELECTSAVED)
char *
-plname_from_file(filename)
-const char *filename;
+plname_from_file(const char *filename)
{
NHFILE *nhfp = (NHFILE *) 0;
char *result = 0;
#endif /* defined(SELECTSAVED) */
char **
-get_saved_games()
+get_saved_games(void)
{
#if defined(SELECTSAVED)
#if defined(WIN32) || defined(UNIX)
}
void
-free_saved_games(saved)
-char **saved;
+free_saved_games(char **saved)
{
if (saved) {
int i = 0;
#ifdef COMPRESS
static void
-redirect(filename, mode, stream, uncomp)
-const char *filename, *mode;
-FILE *stream;
-boolean uncomp;
+redirect(const char *filename, const char *mode, FILE *stream, boolean uncomp)
{
if (freopen(filename, mode, stream) == (FILE *) 0) {
const char *details;
* cf. child() in unixunix.c.
*/
static void
-docompress_file(filename, uncomp)
-const char *filename;
-boolean uncomp;
+docompress_file(const char *filename, boolean uncomp)
{
char cfn[SAVESIZE];
FILE *cf;
/* compress file */
void
-nh_compress(filename)
-const char *filename UNUSED_if_not_COMPRESS;
+nh_compress(const char *filename UNUSED_if_not_COMPRESS)
{
#if !defined(COMPRESS) && !defined(ZLIB_COMP)
#ifdef PRAGMA_UNUSED
/* uncompress file if it exists */
void
-nh_uncompress(filename)
-const char *filename UNUSED_if_not_COMPRESS;
+nh_uncompress(const char *filename UNUSED_if_not_COMPRESS)
{
#if !defined(COMPRESS) && !defined(ZLIB_COMP)
#ifdef PRAGMA_UNUSED
#ifdef ZLIB_COMP /* RLC 09 Mar 1999: Support internal ZLIB */
static boolean
-make_compressed_name(filename, cfn)
-const char *filename;
-char *cfn;
+make_compressed_name(const char *filename, char *cfn)
{
#ifndef SHORT_FILENAMES
/* Assume free-form filename with no 8.3 restrictions */
}
static void
-docompress_file(filename, uncomp)
-const char *filename;
-boolean uncomp;
+docompress_file(const char *filename, boolean uncomp)
{
gzFile compressedfile;
FILE *uncompressedfile;
#ifndef USE_FCNTL
static char *
-make_lockname(filename, lockname)
-const char *filename;
-char *lockname;
+make_lockname(const char *filename, char *lockname)
{
#if defined(UNIX) || defined(VMS) || defined(AMIGA) || defined(WIN32) \
|| defined(MSDOS)
/* lock a file */
boolean
-lock_file(filename, whichprefix, retryct)
-const char *filename;
-int whichprefix;
-int retryct;
+lock_file(const char *filename, int whichprefix, int retryct)
{
#if defined(PRAGMA_UNUSED) && !(defined(UNIX) || defined(VMS)) \
&& !(defined(AMIGA) || defined(WIN32) || defined(MSDOS))
/* unlock file, which must be currently locked by lock_file */
void
-unlock_file(filename)
-const char *filename;
+unlock_file(const char *filename)
{
#ifndef USE_FCNTL
char locknambuf[BUFSZ];
/* remember the name of the file we're accessing;
if may be used in option reject messages */
static void
-set_configfile_name(fname)
-const char *fname;
+set_configfile_name(const char *fname)
{
(void) strncpy(configfile, fname, sizeof configfile - 1);
configfile[sizeof configfile - 1] = '\0';
}
static FILE *
-fopen_config_file(filename, src)
-const char *filename;
-int src;
+fopen_config_file(const char *filename, int src)
{
FILE *fp;
#if defined(UNIX) || defined(VMS)
* location is unchanged. Callers must handle zeros if modlist is FALSE.
*/
static int
-get_uchars(bufp, list, modlist, size, name)
-char *bufp; /* current pointer */
-uchar *list; /* return list */
-boolean modlist; /* TRUE: list is being modified in place */
-int size; /* return list size */
-const char *name; /* name of option for error message */
+get_uchars(char *bufp, /* current pointer */
+ uchar *list, /* return list */
+ boolean modlist, /* TRUE: list is being modified in place */
+ int size, /* return list size */
+ const char *name) /* name of option for error message */
{
unsigned int num = 0;
int count = 0;
#ifdef NOCWD_ASSUMPTIONS
static void
-adjust_prefix(bufp, prefixid)
-char *bufp;
-int prefixid;
+adjust_prefix(char *bufp, int prefixid)
{
char *ptr;
/* Choose at random one of the sep separated parts from str. Mangles str. */
static char *
-choose_random_part(str, sep)
-char *str;
-char sep;
+choose_random_part(char *str, char sep)
{
int nsep = 1;
int csep;
}
static void
-free_config_sections()
+free_config_sections(void)
{
if (g.config_section_chosen) {
free(g.config_section_chosen);
with spaces optional; returns pointer to "anything-except..." (with
trailing " ] #..." stripped) if ok, otherwise Null */
static char *
-is_config_section(str)
-char *str; /* trailing spaces will be stripped, ']' too iff result is good */
+is_config_section(char *str) /* trailing spaces will be stripped,
+ ']' too iff result is good */
{
char *a, *c, *z;
}
static boolean
-handle_config_section(buf)
-char *buf;
+handle_config_section(char *buf)
{
char *sect = is_config_section(buf);
/* find the '=' or ':' */
static char *
-find_optparam(buf)
-const char *buf;
+find_optparam(const char *buf)
{
char *bufp, *altp;
}
boolean
-parse_config_line(origbuf)
-char *origbuf;
+parse_config_line(char *origbuf)
{
#if defined(MICRO) && !defined(NOCWD_ASSUMPTIONS)
static boolean ramdisk_specified = FALSE;
#ifdef USER_SOUNDS
boolean
-can_read_file(filename)
-const char *filename;
+can_read_file(const char *filename)
{
return (boolean) (access(filename, 4) == 0);
}
static struct _config_error_frame *config_error_data = 0;
void
-config_error_init(from_file, sourcename, secure)
-boolean from_file;
-const char *sourcename;
-boolean secure;
+config_error_init(boolean from_file, const char *sourcename, boolean secure)
{
struct _config_error_frame *tmp = (struct _config_error_frame *)
alloc(sizeof (struct _config_error_frame));
}
static boolean
-config_error_nextline(line)
-const char *line;
+config_error_nextline(const char *line)
{
struct _config_error_frame *ced = config_error_data;
/* varargs 'config_error_add()' moved to pline.c */
void
-config_erradd(buf)
-const char *buf;
+config_erradd(const char *buf)
{
char lineno[QBUFSZ];
}
int
-config_error_done()
+config_error_done(void)
{
int n;
struct _config_error_frame *tmp = config_error_data;
}
boolean
-read_config_file(filename, src)
-const char *filename;
-int src;
+read_config_file(const char *filename, int src)
{
FILE *fp;
boolean rv = TRUE;
}
static FILE *
-fopen_wizkit_file()
+fopen_wizkit_file(void)
{
FILE *fp;
#if defined(VMS) || defined(UNIX)
/* add to hero's inventory if there's room, otherwise put item on floor */
static void
-wizkit_addinv(obj)
-struct obj *obj;
+wizkit_addinv(struct obj *obj)
{
if (!obj || obj == &cg.zeroobj)
return;
boolean
-proc_wizkit_line(buf)
-char *buf;
+proc_wizkit_line(char *buf)
{
struct obj *otmp;
}
void
-read_wizkit()
+read_wizkit(void)
{
FILE *fp;
* Continued lines are merged together with one space in between.
*/
static boolean
-parse_conf_file(fp, proc)
-FILE *fp;
-boolean FDECL((*proc), (char *));
+parse_conf_file(FILE *fp, boolean (*proc)(char *))
{
char inbuf[4 * BUFSZ];
boolean rv = TRUE; /* assume successful parse */
static
FILE *
-fopen_sym_file()
+fopen_sym_file(void)
{
FILE *fp;
* 0 if it wasn't found in the sym file or other problem.
*/
int
-read_sym_file(which_set)
-int which_set;
+read_sym_file(int which_set)
{
FILE *fp;
}
boolean
-proc_symset_line(buf)
-char *buf;
+proc_symset_line(char *buf)
{
return !((boolean) parse_sym_line(buf, g.symset_which_set));
}
/* returns 0 on error */
int
-parse_sym_line(buf, which_set)
-char *buf;
-int which_set;
+parse_sym_line(char *buf, int which_set)
{
int val, i;
struct symparse *symp;
}
static void
-set_symhandling(handling, which_set)
-char *handling;
-int which_set;
+set_symhandling(char *handling, int which_set)
{
int i = 0;
}
void
-parseformat(arr, str)
-int *arr;
-char *str;
+parseformat(int *arr, char *str)
{
const char *legal[] = {"historical", "lendian", "ascii"};
int i, kwi = 0, words = 0;
/* verify that we can write to scoreboard file; if not, try to create one */
/*ARGUSED*/
void
-check_recordfile(dir)
-const char *dir UNUSED_if_not_OS2_CODEVIEW;
+check_recordfile(const char *dir UNUSED_if_not_OS2_CODEVIEW)
{
#if defined(PRAGMA_UNUSED) && !defined(OS2_CODEVIEW)
#pragma unused(dir)
/*ARGSUSED*/
void
-paniclog(type, reason)
-const char *type; /* panic, impossible, trickery */
-const char *reason; /* explanation */
+paniclog(const char *type, /* panic, impossible, trickery */
+ const char *reason) /* explanation */
{
#ifdef PANICLOG
FILE *lfile;
}
void
-testinglog(filenm, type, reason)
-const char *filenm; /* ad hoc file name */
-const char *type;
-const char *reason; /* explanation */
+testinglog(const char *filenm, /* ad hoc file name */
+ const char *type,
+ const char *reason) /* explanation */
{
FILE *lfile;
char fnbuf[BUFSZ];
/* ---------- BEGIN INTERNAL RECOVER ----------- */
boolean
-recover_savefile()
+recover_savefile(void)
{
NHFILE *gnhfp, *lnhfp, *snhfp;
int lev, savelev, hpid, pltmpsiz, filecmc;
}
boolean
-copy_bytes(ifd, ofd)
-int ifd, ofd;
+copy_bytes(int ifd, int ofd)
{
char buf[BUFSIZ];
int nfrom, nto;
#ifdef SYSCF
#ifdef SYSCF_FILE
void
-assure_syscf_file()
+assure_syscf_file(void)
{
int fd;
* like dungeon.c and questpgr.c, which generate a ridiculous amount of
* output if DEBUG is defined and effectively block the use of a wildcard */
boolean
-debugcore(filename, wildcards)
-const char *filename;
-boolean wildcards;
+debugcore(const char *filename, boolean wildcards)
{
const char *debugfiles, *p;
#endif
void
-reveal_paths(VOID_ARGS)
+reveal_paths(void)
{
const char *fqn, *nodumpreason;
char buf[BUFSZ];
#define MAXPASSAGES SIZE(g.context.novel.pasg) /* 20 */
-static int FDECL(choose_passage, (int, unsigned));
+static int choose_passage(int, unsigned);
/* choose a random passage that hasn't been chosen yet; once all have
been chosen, reset the tracking to make all passages available again */
static int
-choose_passage(passagecnt, oid)
-int passagecnt; /* total of available passages */
-unsigned oid; /* book.o_id, used to determine whether re-reading same book */
+choose_passage(int passagecnt, /* total of available passages */
+ unsigned oid) /* book.o_id, used to determine whether
+ re-reading same book */
{
int idx, res;
/* Returns True if you were able to read something. */
boolean
-read_tribute(tribsection, tribtitle, tribpassage, nowin_buf, bufsz, oid)
-const char *tribsection, *tribtitle;
-int tribpassage, bufsz;
-char *nowin_buf;
-unsigned oid; /* book identifier */
+read_tribute(const char *tribsection, const char *tribtitle,
+ int tribpassage, char *nowin_buf, int bufsz,
+ unsigned oid) /* book identifier */
{
dlb *fp;
char line[BUFSZ], lastline[BUFSZ];
}
boolean
-Death_quote(buf, bufsz)
-char *buf;
-int bufsz;
+Death_quote(char *buf, int bufsz)
{
unsigned death_oid = 1; /* chance of oid #1 being a novel is negligible */
#include "hack.h"
-static void NDECL(dowatersnakes);
-static void NDECL(dowaterdemon);
-static void NDECL(dowaternymph);
-static void FDECL(gush, (int, int, genericptr_t));
-static void NDECL(dofindgem);
+static void dowatersnakes(void);
+static void dowaterdemon(void);
+static void dowaternymph(void);
+static void gush(int, int, genericptr_t);
+static void dofindgem(void);
/* used when trying to dip in or drink from fountain or sink or pool while
levitating above it, or when trying to move downwards in that state */
void
-floating_above(what)
-const char *what;
+floating_above(const char *what)
{
const char *umsg = "are floating high above the %s.";
/* Fountain of snakes! */
static void
-dowatersnakes()
+dowatersnakes(void)
{
register int num = rn1(5, 2);
struct monst *mtmp;
/* Water demon */
static void
-dowaterdemon()
+dowaterdemon(void)
{
struct monst *mtmp;
/* Water Nymph */
static void
-dowaternymph()
+dowaternymph(void)
{
register struct monst *mtmp;
/* Gushing forth along LOS from (u.ux, u.uy) */
void
-dogushforth(drinking)
-int drinking;
+dogushforth(int drinking)
{
int madepool = 0;
}
static void
-gush(x, y, poolcnt)
-int x, y;
-genericptr_t poolcnt;
+gush(int x, int y, genericptr_t poolcnt)
{
register struct monst *mtmp;
register struct trap *ttmp;
/* Find a gem in the sparkling waters. */
static void
-dofindgem()
+dofindgem(void)
{
if (!Blind)
You("spot a gem in the sparkling waters!");
}
void
-dryup(x, y, isyou)
-xchar x, y;
-boolean isyou;
+dryup(xchar x, xchar y, boolean isyou)
{
if (IS_FOUNTAIN(levl[x][y].typ)
&& (!rn2(3) || FOUNTAIN_IS_WARNED(x, y))) {
}
void
-drinkfountain()
+drinkfountain(void)
{
/* What happens when you drink from a fountain? */
register boolean mgkftn = (levl[u.ux][u.uy].blessedftn == 1);
}
void
-dipfountain(obj)
-register struct obj *obj;
+dipfountain(register struct obj *obj)
{
if (Levitation) {
floating_above("fountain");
}
void
-breaksink(x, y)
-int x, y;
+breaksink(int x, int y)
{
if (cansee(x, y) || (x == u.ux && y == u.uy))
pline_The("pipes break! Water spurts out!");
}
void
-drinksink()
+drinksink(void)
{
struct obj *otmp;
struct monst *mtmp;
/* #define DEBUG */ /* uncomment for debugging */
-static void NDECL(maybe_wail);
-static int NDECL(moverock);
-static void NDECL(dosinkfall);
-static boolean FDECL(findtravelpath, (int));
-static boolean FDECL(trapmove, (int, int, struct trap *));
-static struct monst *FDECL(monstinroom, (struct permonst *, int));
-static boolean FDECL(doorless_door, (int, int));
-static void FDECL(move_update, (BOOLEAN_P));
-static int NDECL(pickup_checks);
-static void FDECL(maybe_smudge_engr, (int, int, int, int));
-static void NDECL(domove_core);
+static void maybe_wail(void);
+static int moverock(void);
+static void dosinkfall(void);
+static boolean findtravelpath(int);
+static boolean trapmove(int, int, struct trap *);
+static struct monst *monstinroom(struct permonst *, int);
+static boolean doorless_door(int, int);
+static void move_update(boolean);
+static int pickup_checks(void);
+static void maybe_smudge_engr(int, int, int, int);
+static void domove_core(void);
#define IS_SHOP(x) (g.rooms[x].rtype >= SHOPBASE)
#define TRAVP_VALID 2
anything *
-uint_to_any(ui)
-unsigned ui;
+uint_to_any(unsigned ui)
{
g.tmp_anything = cg.zeroany;
g.tmp_anything.a_uint = ui;
}
anything *
-long_to_any(lng)
-long lng;
+long_to_any(long lng)
{
g.tmp_anything = cg.zeroany;
g.tmp_anything.a_long = lng;
}
anything *
-monst_to_any(mtmp)
-struct monst *mtmp;
+monst_to_any(struct monst *mtmp)
{
g.tmp_anything = cg.zeroany;
g.tmp_anything.a_monst = mtmp;
}
anything *
-obj_to_any(obj)
-struct obj *obj;
+obj_to_any(struct obj *obj)
{
g.tmp_anything = cg.zeroany;
g.tmp_anything.a_obj = obj;
}
boolean
-revive_nasty(x, y, msg)
-int x, y;
-const char *msg;
+revive_nasty(int x, int y, const char *msg)
{
register struct obj *otmp, *otmp2;
struct monst *mtmp;
}
static int
-moverock()
+moverock(void)
{
register xchar rx, ry, sx, sy;
register struct obj *otmp;
* Returns TRUE if still eating, FALSE when done.
*/
int
-still_chewing(x, y)
-xchar x, y;
+still_chewing(xchar x, xchar y)
{
struct rm *lev = &levl[x][y];
struct obj *boulder = sobj_at(BOULDER, x, y);
}
void
-movobj(obj, ox, oy)
-register struct obj *obj;
-register xchar ox, oy;
+movobj(register struct obj *obj, register xchar ox, register xchar oy)
{
/* optimize by leaving on the fobj chain? */
remove_object(obj);
static NEARDATA const char fell_on_sink[] = "fell onto a sink";
static void
-dosinkfall()
+dosinkfall(void)
{
register struct obj *obj;
int dmg;
/* intended to be called only on ROCKs or TREEs */
boolean
-may_dig(x, y)
-register xchar x, y;
+may_dig(register xchar x, register xchar y)
{
struct rm *lev = &levl[x][y];
}
boolean
-may_passwall(x, y)
-register xchar x, y;
+may_passwall(register xchar x, register xchar y)
{
return (boolean) !(IS_STWALL(levl[x][y].typ)
&& (levl[x][y].wall_info & W_NONPASSWALL));
}
boolean
-bad_rock(mdat, x, y)
-struct permonst *mdat;
-register xchar x, y;
+bad_rock(struct permonst *mdat, register xchar x, register xchar y)
{
return (boolean) ((Sokoban && sobj_at(BOULDER, x, y))
|| (IS_ROCK(levl[x][y].typ)
the reason why: 1: can't fit, 2: possessions won't fit, 3: sokoban
returns 0 if we can squeeze through */
int
-cant_squeeze_thru(mon)
-struct monst *mon;
+cant_squeeze_thru(struct monst *mon)
{
int amt;
struct permonst *ptr = mon->data;
}
boolean
-invocation_pos(x, y)
-xchar x, y;
+invocation_pos(xchar x, xchar y)
{
return (boolean) (Invocation_lev(&u.uz)
&& x == g.inv_pos.x && y == g.inv_pos.y);
* mode is one of DO_MOVE, TEST_MOVE, TEST_TRAV, or TEST_TRAP
*/
boolean
-test_move(ux, uy, dx, dy, mode)
-int ux, uy, dx, dy;
-int mode;
+test_move(int ux, int uy, int dx, int dy, int mode)
{
int x = ux + dx;
int y = uy + dy;
* Returns TRUE if a path was found.
*/
static boolean
-findtravelpath(mode)
-int mode;
+findtravelpath(int mode)
{
/* if travel to adjacent, reachable location, use normal movement rules */
if ((mode == TRAVP_TRAVEL || mode == TRAVP_VALID) && g.context.travel1
}
boolean
-is_valid_travelpt(x,y)
-int x,y;
+is_valid_travelpt(int x, int y)
{
int tx = u.tx;
int ty = u.ty;
return true iff moving should continue to intended destination
(all failures and most successful escapes leave hero at original spot) */
static boolean
-trapmove(x, y, desttrap)
-int x, y; /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
-struct trap *desttrap; /* nonnull if another trap at <x,y> */
+trapmove(int x, int y, /* targetted destination, <u.ux+u.dx,u.uy+u.dy> */
+ struct trap *desttrap) /* nonnull if another trap at <x,y> */
{
boolean anchored = FALSE;
const char *predicament, *culprit;
}
boolean
-u_rooted()
+u_rooted(void)
{
if (!g.youmonst.data->mmove) {
You("are rooted %s.",
}
void
-domove()
+domove(void)
{
int ux1 = u.ux, uy1 = u.uy;
}
static void
-domove_core()
+domove_core(void)
{
register struct monst *mtmp;
register struct rm *tmpr;
}
static void
-maybe_smudge_engr(x1,y1,x2,y2)
-int x1, y1, x2, y2;
+maybe_smudge_engr(int x1, int y1, int x2, int y2)
{
struct engr *ep;
/* HP loss or passing out from overexerting yourself */
void
-overexert_hp()
+overexert_hp(void)
{
int *hp = (!Upolyd ? &u.uhp : &u.mh);
/* combat increases metabolism */
boolean
-overexertion()
+overexertion(void)
{
/* this used to be part of domove() when moving to a monster's
position, but is now called by attack() so that it doesn't
}
void
-invocation_message()
+invocation_message(void)
{
/* a special clue-msg when on the Invocation position */
if (invocation_pos(u.ux, u.uy) && !On_stairs(u.ux, u.uy)) {
might be going into solid rock, inhibiting levitation or flight,
or coming back out of such, reinstating levitation/flying */
void
-switch_terrain()
+switch_terrain(void)
{
struct rm *lev = &levl[u.ux][u.uy];
boolean blocklev = (IS_ROCK(lev->typ) || closed_door(u.ux, u.uy)
/* set or clear u.uinwater */
void
-set_uinwater(in_out)
-int in_out;
+set_uinwater(int in_out)
{
u.uinwater = in_out ? 1 : 0;
}
leaving a pool of water/lava, and by moveloop to check for staying on one;
returns true to skip rest of spoteffects */
boolean
-pooleffects(newspot)
-boolean newspot; /* true if called by spoteffects */
+pooleffects(boolean newspot) /* true if called by spoteffects */
{
/* check for leaving water */
if (u.uinwater) {
}
void
-spoteffects(pick)
-boolean pick;
+spoteffects(boolean pick)
{
static int inspoteffects = 0;
static coord spotloc;
/* returns first matching monster */
static struct monst *
-monstinroom(mdat, roomno)
-struct permonst *mdat;
-int roomno;
+monstinroom(struct permonst *mdat, int roomno)
{
register struct monst *mtmp;
}
char *
-in_rooms(x, y, typewanted)
-register xchar x, y;
-register int typewanted;
+in_rooms(register xchar x, register xchar y, register int typewanted)
{
static char buf[5];
char rno, *ptr = &buf[4];
/* is (x,y) in a town? */
boolean
-in_town(x, y)
-register int x, y;
+in_town(register int x, register int y)
{
s_level *slev = Is_special(&u.uz);
register struct mkroom *sroom;
}
static void
-move_update(newlev)
-register boolean newlev;
+move_update(register boolean newlev)
{
char *ptr1, *ptr2, *ptr3, *ptr4;
/* possibly deliver a one-time room entry message */
void
-check_special_room(newlev)
-boolean newlev;
+check_special_room(boolean newlev)
{
register struct monst *mtmp;
char *ptr;
-1 = do normal pickup
-2 = loot the monster */
static int
-pickup_checks()
+pickup_checks(void)
{
struct trap *traphere;
/* the ',' command */
int
-dopickup(VOID_ARGS)
+dopickup(void)
{
int count, tmpcount, ret;
/* turn around a corner if that is the only way we can proceed */
/* do not turn left or right twice */
void
-lookaround()
+lookaround(void)
{
register int x, y;
int i, x0 = 0, y0 = 0, m0 = 1, i0 = 9;
/* check for a doorway which lacks its door (NODOOR or BROKEN) */
static boolean
-doorless_door(x, y)
-int x, y;
+doorless_door(int x, int y)
{
struct rm *lev_p = &levl[x][y];
/* used by drown() to check whether hero can crawl from water to <x,y> */
boolean
-crawl_destination(x, y)
-int x, y;
+crawl_destination(int x, int y)
{
/* is location ok in general? */
if (!goodpos(x, y, &g.youmonst, 0))
/* something like lookaround, but we are not running */
/* react only to monsters that might hit us */
int
-monster_nearby()
+monster_nearby(void)
{
register int x, y;
register struct monst *mtmp;
}
void
-end_running(and_travel)
-boolean and_travel;
+end_running(boolean and_travel)
{
/* moveloop() suppresses time_botl when context.run is non-zero; when
running stops, update 'time' even if other botl status is unchanged */
}
void
-nomul(nval)
-int nval;
+nomul(int nval)
{
if (g.multi < nval)
return; /* This is a bug fix by ab@unido */
/* called when a non-movement, multi-turn action has completed */
void
-unmul(msg_override)
-const char *msg_override;
+unmul(const char *msg_override)
{
g.context.botl = TRUE;
g.multi = 0; /* caller will usually have done this already */
u.usleep = 0;
g.multi_reason = NULL;
if (g.afternmv) {
- int NDECL((*f)) = g.afternmv;
+ int (*f)(void) = g.afternmv;
/* clear afternmv before calling it (to override the
encumbrance hack for levitation--see weight_cap()) */
- g.afternmv = (int NDECL((*))) 0;
+ g.afternmv = (int (*)(void)) 0;
(void) (*f)();
/* for finishing Armor/Boots/&c_on() */
update_inventory();
}
static void
-maybe_wail()
+maybe_wail(void)
{
static short powers[] = { TELEPORT, SEE_INVIS, POISON_RES, COLD_RES,
SHOCK_RES, FIRE_RES, SLEEP_RES, DISINT_RES,
}
void
-losehp(n, knam, k_format)
-register int n;
-register const char *knam;
-boolean k_format;
+losehp(register int n, register const char *knam, boolean k_format)
{
#if 0 /* code below is prepared to handle negative 'loss' so don't add this
* until we've verified that no callers intentionally rely on that */
}
int
-weight_cap()
+weight_cap(void)
{
long carrcap, save_ELev = ELevitation, save_BLev = BLevitation;
/* returns how far beyond the normal capacity the player is currently. */
/* inv_weight() is negative if the player is below normal capacity. */
int
-inv_weight()
+inv_weight(void)
{
register struct obj *otmp = g.invent;
register int wt = 0;
* over the normal capacity the player is loaded. Max is 5.
*/
int
-calc_capacity(xtra_wt)
-int xtra_wt;
+calc_capacity(int xtra_wt)
{
int cap, wt = inv_weight() + xtra_wt;
}
int
-near_capacity()
+near_capacity(void)
{
return calc_capacity(0);
}
int
-max_capacity()
+max_capacity(void)
{
int wt = inv_weight();
}
boolean
-check_capacity(str)
-const char *str;
+check_capacity(const char *str)
{
if (near_capacity() >= EXT_ENCUMBER) {
if (str)
}
int
-inv_cnt(incl_gold)
-boolean incl_gold;
+inv_cnt(boolean incl_gold)
{
register struct obj *otmp = g.invent;
register int ct = 0;
/* now that u.gold/m.gold is gone.*/
/* Counting money in a container might be possible too. */
long
-money_cnt(otmp)
-struct obj *otmp;
+money_cnt(struct obj *otmp)
{
while (otmp) {
if (otmp->oclass == COIN_CLASS)
#define Static static
#endif
-static boolean FDECL(pmatch_internal, (const char *, const char *,
- BOOLEAN_P, const char *));
+static boolean pmatch_internal(const char *, const char *, boolean,
+ const char *);
/* is 'c' a digit? */
boolean
-digit(c)
-char c;
+digit(char c)
{
return (boolean) ('0' <= c && c <= '9');
}
/* is 'c' a letter? note: '@' classed as letter */
boolean
-letter(c)
-char c;
+letter(char c)
{
return (boolean) ('@' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
}
/* force 'c' into uppercase */
char
-highc(c)
-char c;
+highc(char c)
{
return (char) (('a' <= c && c <= 'z') ? (c & ~040) : c);
}
/* force 'c' into lowercase */
char
-lowc(c)
-char c;
+lowc(char c)
{
return (char) (('A' <= c && c <= 'Z') ? (c | 040) : c);
}
/* convert a string into all lowercase */
char *
-lcase(s)
-char *s;
+lcase(char *s)
{
register char *p;
/* convert a string into all uppercase */
char *
-ucase(s)
-char *s;
+ucase(char *s)
{
register char *p;
/* convert first character of a string to uppercase */
char *
-upstart(s)
-char *s;
+upstart(char *s)
{
if (s)
*s = highc(*s);
/* remove excess whitespace from a string buffer (in place) */
char *
-mungspaces(bp)
-char *bp;
+mungspaces(char *bp)
{
register char c, *p, *p2;
boolean was_space = TRUE;
/* skip leading whitespace; remove trailing whitespace, in place */
char *
-trimspaces(txt)
-char *txt;
+trimspaces(char *txt)
{
char *end;
/* remove \n from end of line; remove \r too if one is there */
char *
-strip_newline(str)
-char *str;
+strip_newline(char *str)
{
char *p = rindex(str, '\n');
/* return the end of a string (pointing at '\0') */
char *
-eos(s)
-register char *s;
+eos(register char *s)
{
while (*s)
s++; /* s += strlen(s); */
/* determine whether 'str' ends in 'chkstr' */
boolean
-str_end_is(str, chkstr)
-const char *str, *chkstr;
+str_end_is(const char *str, const char *chkstr)
{
int clen = (int) strlen(chkstr);
/* return the max line length from buffer comprising of newline-separated strings */
int
-str_lines_maxlen(str)
-const char *str;
+str_lines_maxlen(const char *str)
{
const char *s1, *s2;
int len, max_len = 0;
/* append a character to a string (in place): strcat(s, {c,'\0'}); */
char *
-strkitten(s, c)
-char *s;
-char c;
+strkitten(char *s, char c)
{
char *p = eos(s);
/* truncating string copy */
void
-copynchars(dst, src, n)
-char *dst;
-const char *src;
-int n;
+copynchars(char *dst, const char *src, int n)
{
/* copies at most n characters, stopping sooner if terminator reached;
treats newline as input terminator; unlike strncpy, always supplies
/* convert char nc into oc's case; mostly used by strcasecpy */
char
-chrcasecpy(oc, nc)
-int oc, nc;
+chrcasecpy(int oc, int nc)
{
#if 0 /* this will be necessary if we switch to <ctype.h> */
oc = (int) (unsigned char) oc;
for case-insensitive editions of makeplural() and makesingular();
src might be shorter, same length, or longer than dst */
char *
-strcasecpy(dst, src)
-char *dst;
-const char *src;
+strcasecpy(char *dst, const char *src)
{
char *result = dst;
int ic, oc, dst_exhausted = 0;
/* return a name converted to possessive */
char *
-s_suffix(s)
-const char *s;
+s_suffix(const char *s)
{
Static char buf[BUFSZ];
/* construct a gerund (a verb formed by appending "ing" to a noun) */
char *
-ing_suffix(s)
-const char *s;
+ing_suffix(const char *s)
{
static const char vowel[] = "aeiouwy";
static char buf[BUFSZ];
/* trivial text encryption routine (see makedefs) */
char *
-xcrypt(str, buf)
-const char *str;
-char *buf;
+xcrypt(const char *str, char *buf)
{
register const char *p;
register char *q;
/* is a string entirely whitespace? */
boolean
-onlyspace(s)
-const char *s;
+onlyspace(const char *s)
{
for (; *s; s++)
if (*s != ' ' && *s != '\t')
/* expand tabs into proper number of spaces (in place) */
char *
-tabexpand(sbuf)
-char *sbuf; /* assumed to be [BUFSZ] but can be smaller provided that expanded
- * string fits; expansion bigger than BUFSZ-1 will be truncated */
+tabexpand(char *sbuf) /* assumed to be [BUFSZ] but can be smaller provided that
+ * expanded string fits; expansion bigger than BUFSZ-1
+ * will be truncated */
{
char buf[BUFSZ + 10];
register char *bp, *s = sbuf;
#define VISCTRL_NBUF 5
/* make a displayable string from a character */
char *
-visctrl(c)
-char c;
+visctrl(char c)
{
Static char visctrl_bufs[VISCTRL_NBUF][5];
static int nbuf = 0;
/* caller is responsible for ensuring that bp is a
valid pointer to a BUFSZ buffer */
char *
-stripchars(bp, stuff_to_strip, orig)
-char *bp;
-const char *stuff_to_strip, *orig;
+stripchars(char *bp, const char *stuff_to_strip, const char *orig)
{
int i = 0;
char *s = bp;
/* remove digits from string */
char *
-stripdigits(s)
-char *s;
+stripdigits(char *s)
{
char *s1, *s2;
/* substitute a word or phrase in a string (in place) */
/* caller is responsible for ensuring that bp points to big enough buffer */
char *
-strsubst(bp, orig, replacement)
-char *bp;
-const char *orig, *replacement;
+strsubst(char *bp, const char *orig, const char *replacement)
{
char *found, buf[BUFSZ];
if N is 0, substitute all occurrences; returns the number of subsitutions;
maximum output length is BUFSZ (BUFSZ-1 chars + terminating '\0') */
int
-strNsubst(inoutbuf, orig, replacement, n)
-char *inoutbuf; /* current string, and result buffer */
-const char *orig, /* old substring; if "" then insert in front of Nth char */
- *replacement; /* new substring; if "" then delete old substring */
-int n; /* which occurrence to replace; 0 => all */
+strNsubst(char *inoutbuf, /* current string, and result buffer */
+ const char *orig, /* old substring; if "" then insert in front of Nth char */
+ const char *replacement, /* new substring; if "" then delete old substring */
+ int n) /* which occurrence to replace; 0 => all */
{
char *bp, *op, workbuf[BUFSZ];
const char *rp;
/* return the ordinal suffix of a number */
const char *
-ordin(n)
-int n; /* note: should be non-negative */
+ordin(int n) /* note: should be non-negative */
{
register int dd = n % 10;
/* make a signed digit string from a number */
char *
-sitoa(n)
-int n;
+sitoa(int n)
{
Static char buf[13];
/* return the sign of a number: -1, 0, or 1 */
int
-sgn(n)
-int n;
+sgn(int n)
{
return (n < 0) ? -1 : (n != 0);
}
/* calculate x/y, rounding as appropriate */
int
-rounddiv(x, y)
-long x;
-int y;
+rounddiv(long x, int y)
{
int r, m;
int divsgn = 1;
/* distance between two points, in moves */
int
-distmin(x0, y0, x1, y1)
-int x0, y0, x1, y1;
+distmin(int x0, int y0, int x1, int y1)
{
register int dx = x0 - x1, dy = y0 - y1;
/* square of euclidean distance between pair of pts */
int
-dist2(x0, y0, x1, y1)
-int x0, y0, x1, y1;
+dist2(int x0, int y0, int x1, int y1)
{
register int dx = x0 - x1, dy = y0 - y1;
/* integer square root function without using floating point */
int
-isqrt(val)
-int val;
+isqrt(int val)
{
int rt = 0;
int odd = 1;
/* are two points lined up (on a straight line)? */
boolean
-online2(x0, y0, x1, y1)
-int x0, y0, x1, y1;
+online2(int x0, int y0, int x1, int y1)
{
int dx = x0 - x1, dy = y0 - y1;
/* If either delta is zero then they're on an orthogonal line,
/* guts of pmatch(), pmatchi(), and pmatchz();
match a string against a pattern */
static boolean
-pmatch_internal(patrn, strng, ci, sk)
-const char *patrn, *strng;
-boolean ci; /* True => case-insensitive, False => case-sensitive */
-const char *sk; /* set of characters to skip */
+pmatch_internal(const char *patrn, const char *strng,
+ boolean ci, /* True => case-insensitive,
+ False => case-sensitive */
+ const char *sk) /* set of characters to skip */
{
char s, p;
/*
/* case-sensitive wildcard match */
boolean
-pmatch(patrn, strng)
-const char *patrn, *strng;
+pmatch(const char *patrn, const char *strng)
{
return pmatch_internal(patrn, strng, FALSE, (const char *) 0);
}
/* case-insensitive wildcard match */
boolean
-pmatchi(patrn, strng)
-const char *patrn, *strng;
+pmatchi(const char *patrn, const char *strng)
{
return pmatch_internal(patrn, strng, TRUE, (const char *) 0);
}
/* case-insensitive wildcard fuzzymatch */
boolean
-pmatchz(patrn, strng)
-const char *patrn, *strng;
+pmatchz(const char *patrn, const char *strng)
{
/* ignore spaces, tabs (just in case), dashes, and underscores */
static const char fuzzychars[] = " \t-_";
#ifndef STRNCMPI
/* case insensitive counted string comparison */
+/*{ aka strncasecmp }*/
int
-strncmpi(s1, s2, n) /*{ aka strncasecmp }*/
-register const char *s1, *s2;
-register int n; /*(should probably be size_t, which is unsigned)*/
+strncmpi(register const char *s1, register const char *s2,
+ register int n) /*(should probably be size_t, which is unsigned)*/
{
register char t1, t2;
#ifndef STRSTRI
/* case insensitive substring search */
char *
-strstri(str, sub)
-const char *str;
-const char *sub;
+strstri(const char *str, const char *sub)
{
register const char *s1, *s2;
register int i, k;
/* compare two strings for equality, ignoring the presence of specified
characters (typically whitespace) and possibly ignoring case */
boolean
-fuzzymatch(s1, s2, ignore_chars, caseblind)
-const char *s1, *s2;
-const char *ignore_chars;
-boolean caseblind;
+fuzzymatch(const char *s1, const char *s2, const char *ignore_chars,
+ boolean caseblind)
{
register char c1, c2;
#if defined(AMIGA) && !defined(AZTEC_C) && !defined(__SASC_60) \
&& !defined(_DCC) && !defined(__GNUC__)
-extern struct tm *FDECL(localtime, (time_t *));
+extern struct tm *localtime(time_t *);
#endif
-static struct tm *NDECL(getlt);
+static struct tm *getlt(void);
/* Sets the seed for the random number generator */
#ifdef USE_ISAAC64
static void
-set_random(seed, fn)
-unsigned long seed;
-int FDECL((*fn), (int));
+set_random(unsigned long seed,
+ int (*fn)(int))
{
init_isaac64(seed, fn);
}
/*ARGSUSED*/
static void
-set_random(seed, fn)
-unsigned long seed;
-int FDECL((*fn), (int)) UNUSED;
+set_random(unsigned long seed,
+ int (*fn)(int) UNUSED)
{
/* the types are different enough here that sweeping the different
* routine names into one via #defines is even more confusing
/* An appropriate version of this must always be provided in
port-specific code somewhere. It returns a number suitable
as seed for the random number generator */
-extern unsigned long NDECL(sys_random_seed);
+extern unsigned long sys_random_seed(void);
/*
* Initializes the random number generator.
* Only call once.
*/
void
-init_random(fn)
-int FDECL((*fn), (int));
+init_random(int (*fn)(int))
{
set_random(sys_random_seed(), fn);
}
/* Reshuffles the random number generator. */
void
-reseed_random(fn)
-int FDECL((*fn), (int));
+reseed_random(int (*fn)(int))
{
/* only reseed if we are certain that the seed generation is unguessable
* by the players. */
}
time_t
-getnow()
+getnow(void)
{
time_t datetime = 0;
}
static struct tm *
-getlt()
+getlt(void)
{
time_t date = getnow();
}
int
-getyear()
+getyear(void)
{
return (1900 + getlt()->tm_year);
}
#if 0
/* This routine is no longer used since in 20YY it yields "1YYmmdd". */
char *
-yymmdd(date)
-time_t date;
+yymmdd(time_t date)
{
Static char datestr[10];
struct tm *lt;
#endif
long
-yyyymmdd(date)
-time_t date;
+yyyymmdd(time_t date)
{
long datenum;
struct tm *lt;
}
long
-hhmmss(date)
-time_t date;
+hhmmss(time_t date)
{
long timenum;
struct tm *lt;
}
char *
-yyyymmddhhmmss(date)
-time_t date;
+yyyymmddhhmmss(time_t date)
{
long datenum;
static char datestr[15];
}
time_t
-time_from_yyyymmddhhmmss(buf)
-char *buf;
+time_from_yyyymmddhhmmss(char *buf)
{
int k;
time_t timeresult = (time_t) 0;
* + 11/22 for rounding
*/
int
-phase_of_the_moon() /* 0-7, with 0: new, 4: full */
+phase_of_the_moon(void) /* 0-7, with 0: new, 4: full */
{
register struct tm *lt = getlt();
register int epact, diy, goldn;
}
boolean
-friday_13th()
+friday_13th(void)
{
register struct tm *lt = getlt();
}
int
-night()
+night(void)
{
register int hour = getlt()->tm_hour;
}
int
-midnight()
+midnight(void)
{
return (getlt()->tm_hour == 0);
}
/* strbuf_init() initializes strbuf state for use */
void
-strbuf_init(strbuf)
-strbuf_t *strbuf;
+strbuf_init(strbuf_t *strbuf)
{
strbuf->str = NULL;
strbuf->len = 0;
/* strbuf_append() appends given str to strbuf->str */
void
-strbuf_append(strbuf, str)
-strbuf_t *strbuf;
-const char *str;
+strbuf_append(strbuf_t *strbuf, const char *str)
{
int len = (int) strlen(str) + 1;
/* strbuf_reserve() ensure strbuf->str has storage for len characters */
void
-strbuf_reserve(strbuf, len)
-strbuf_t *strbuf;
-int len;
+strbuf_reserve(strbuf_t *strbuf, int len)
{
if (strbuf->str == NULL) {
strbuf->str = strbuf->buf;
/* strbuf_empty() frees allocated memory and set strbuf to initial state */
void
-strbuf_empty(strbuf)
-strbuf_t *strbuf;
+strbuf_empty(strbuf_t *strbuf)
{
if (strbuf->str != NULL && strbuf->str != strbuf->buf)
free((genericptr_t) strbuf->str);
/* strbuf_nl_to_crlf() converts all occurences of \n to \r\n */
void
-strbuf_nl_to_crlf(strbuf)
-strbuf_t *strbuf;
+strbuf_nl_to_crlf(strbuf_t *strbuf)
{
if (strbuf->str) {
int len = (int) strlen(strbuf->str);
}
char *
-nonconst(str, buf)
-const char *str;
-char *buf;
+nonconst(const char *str, char *buf)
{
char *retval = emptystr;
/* swapbits(val, bita, bitb) swaps bit a with bit b in val */
int
-swapbits(val, bita, bitb)
-int val, bita, bitb;
+swapbits(int val, int bita, int bitb)
{
int tmp = ((val >> bita) & 1) ^ ((val >> bitb) & 1);
/* randomize the given list of numbers 0 <= i < count */
void
-shuffle_int_array(indices, count)
-int *indices;
-int count;
+shuffle_int_array(int *indices, int count)
{
int i, iswap, temp;
#include "hack.h"
-static void FDECL(enlght_out, (const char *));
-static void FDECL(enlght_line, (const char *, const char *, const char *,
- const char *));
-static char *FDECL(enlght_combatinc, (const char *, int, int, char *));
-static void FDECL(enlght_halfdmg, (int, int));
-static boolean NDECL(walking_on_water);
-static boolean FDECL(cause_known, (int));
-static char *FDECL(attrval, (int, int, char *));
-static void FDECL(background_enlightenment, (int, int));
-static void FDECL(basics_enlightenment, (int, int));
-static void FDECL(characteristics_enlightenment, (int, int));
-static void FDECL(one_characteristic, (int, int, int));
-static void FDECL(status_enlightenment, (int, int));
-static void FDECL(weapon_insight, (int));
-static void FDECL(attributes_enlightenment, (int, int));
-static void FDECL(show_achievements, (int));
-static int FDECL(CFDECLSPEC vanqsort_cmp, (const genericptr,
- const genericptr));
-static int NDECL(set_vanq_order);
-static int NDECL(num_extinct);
+static void enlght_out(const char *);
+static void enlght_line(const char *, const char *, const char *,
+ const char *);
+static char *enlght_combatinc(const char *, int, int, char *);
+static void enlght_halfdmg(int, int);
+static boolean walking_on_water(void);
+static boolean cause_known(int);
+static char *attrval(int, int, char *);
+static void background_enlightenment(int, int);
+static void basics_enlightenment(int, int);
+static void characteristics_enlightenment(int, int);
+static void one_characteristic(int, int, int);
+static void status_enlightenment(int, int);
+static void weapon_insight(int);
+static void attributes_enlightenment(int, int);
+static void show_achievements(int);
+static int CFDECLSPEC vanqsort_cmp(const genericptr, const genericptr);
+static int set_vanq_order(void);
+static int num_extinct(void);
extern const char *hu_stat[]; /* hunger status from eat.c */
extern const char *enc_stat[]; /* encumbrance status from botl.c */
enl_msg(You_, have, (const char *) "", something, "")
static void
-enlght_out(buf)
-const char *buf;
+enlght_out(const char *buf)
{
if (g.en_via_menu) {
anything any;
}
static void
-enlght_line(start, middle, end, ps)
-const char *start, *middle, *end, *ps;
+enlght_line(const char *start, const char *middle, const char *end,
+ const char *ps)
{
char buf[BUFSZ];
/* format increased chance to hit or damage or defense (Protection) */
static char *
-enlght_combatinc(inctyp, incamt, final, outbuf)
-const char *inctyp;
-int incamt, final;
-char *outbuf;
+enlght_combatinc(const char *inctyp, int incamt, int final, char *outbuf)
{
const char *modif, *bonus;
boolean invrt;
/* report half physical or half spell damage */
static void
-enlght_halfdmg(category, final)
-int category;
-int final;
+enlght_halfdmg(int category, int final)
{
const char *category_name;
char buf[BUFSZ];
/* is hero actively using water walking capability on water (or lava)? */
static boolean
-walking_on_water()
+walking_on_water(void)
{
if (u.uinwater || Levitation || Flying)
return FALSE;
/* describe u.utraptype; used by status_enlightenment() and self_lookat() */
char *
-trap_predicament(outbuf, final, wizxtra)
-char *outbuf;
-int final;
-boolean wizxtra;
+trap_predicament(char *outbuf, int final, boolean wizxtra)
{
struct trap *t;
confers the target property; item must have been seen and its type
discovered but it doesn't necessarily have to be fully identified */
static boolean
-cause_known(propindx)
-int propindx; /* index of a property which can be conveyed by worn item */
+cause_known(int propindx) /* index of a property which can be conveyed by worn item */
{
register struct obj *o;
long mask = W_ARMOR | W_AMUL | W_RING | W_TOOL;
/* format a characteristic value, accommodating Strength's strangeness */
static char *
-attrval(attrindx, attrvalue, resultbuf)
-int attrindx, attrvalue;
-char resultbuf[]; /* should be at least [7] to hold "18/100\0" */
+attrval(int attrindx, int attrvalue,
+ char resultbuf[]) /* should be at least [7] to hold "18/100\0" */
{
if (attrindx != A_STR || attrvalue <= 18)
Sprintf(resultbuf, "%d", attrvalue);
}
void
-enlightenment(mode, final)
-int mode; /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
-int final; /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE, ENL_GAMEOVERDEAD */
+enlightenment(int mode, /* BASICENLIGHTENMENT | MAGICENLIGHTENMENT (| both) */
+ int final) /* ENL_GAMEINPROGRESS:0, ENL_GAMEOVERALIVE,
+ ENL_GAMEOVERDEAD */
{
char buf[BUFSZ], tmpbuf[BUFSZ];
/*ARGSUSED*/
/* display role, race, alignment and such to en_win */
static void
-background_enlightenment(unused_mode, final)
-int unused_mode UNUSED;
-int final;
+background_enlightenment(int unused_mode UNUSED, int final)
{
const char *role_titl, *rank_titl;
int innategend, difgend, difalgn;
doesn't fit very well in other categories */
/*ARGSUSED*/
static void
-basics_enlightenment(mode, final)
-int mode UNUSED;
-int final;
+basics_enlightenment(int mode UNUSED, int final)
{
static char Power[] = "energy points (spell power)";
char buf[BUFSZ];
/* characteristics: expanded version of bottom line strength, dexterity, &c */
static void
-characteristics_enlightenment(mode, final)
-int mode;
-int final;
+characteristics_enlightenment(int mode, int final)
{
char buf[BUFSZ];
/* display one attribute value for characteristics_enlightenment() */
static void
-one_characteristic(mode, final, attrindx)
-int mode, final, attrindx;
+one_characteristic(int mode, int final, int attrindx)
{
extern const char *const attrname[]; /* attrib.c */
boolean hide_innate_value = FALSE, interesting_alimit;
/* status: selected obvious capabilities, assorted troubles */
static void
-status_enlightenment(mode, final)
-int mode;
-int final;
+status_enlightenment(int mode, int final)
{
boolean magic = (mode & MAGICENLIGHTENMENT) ? TRUE : FALSE;
int cap;
/* extracted from status_enlightenment() to reduce clutter there */
static void
-weapon_insight(final)
-int final;
+weapon_insight(int final)
{
char buf[BUFSZ];
int wtype;
/* attributes: intrinsics and the like, other non-obvious capabilities */
static void
-attributes_enlightenment(unused_mode, final)
-int unused_mode UNUSED;
-int final;
+attributes_enlightenment(int unused_mode UNUSED, int final)
{
static NEARDATA const char if_surroundings_permitted[] =
" if surroundings permitted";
/* ^X command */
int
-doattributes(VOID_ARGS)
+doattributes(void)
{
int mode = BASICENLIGHTENMENT;
}
void
-youhiding(via_enlghtmt, msgflag)
-boolean via_enlghtmt; /* englightment line vs topl message */
-int msgflag; /* for variant message phrasing */
+youhiding(boolean via_enlghtmt, /* englightment line vs topl message */
+ int msgflag) /* for variant message phrasing */
{
char *bp, buf[BUFSZ];
/* #conduct command [KMH]; shares enlightenment's tense handling */
int
-doconduct(VOID_ARGS)
+doconduct(void)
{
show_conduct(0);
return 0;
/* display conducts; for doconduct(), also disclose() and dump_everything() */
void
-show_conduct(final)
-int final;
+show_conduct(int final)
{
char buf[BUFSZ];
int ngenocided;
*/
static void
-show_achievements(final)
-int final; /* used "behind the curtain" by enl_foo() macros */
+show_achievements(int final) /* used "behind the curtain" by enl_foo() macros */
{
int i, achidx, absidx, acnt;
char title[QBUFSZ], buf[QBUFSZ];
/* record an achievement (add at end of list unless already present) */
void
-record_achievement(achidx)
-schar achidx;
+record_achievement(schar achidx)
{
int i, absidx;
/* discard a recorded achievement; return True if removed, False otherwise */
boolean
-remove_achievement(achidx)
-schar achidx;
+remove_achievement(schar achidx)
{
int i;
/* used to decide whether there are any achievements to display */
int
-count_achievements()
+count_achievements(void)
{
int i, acnt = 0;
/* convert a rank index to an achievement number; encode it when female
in order to subsequently report gender-specific ranks accurately */
schar
-achieve_rank(rank)
-int rank; /* 1..8 */
+achieve_rank(int rank) /* 1..8 */
{
schar achidx = (schar) ((rank - 1) + ACH_RNK1);
/* return True if sokoban branch has been entered, False otherwise */
boolean
-sokoban_in_play()
+sokoban_in_play(void)
{
int achidx;
};
static int CFDECLSPEC
-vanqsort_cmp(vptr1, vptr2)
-const genericptr vptr1;
-const genericptr vptr2;
+vanqsort_cmp(const genericptr vptr1, const genericptr vptr2)
{
int indx1 = *(short *) vptr1, indx2 = *(short *) vptr2,
mlev1, mlev2, mstr1, mstr2, uniq1, uniq2, died1, died2, res;
/* returns -1 if cancelled via ESC */
static int
-set_vanq_order()
+set_vanq_order(void)
{
winid tmpwin;
menu_item *selected;
/* #vanquished command */
int
-dovanquished()
+dovanquished(void)
{
list_vanquished('a', FALSE);
return 0;
/* #wizborn extended command */
int
-doborn()
+doborn(void)
{
static const char fmt[] = "%4i %4i %c %-30s";
int i;
#define done_stopprint g.program_state.stopprint
void
-list_vanquished(defquery, ask)
-char defquery;
-boolean ask;
+list_vanquished(char defquery, boolean ask)
{
register int i;
int pfx, nkilled;
/* number of monster species which have been genocided */
int
-num_genocides()
+num_genocides(void)
{
int i, n = 0;
}
static int
-num_extinct()
+num_extinct(void)
{
int i, n = 0;
}
void
-list_genocided(defquery, ask)
-char defquery;
-boolean ask;
+list_genocided(char defquery, boolean ask)
{
register int i;
int ngenocided, nextinct;
*/
const char *
-align_str(alignment)
-aligntyp alignment;
+align_str(aligntyp alignment)
{
switch ((int) alignment) {
case A_CHAOTIC:
/* used for self-probing */
char *
-piousness(showneg, suffix)
-boolean showneg;
-const char *suffix;
+piousness(boolean showneg, const char *suffix)
{
static char buf[32]; /* bigger than "insufficiently neutral" */
const char *pio;
/* stethoscope or probing applied to monster -- one-line feedback */
void
-mstatusline(mtmp)
-struct monst *mtmp;
+mstatusline(struct monst *mtmp)
{
aligntyp alignment = mon_aligntyp(mtmp);
char info[BUFSZ], monnambuf[BUFSZ];
/* stethoscope or probing applied to hero -- one-line feedback */
void
-ustatusline()
+ustatusline(void)
{
char info[BUFSZ];
#define CONTAINED_SYM '>' /* designator for inside a container */
#define HANDS_SYM '-'
-static char *FDECL(loot_xname, (struct obj *));
-static int FDECL(invletter_value, (CHAR_P));
-static int FDECL(CFDECLSPEC sortloot_cmp, (const genericptr,
- const genericptr));
-static void NDECL(reorder_invent);
-static struct obj *FDECL(addinv_core0, (struct obj *, struct obj *,
- BOOLEAN_P));
-static void FDECL(noarmor, (BOOLEAN_P));
-static void FDECL(invdisp_nothing, (const char *, const char *));
-static boolean FDECL(worn_wield_only, (struct obj *));
-static boolean FDECL(only_here, (struct obj *));
-static void FDECL(compactify, (char *));
-static boolean FDECL(taking_off, (const char *));
-static int FDECL(ckvalidcat, (struct obj *));
-static int FDECL(ckunpaid, (struct obj *));
-static char *FDECL(safeq_xprname, (struct obj *));
-static char *FDECL(safeq_shortxprname, (struct obj *));
-static char FDECL(display_pickinv, (const char *, const char *,
- const char *, BOOLEAN_P, long *));
-static char FDECL(display_used_invlets, (CHAR_P));
-static boolean FDECL(this_type_only, (struct obj *));
-static void NDECL(dounpaid);
-static struct obj *FDECL(find_unpaid, (struct obj *, struct obj **));
-static void FDECL(menu_identify, (int));
-static boolean FDECL(tool_in_use, (struct obj *));
-static int FDECL(adjust_ok, (struct obj *));
-static char FDECL(obj_to_let, (struct obj *));
-static void FDECL(mime_action, (const char *));
+static char *loot_xname(struct obj *);
+static int invletter_value(char);
+static int CFDECLSPEC sortloot_cmp(const genericptr, const genericptr);
+static void reorder_invent(void);
+static struct obj *addinv_core0(struct obj *, struct obj *, boolean);
+static void noarmor(boolean);
+static void invdisp_nothing(const char *, const char *);
+static boolean worn_wield_only(struct obj *);
+static boolean only_here(struct obj *);
+static void compactify(char *);
+static boolean taking_off(const char *);
+static int ckvalidcat(struct obj *);
+static int ckunpaid(struct obj *);
+static char *safeq_xprname(struct obj *);
+static char *safeq_shortxprname(struct obj *);
+static char display_pickinv(const char *, const char *, const char *,
+ boolean, long *);
+static char display_used_invlets(char);
+static boolean this_type_only(struct obj *);
+static void dounpaid(void);
+static struct obj *find_unpaid(struct obj *, struct obj **);
+static void menu_identify(int);
+static boolean tool_in_use(struct obj *);
+static int adjust_ok(struct obj *);
+static char obj_to_let(struct obj *);
+static void mime_action(const char *);
/* wizards can wish for venom, which will become an invisible inventory
* item without this. putting it in inv_order would mean venom would
/* sortloot() classification; called at most once [per sort] for each object */
void
-loot_classify(sort_item, obj)
-Loot *sort_item;
-struct obj *obj;
+loot_classify(Loot *sort_item, struct obj *obj)
{
/* we may eventually make this a settable option to always use
with sortloot instead of only when the 'sortpack' option isn't
/* sortloot() formatting routine; for alphabetizing, not shown to user */
static char *
-loot_xname(obj)
-struct obj *obj;
+loot_xname(struct obj *obj)
{
struct obj saveo;
boolean save_debug;
}
static int
-invletter_value(c)
-char c;
+invletter_value(char c)
{
return ('a' <= c && c <= 'z') ? (c - 'a' + 2)
: ('A' <= c && c <= 'Z') ? (c - 'A' + 2 + 26)
/* qsort comparison routine for sortloot() */
static int CFDECLSPEC
-sortloot_cmp(vptr1, vptr2)
-const genericptr vptr1;
-const genericptr vptr2;
+sortloot_cmp(const genericptr vptr1, const genericptr vptr2)
{
struct sortloot_item *sli1 = (struct sortloot_item *) vptr1,
*sli2 = (struct sortloot_item *) vptr2;
* instead of simple 'struct obj *' entries.
*/
Loot *
-sortloot(olist, mode, by_nexthere, filterfunc)
-struct obj **olist; /* previous version might have changed *olist, we don't */
-unsigned mode; /* flags for sortloot_cmp() */
-boolean by_nexthere; /* T: traverse via obj->nexthere, F: via obj->nobj */
-boolean FDECL((*filterfunc), (OBJ_P));
+sortloot(struct obj **olist, /* previous version might have changed *olist, we don't */
+ unsigned mode, /* flags for sortloot_cmp() */
+ boolean by_nexthere, /* T: traverse via obj->nexthere, F: via obj->nobj */
+ boolean (*filterfunc)(OBJ_P))
{
Loot *sliarray;
struct obj *o;
/* sortloot() callers should use this to free up memory it allocates */
void
-unsortloot(loot_array_p)
-Loot **loot_array_p;
+unsortloot(Loot **loot_array_p)
{
if (*loot_array_p)
free((genericptr_t) *loot_array_p), *loot_array_p = (Loot *) 0;
#if 0 /* 3.6.0 'revamp' */
void
-sortloot(olist, mode, by_nexthere)
-struct obj **olist;
-unsigned mode; /* flags for sortloot_cmp() */
-boolean by_nexthere; /* T: traverse via obj->nexthere, F: via obj->nobj */
+sortloot(struct obj **olist, unsigned mode, /* flags for sortloot_cmp() */
+ boolean by_nexthere) /* T: traverse via obj->nexthere,
+ F: via obj->nobj */
{
struct sortloot_item *sliarray, osli, nsli;
struct obj *o, **nxt_p;
#endif /*0*/
void
-assigninvlet(otmp)
-register struct obj *otmp;
+assigninvlet(register struct obj *otmp)
{
boolean inuse[52];
register int i;
/* sort the inventory; used by addinv() and doorganize() */
static void
-reorder_invent()
+reorder_invent(void)
{
struct obj *otmp, *prev, *next;
boolean need_more_sorting;
one of them; used in pickup.c when all 52 inventory slots are in use,
to figure out whether another object could still be picked up */
struct obj *
-merge_choice(objlist, obj)
-struct obj *objlist, *obj;
+merge_choice(struct obj *objlist, struct obj *obj)
{
struct monst *shkp;
int save_nocharge;
/* merge obj with otmp and delete obj if types agree */
int
-merged(potmp, pobj)
-struct obj **potmp, **pobj;
+merged(struct obj **potmp, struct obj **pobj)
{
register struct obj *otmp = *potmp, *obj = *pobj;
* It may be valid to merge this code with with addinv_core2().
*/
void
-addinv_core1(obj)
-struct obj *obj;
+addinv_core1(struct obj *obj)
{
if (obj->oclass == COIN_CLASS) {
g.context.botl = 1;
* in-place.
*/
void
-addinv_core2(obj)
-struct obj *obj;
+addinv_core2(struct obj *obj)
{
if (confers_luck(obj)) {
/* new luckstone must be in inventory by this point
* Adjust hero attributes as necessary.
*/
static struct obj *
-addinv_core0(obj, other_obj, update_perm_invent)
-struct obj *obj, *other_obj;
-boolean update_perm_invent;
+addinv_core0(struct obj *obj, struct obj *other_obj,
+ boolean update_perm_invent)
{
struct obj *otmp, *prev;
int saved_otyp = (int) obj->otyp; /* for panic */
/* add obj to the hero's inventory in the default fashion */
struct obj *
-addinv(obj)
-struct obj *obj;
+addinv(struct obj *obj)
{
return addinv_core0(obj, (struct obj *) 0, TRUE);
}
/* add obj to the hero's inventory by inserting in front of a specific item */
struct obj *
-addinv_before(obj, other_obj)
-struct obj *obj, *other_obj;
+addinv_before(struct obj *obj, struct obj *other_obj)
{
return addinv_core0(obj, other_obj, TRUE);
}
* and after hero's intrinsics have been updated.
*/
void
-carry_obj_effects(obj)
-struct obj *obj;
+carry_obj_effects(struct obj *obj)
{
/* Cursed figurines can spontaneously transform when carried. */
if (obj->otyp == FIGURINE) {
* touch_artifact will print its own messages if they are warranted.
*/
struct obj *
-hold_another_object(obj, drop_fmt, drop_arg, hold_msg)
-struct obj *obj;
-const char *drop_fmt, *drop_arg, *hold_msg;
+hold_another_object(struct obj *obj, const char *drop_fmt,
+ const char *drop_arg, const char *hold_msg)
{
char buf[BUFSZ];
/* useup() all of an item regardless of its quantity */
void
-useupall(obj)
-struct obj *obj;
+useupall(struct obj *obj)
{
setnotworn(obj);
freeinv(obj);
}
void
-useup(obj)
-register struct obj *obj;
+useup(register struct obj *obj)
{
/* Note: This works correctly for containers because they (containers)
don't merge. */
/* use one charge from an item and possibly incur shop debt for it */
void
-consume_obj_charge(obj, maybe_unpaid)
-struct obj *obj;
-boolean maybe_unpaid; /* false if caller handles shop billing */
+consume_obj_charge(struct obj *obj,
+ boolean maybe_unpaid) /* false if caller handles shop billing */
{
if (maybe_unpaid)
check_unpaid(obj);
* Should think of a better name...
*/
void
-freeinv_core(obj)
-struct obj *obj;
+freeinv_core(struct obj *obj)
{
if (obj->oclass == COIN_CLASS) {
g.context.botl = 1;
/* remove an object from the hero's inventory */
void
-freeinv(obj)
-register struct obj *obj;
+freeinv(register struct obj *obj)
{
extract_nobj(obj, &g.invent);
freeinv_core(obj);
}
void
-delallobj(x, y)
-int x, y;
+delallobj(int x, int y)
{
struct obj *otmp, *otmp2;
/* destroy object in fobj chain (if unpaid, it remains on the bill) */
void
-delobj(obj)
-register struct obj *obj;
+delobj(register struct obj *obj)
{
boolean update_map;
/* try to find a particular type of object at designated map location */
struct obj *
-sobj_at(otyp, x, y)
-int otyp;
-int x, y;
+sobj_at(int otyp, int x, int y)
{
register struct obj *otmp;
/* sobj_at(&c) traversal -- find next object of specified type */
struct obj *
-nxtobj(obj, type, by_nexthere)
-struct obj *obj;
-int type;
-boolean by_nexthere;
+nxtobj(struct obj *obj, int type, boolean by_nexthere)
{
register struct obj *otmp;
}
struct obj *
-carrying(type)
-register int type;
+carrying(register int type)
{
register struct obj *otmp;
};
const char *
-currency(amount)
-long amount;
+currency(long amount)
{
const char *res;
}
boolean
-have_lizard()
+have_lizard(void)
{
register struct obj *otmp;
}
struct obj *
-u_carried_gloves() {
+u_carried_gloves(void) {
struct obj *otmp, *gloves = (struct obj *) 0;
if (uarmg) {
/* 3.6 tribute */
struct obj *
-u_have_novel()
+u_have_novel(void)
{
register struct obj *otmp;
}
struct obj *
-o_on(id, objchn)
-unsigned int id;
-register struct obj *objchn;
+o_on(unsigned int id, register struct obj *objchn)
{
struct obj *temp;
}
boolean
-obj_here(obj, x, y)
-register struct obj *obj;
-int x, y;
+obj_here(register struct obj *obj, int x, int y)
{
register struct obj *otmp;
}
struct obj *
-g_at(x, y)
-register int x, y;
+g_at(register int x, register int y)
{
register struct obj *obj = g.level.objects[x][y];
/* compact a string of inventory letters by dashing runs of letters */
static void
-compactify(buf)
-register char *buf;
+compactify(register char *buf)
{
register int i1 = 1, i2 = 1;
register char ilet, ilet1, ilet2;
/* some objects shouldn't be split when count given to getobj or askchain */
boolean
-splittable(obj)
-struct obj *obj;
+splittable(struct obj *obj)
{
return !((obj->otyp == LOADSTONE && obj->cursed)
|| (obj == uwep && welded(uwep)));
/* match the prompt for either 'T' or 'R' command */
static boolean
-taking_off(action)
-const char *action;
+taking_off(const char *action)
{
return !strcmp(action, "take off") || !strcmp(action, "remove");
}
static void
-mime_action(word)
-const char *word;
+mime_action(const char *word)
{
char buf[BUFSZ];
char *bp = buf;
/* getobj callback that allows any object - but not hands. */
int
-any_obj_ok(obj)
-struct obj *obj;
+any_obj_ok(struct obj *obj)
{
if (obj)
return GETOBJ_SUGGEST;
* it with &cg.zeroobj, so its behavior can be undefined in that case.
*/
struct obj *
-getobj(word, obj_ok, ctrlflags)
-register const char *word;
-int FDECL((*obj_ok), (OBJ_P)); /* callback */
-unsigned int ctrlflags;
+getobj(register const char *word,
+ int (*obj_ok)(OBJ_P), /* callback */
+ unsigned int ctrlflags)
{
register struct obj *otmp;
register char ilet = 0;
/* force invent to be in invlet order before collecting candidate
inventory letters */
sortedinvent = sortloot(&g.invent, SORTLOOT_INVLET, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0);
+ (boolean (*)(OBJ_P)) 0);
for (srtinv = sortedinvent; (otmp = srtinv->obj) != 0; ++srtinv) {
if (&bp[suggested] == &buf[sizeof buf - 1]
}
void
-silly_thing(word, otmp)
-const char *word;
+silly_thing(const char *word,
#ifdef OBSOLETE_HANDLING
-struct obj *otmp;
+ struct obj *otmp)
#else
-struct obj *otmp UNUSED;
+ struct obj *otmp UNUSED)
#endif
{
#ifdef OBSOLETE_HANDLING
}
static int
-ckvalidcat(otmp)
-struct obj *otmp;
+ckvalidcat(struct obj *otmp)
{
/* use allow_category() from pickup.c */
return (int) allow_category(otmp);
}
static int
-ckunpaid(otmp)
-struct obj *otmp;
+ckunpaid(struct obj *otmp)
{
return (otmp->unpaid || (Has_contents(otmp) && count_unpaid(otmp->cobj)));
}
boolean
-wearing_armor()
+wearing_armor(void)
{
return (boolean) (uarm || uarmc || uarmf || uarmg
|| uarmh || uarms || uarmu);
}
boolean
-is_worn(otmp)
-struct obj *otmp;
+is_worn(struct obj *otmp)
{
return (otmp->owornmask & (W_ARMOR | W_ACCESSORY | W_SADDLE | W_WEAPONS))
? TRUE
/* safe_qbuf() -> short_oname() callback */
static char *
-safeq_xprname(obj)
-struct obj *obj;
+safeq_xprname(struct obj *obj)
{
return xprname(obj, (char *) 0, safeq_xprn_ctx.let, safeq_xprn_ctx.dot,
0L, 0L);
/* alternate safe_qbuf() -> short_oname() callback */
static char *
-safeq_shortxprname(obj)
-struct obj *obj;
+safeq_shortxprname(struct obj *obj)
{
return xprname(obj, ansimpleoname(obj), safeq_xprn_ctx.let,
safeq_xprn_ctx.dot, 0L, 0L);
Return the number of times fn was called successfully.
If combo is TRUE, we just use this to get a category list. */
int
-ggetobj(word, fn, mx, combo, resultflags)
-const char *word;
-int FDECL((*fn), (OBJ_P)), mx;
-boolean combo; /* combination menu flag */
-unsigned *resultflags;
+ggetobj(const char *word, int (*fn)(OBJ_P), int mx,
+ boolean combo, /* combination menu flag */
+ unsigned *resultflags)
{
- int FDECL((*ckfn), (OBJ_P)) = (int FDECL((*), (OBJ_P))) 0;
- boolean FDECL((*ofilter), (OBJ_P)) = (boolean FDECL((*), (OBJ_P))) 0;
+ int (*ckfn)(OBJ_P) = (int (*)(OBJ_P)) 0;
+ boolean (*ofilter)(OBJ_P) = (boolean (*)(OBJ_P)) 0;
boolean takeoff, ident, allflag, m_seen;
int itemcount;
int oletct, iletct, unpaid, oc_of_sym;
* of objects to be treated. Return the number of objects treated.
*/
int
-askchain(objchn, olets, allflag, fn, ckfn, mx, word)
-struct obj **objchn; /* *objchn might change */
-int allflag, mx;
-const char *olets, *word; /* olets is an Obj Class char array */
-int FDECL((*fn), (OBJ_P)), FDECL((*ckfn), (OBJ_P));
+askchain(struct obj **objchn, /* *objchn might change */
+ const char *olets, /* olets is an Obj Class char array */
+ int allflag,
+ int (*fn)(OBJ_P), int (*ckfn)(OBJ_P),
+ int mx, const char *word)
{
struct obj *otmp, *otmpo;
register char sym, ilet;
/* someday maybe we'll sort by 'olets' too (temporarily replace
flags.packorder and pass SORTLOOT_PACK), but not yet... */
sortedchn = sortloot(objchn, SORTLOOT_INVLET, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0);
+ (boolean (*)(OBJ_P)) 0);
first = TRUE;
/*
/* set the cknown and lknown flags on an object if they're applicable */
void
-set_cknown_lknown(obj)
-struct obj *obj;
+set_cknown_lknown(struct obj *obj)
{
if (Is_container(obj) || obj->otyp == STATUE)
obj->cknown = obj->lknown = 1;
/* make an object actually be identified; no display updating */
void
-fully_identify_obj(otmp)
-struct obj *otmp;
+fully_identify_obj(struct obj *otmp)
{
makeknown(otmp->otyp);
if (otmp->oartifact)
/* ggetobj callback routine; identify an object and give immediate feedback */
int
-identify(otmp)
-struct obj *otmp;
+identify(struct obj *otmp)
{
fully_identify_obj(otmp);
prinv((char *) 0, otmp, 0L);
/* menu of unidentified objects; select and identify up to id_limit of them */
static void
-menu_identify(id_limit)
-int id_limit;
+menu_identify(int id_limit)
{
menu_item *pick_list;
int n, i, first = 1, tryct = 5;
}
/* count the unidentified items */
int
-count_unidentified(objchn)
-struct obj *objchn;
+count_unidentified(struct obj *objchn)
{
int unid_cnt = 0;
struct obj *obj;
/* dialog with user to identify a given number of items; 0 means all */
void
-identify_pack(id_limit, learning_id)
-int id_limit;
-boolean learning_id; /* true if we just read unknown identify scroll */
+identify_pack(int id_limit,
+ boolean learning_id) /* true if we just read unknown
+ identify scroll */
{
struct obj *obj;
int n, unid_cnt = count_unidentified(g.invent);
/* called when regaining sight; mark inventory objects which were picked
up while blind as now having been seen */
void
-learn_unseen_invent()
+learn_unseen_invent(void)
{
struct obj *otmp;
(*windowprocs.win_update_inventory) but the restore hackery
was getting out of hand; this is now a central call point */
void
-update_inventory()
+update_inventory(void)
{
if (g.program_state.saving || g.program_state.restoring)
return;
/* should of course only be called for things in invent */
static char
-obj_to_let(obj)
-struct obj *obj;
+obj_to_let(struct obj *obj)
{
if (!flags.invlet_constant) {
obj->invlet = NOINVSYM;
* the current quantity.
*/
void
-prinv(prefix, obj, quan)
-const char *prefix;
-struct obj *obj;
-long quan;
+prinv(const char *prefix, struct obj *obj, long quan)
{
if (!prefix)
prefix = "";
}
char *
-xprname(obj, txt, let, dot, cost, quan)
-struct obj *obj;
-const char *txt; /* text to print instead of obj */
-char let; /* inventory letter */
-boolean dot; /* append period; (dot && cost => Iu) */
-long cost; /* cost (for inventory of unpaid or expended items) */
-long quan; /* if non-0, print this quantity, not obj->quan */
+xprname(struct obj *obj,
+ const char *txt, /* text to print instead of obj */
+ char let, /* inventory letter */
+ boolean dot, /* append period; (dot && cost => Iu) */
+ long cost, /* cost (for inventory of unpaid or expended items) */
+ long quan) /* if non-0, print this quantity, not obj->quan */
{
#ifdef LINT /* handle static char li[BUFSZ]; */
char li[BUFSZ];
/* the 'i' command */
int
-ddoinv()
+ddoinv(void)
{
(void) display_inventory((char *) 0, FALSE);
return 0;
* containers.
*/
static struct obj *
-find_unpaid(list, last_found)
-struct obj *list, **last_found;
+find_unpaid(struct obj *list, struct obj **last_found)
{
struct obj *obj;
}
void
-free_pickinv_cache()
+free_pickinv_cache(void)
{
if (g.cached_pickinv_win != WIN_ERR) {
destroy_nhwindow(g.cached_pickinv_win);
* any count returned from the menu selection is placed here.
*/
static char
-display_pickinv(lets, xtra_choice, query, want_reply, out_cnt)
-register const char *lets;
-const char *xtra_choice; /* "fingers", pick hands rather than an object */
-const char *query;
-boolean want_reply;
-long *out_cnt;
+display_pickinv(register const char *lets,
+ const char *xtra_choice, /* "fingers", pick hands rather than
+ an object */
+ const char *query, boolean want_reply, long *out_cnt)
{
static const char not_carrying_anything[] = "Not carrying anything";
struct obj *otmp, wizid_fakeobj;
if (flags.sortpack)
sortflags |= SORTLOOT_PACK;
sortedinvent = sortloot(&g.invent, sortflags, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0);
+ (boolean (*)(OBJ_P)) 0);
start_menu(win, MENU_BEHAVE_STANDARD);
any = cg.zeroany;
* was selected.
*/
char
-display_inventory(lets, want_reply)
-const char *lets;
-boolean want_reply;
+display_inventory(const char *lets, boolean want_reply)
{
return display_pickinv(lets, (char *) 0, (char *) 0,
want_reply, (long *) 0);
*
*/
static char
-display_used_invlets(avoidlet)
-char avoidlet;
+display_used_invlets(char avoidlet)
{
struct obj *otmp;
char ilet, ret = 0;
* contained objects.
*/
int
-count_unpaid(list)
-struct obj *list;
+count_unpaid(struct obj *list)
{
int count = 0;
* at some point: bknown is forced for priest[ess], like in xname().
*/
int
-count_buc(list, type, filterfunc)
-struct obj *list;
-int type;
-boolean FDECL((*filterfunc), (OBJ_P));
+count_buc(struct obj *list, int type, boolean (*filterfunc)(OBJ_P))
{
int count = 0;
/* similar to count_buc(), but tallies all states at once
rather than looking for a specific type */
void
-tally_BUCX(list, by_nexthere, bcp, ucp, ccp, xcp, ocp)
-struct obj *list;
-boolean by_nexthere;
-int *bcp, *ucp, *ccp, *xcp, *ocp;
+tally_BUCX(struct obj *list, boolean by_nexthere,
+ int *bcp, int *ucp, int *ccp, int *xcp, int *ocp)
{
/* Future extensions:
* Skip current_container when list is invent, uchain when
/* count everything inside a container, or just shop-owned items inside */
long
-count_contents(container, nested, quantity, everything, newdrop)
-struct obj *container;
-boolean nested, /* include contents of any nested containers */
- quantity, /* count all vs count separate stacks */
- everything, /* all objects vs only unpaid objects */
- newdrop; /* on floor, but hero-owned items haven't been marked
- * no_charge yet and shop-owned items are still marked
- * unpaid -- used when asking the player whether to sell */
+count_contents(struct obj *container,
+ boolean nested, /* include contents of any nested containers */
+ boolean quantity, /* count all vs count separate stacks */
+ boolean everything, /* all objects vs only unpaid objects */
+ boolean newdrop) /* on floor, but hero-owned items haven't
+ * been marked no_charge yet and shop-owned
+ * items are still marked unpaid -- used
+ * when asking the player whether to sell */
{
struct obj *otmp, *topc;
boolean shoppy = FALSE;
}
static void
-dounpaid()
+dounpaid(void)
{
winid win;
struct obj *otmp, *marker, *contnr;
static boolean
-this_type_only(obj)
-struct obj *obj;
+this_type_only(struct obj *obj)
{
boolean res = (obj->oclass == g.this_type);
/* the 'I' command */
int
-dotypeinv()
+dotypeinv(void)
{
char c = '\0';
int n, i = 0;
/* collect list of classes of objects carried, for use as a prompt */
types[0] = 0;
class_count = collect_obj_classes(types, g.invent, FALSE,
- (boolean FDECL((*), (OBJ_P))) 0,
+ (boolean (*)(OBJ_P)) 0,
&itemcount);
if (unpaid_count || billx || (bcnt + ccnt + ucnt + xcnt) != 0)
types[class_count++] = ' ';
/* return a string describing the dungeon feature at <x,y> if there
is one worth mentioning at that location; otherwise null */
const char *
-dfeature_at(x, y, buf)
-int x, y;
-char *buf;
+dfeature_at(int x, int y, char *buf)
{
struct rm *lev = &levl[x][y];
int ltyp = lev->typ, cmap = -1;
/* look at what is here; if there are many objects (pile_limit or more),
don't show them unless obj_cnt is 0 */
int
-look_here(obj_cnt, lookhere_flags)
-int obj_cnt; /* obj_cnt > 0 implies that autopickup is in progress */
-unsigned lookhere_flags;
+look_here(int obj_cnt, /* obj_cnt > 0 implies that autopickup is in progress */
+ unsigned lookhere_flags)
{
struct obj *otmp;
struct trap *trap;
/* the ':' command - explicitly look at what is here, including all objects */
int
-dolook()
+dolook(void)
{
int res;
}
boolean
-will_feel_cockatrice(otmp, force_touch)
-struct obj *otmp;
-boolean force_touch;
+will_feel_cockatrice(struct obj *otmp, boolean force_touch)
{
if ((Blind || force_touch) && !uarmg && !Stone_resistance
&& (otmp->otyp == CORPSE && touch_petrifies(&mons[otmp->corpsenm])))
}
void
-feel_cockatrice(otmp, force_touch)
-struct obj *otmp;
-boolean force_touch;
+feel_cockatrice(struct obj *otmp, boolean force_touch)
{
char kbuf[BUFSZ];
}
void
-stackobj(obj)
-struct obj *obj;
+stackobj(struct obj *obj)
{
struct obj *otmp;
/* returns TRUE if obj & otmp can be merged; used in invent.c and mkobj.c */
boolean
-mergable(otmp, obj)
-register struct obj *otmp, *obj;
+mergable(register struct obj *otmp, register struct obj *obj)
{
int objnamelth = 0, otmpnamelth = 0;
/* the '$' command */
int
-doprgold()
+doprgold(void)
{
/* the messages used to refer to "carrying gold", but that didn't
take containers into account */
/* the ')' command */
int
-doprwep()
+doprwep(void)
{
if (!uwep) {
You("are empty %s.", body_part(HANDED));
/* caller is responsible for checking !wearing_armor() */
static void
-noarmor(report_uskin)
-boolean report_uskin;
+noarmor(boolean report_uskin)
{
if (!uskin || !report_uskin) {
You("are not wearing any armor.");
/* the '[' command */
int
-doprarm()
+doprarm(void)
{
char lets[8];
register int ct = 0;
/* the '=' command */
int
-doprring()
+doprring(void)
{
if (!uleft && !uright)
You("are not wearing any rings.");
/* the '"' command */
int
-dopramulet()
+dopramulet(void)
{
if (!uamul)
You("are not wearing an amulet.");
}
static boolean
-tool_in_use(obj)
-struct obj *obj;
+tool_in_use(struct obj *obj)
{
if ((obj->owornmask & (W_TOOL | W_SADDLE)) != 0L)
return TRUE;
/* the '(' command */
int
-doprtool()
+doprtool(void)
{
struct obj *otmp;
int ct = 0;
/* '*' command; combines the ')' + '[' + '=' + '"' + '(' commands;
show inventory of all currently wielded, worn, or used objects */
int
-doprinuse()
+doprinuse(void)
{
struct obj *otmp;
int ct = 0;
* uses up an object that's on the floor, charging for it as necessary
*/
void
-useupf(obj, numused)
-register struct obj *obj;
-long numused;
+useupf(register struct obj *obj, long numused)
{
register struct obj *otmp;
boolean at_u = (obj->ox == u.ux && obj->oy == u.uy);
static NEARDATA const char *oth_names[] = { "Bagged/Boxed items" };
char *
-let_to_name(let, unpaid, showsym)
-char let;
-boolean unpaid, showsym;
+let_to_name(char let, boolean unpaid, boolean showsym)
{
const char *ocsymfmt = " ('%c')";
const int invbuf_sympadding = 8; /* arbitrary */
/* release the static buffer used by let_to_name() */
void
-free_invbuf()
+free_invbuf(void)
{
if (g.invbuf)
free((genericptr_t) g.invbuf), g.invbuf = (char *) 0;
/* give consecutive letters to every item in inventory (for !fixinv mode);
gold is always forced to '$' slot at head of list */
void
-reassign()
+reassign(void)
{
int i;
struct obj *obj, *prevobj, *goldobj;
/* getobj callback for item to #adjust */
int
-adjust_ok(obj)
-struct obj *obj;
+adjust_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
* is unnamed and source is named.
*/
int
-doorganize() /* inventory organizer by Del Lamb */
+doorganize(void) /* inventory organizer by Del Lamb */
{
struct obj *obj, *otmp, *splitting, *bumped;
int ix, cur, trycnt;
/* common to display_minventory and display_cinventory */
static void
-invdisp_nothing(hdr, txt)
-const char *hdr, *txt;
+invdisp_nothing(const char *hdr, const char *txt)
{
winid win;
anything any;
/* query_objlist callback: return things that are worn or wielded */
static boolean
-worn_wield_only(obj)
-struct obj *obj;
+worn_wield_only(struct obj *obj)
{
#if 1
/* check for things that *are* worn or wielded (only used for monsters,
* MINV_ALL - display all inventory
*/
struct obj *
-display_minventory(mon, dflags, title)
-register struct monst *mon;
-int dflags;
-char *title;
+display_minventory(register struct monst *mon, int dflags, char *title)
{
struct obj *ret;
char tmp[QBUFSZ];
* Currently, this is only used for statues, via wand of probing.
*/
struct obj *
-display_cinventory(obj)
-register struct obj *obj;
+display_cinventory(register struct obj *obj)
{
struct obj *ret;
char qbuf[QBUFSZ];
static boolean
-only_here(obj)
-struct obj *obj;
+only_here(struct obj *obj)
{
return (obj->ox == g.only.x && obj->oy == g.only.y);
}
* Currently, this is only used with a wand of probing zapped downwards.
*/
int
-display_binventory(x, y, as_if_seen)
-int x, y;
-boolean as_if_seen;
+display_binventory(int x, int y, boolean as_if_seen)
{
struct obj *obj;
menu_item *selected = 0;
#define LSF_SHOW 0x1 /* display the light source */
#define LSF_NEEDS_FIXUP 0x2 /* need oid fixup */
-static light_source *FDECL(new_light_core, (XCHAR_P, XCHAR_P, int, int,
- anything *));
-static void NDECL(discard_flashes);
-static void FDECL(write_ls, (NHFILE *, light_source *));
-static int FDECL(maybe_write_ls, (NHFILE *, int, BOOLEAN_P));
+static light_source *new_light_core(xchar, xchar, int, int, anything *);
+static void discard_flashes(void);
+static void write_ls(NHFILE *, light_source *);
+static int maybe_write_ls(NHFILE *, int, boolean);
/* imported from vision.c, for small circles */
extern xchar circle_data[];
/* Create a new light source. Caller (and extern.h) doesn't need to know
anything about type 'light_source'. */
void
-new_light_source(x, y, range, type, id)
- xchar x, y;
- int range, type;
- anything *id;
+new_light_source(xchar x, xchar y, int range, int type, anything *id)
{
(void) new_light_core(x, y, range, type, id);
}
/* Create a new light source and return it. Only used within this file. */
static light_source *
-new_light_core(x, y, range, type, id)
- xchar x, y;
- int range, type;
- anything *id;
+new_light_core(xchar x, xchar y, int range, int type, anything *id)
{
light_source *ls;
* to an object at a time.
*/
void
-del_light_source(type, id)
-int type;
-anything *id;
+del_light_source(int type, anything *id)
{
light_source *curr, *prev;
anything tmp_id;
/* Mark locations that are temporarily lit via mobile light sources. */
void
-do_light_sources(cs_rows)
-xchar **cs_rows;
+do_light_sources(xchar **cs_rows)
{
int x, y, min_x, max_x, max_y, offset;
xchar *limits;
remember terrain, objects, and monsters being revealed;
if 'obj' is Null, <x,y> is being hit by a camera's light flash */
void
-show_transient_light(obj, x, y)
-struct obj *obj;
-int x, y;
+show_transient_light(struct obj *obj, int x, int y)
{
light_source *ls = 0;
anything cameraflash;
monster" glyph at locations where a monster was flagged for being
visible during transient light movement but can't be seen now */
void
-transient_light_cleanup()
+transient_light_cleanup(void)
{
struct monst *mon;
int mtempcount;
/* camera flashes have Null object; caller wants to get rid of them now */
static void
-discard_flashes()
+discard_flashes(void)
{
light_source *ls, *nxt_ls;
#define mon_is_local(mon) ((mon)->mx > 0)
struct monst *
-find_mid(nid, fmflags)
-unsigned nid;
-unsigned fmflags;
+find_mid(unsigned nid, unsigned fmflags)
{
struct monst *mtmp;
/* Save all light sources of the given range. */
void
-save_light_sources(nhfp, range)
-NHFILE *nhfp;
-int range;
+save_light_sources(NHFILE *nhfp, int range)
{
int count, actual, is_global;
light_source **prev, *curr;
* pointers.
*/
void
-restore_light_sources(nhfp)
-NHFILE *nhfp;
+restore_light_sources(NHFILE *nhfp)
{
int count = 0;
light_source *ls;
/* to support '#stats' wizard-mode command */
void
-light_stats(hdrfmt, hdrbuf, count, size)
-const char *hdrfmt;
-char *hdrbuf;
-long *count, *size;
+light_stats(const char *hdrfmt, char *hdrbuf, long *count, long *size)
{
light_source *ls;
/* Relink all lights that are so marked. */
void
-relink_light_sources(ghostly)
-boolean ghostly;
+relink_light_sources(boolean ghostly)
{
char which;
unsigned nid;
* the light source out.
*/
static int
-maybe_write_ls(nhfp, range, write_it)
-NHFILE *nhfp;
-int range;
-boolean write_it;
+maybe_write_ls(NHFILE *nhfp, int range, boolean write_it)
{
int count = 0, is_global;
light_source *ls;
}
void
-light_sources_sanity_check()
+light_sources_sanity_check(void)
{
light_source *ls;
struct monst *mtmp;
/* Write a light source structure to disk. */
static void
-write_ls(nhfp, ls)
-NHFILE *nhfp;
-light_source *ls;
+write_ls(NHFILE *nhfp, light_source *ls)
{
anything arg_save;
struct obj *otmp;
/* Change light source's ID from src to dest. */
void
-obj_move_light_source(src, dest)
-struct obj *src, *dest;
+obj_move_light_source(struct obj *src, struct obj *dest)
{
light_source *ls;
/* return true if there exist any light sources */
boolean
-any_light_source()
+any_light_source(void)
{
return (boolean) (g.light_base != (light_source *) 0);
}
* only for burning light sources.
*/
void
-snuff_light_source(x, y)
-int x, y;
+snuff_light_source(int x, int y)
{
light_source *ls;
struct obj *obj;
/* Return TRUE if object sheds any light at all. */
boolean
-obj_sheds_light(obj)
-struct obj *obj;
+obj_sheds_light(struct obj *obj)
{
/* so far, only burning objects shed light */
return obj_is_burning(obj);
/* Return TRUE if sheds light AND will be snuffed by end_burn(). */
boolean
-obj_is_burning(obj)
-struct obj *obj;
+obj_is_burning(struct obj *obj)
{
return (boolean) (obj->lamplit && (ignitable(obj)
|| artifact_light(obj)));
/* copy the light source(s) attached to src, and attach it/them to dest */
void
-obj_split_light_source(src, dest)
-struct obj *src, *dest;
+obj_split_light_source(struct obj *src, struct obj *dest)
{
light_source *ls, *new_ls;
/* light source `src' has been folded into light source `dest';
used for merging lit candles and adding candle(s) to lit candelabrum */
void
-obj_merge_light_sources(src, dest)
-struct obj *src, *dest;
+obj_merge_light_sources(struct obj *src, struct obj *dest)
{
light_source *ls;
/* light source `obj' is being made brighter or dimmer */
void
-obj_adjust_light_radius(obj, new_radius)
-struct obj *obj;
-int new_radius;
+obj_adjust_light_radius(struct obj *obj, int new_radius)
{
light_source *ls;
/* Candlelight is proportional to the number of candles;
minimum range is 2 rather than 1 for playability. */
int
-candle_light_range(obj)
-struct obj *obj;
+candle_light_range(struct obj *obj)
{
int radius;
/* light emitting artifact's range depends upon its curse/bless state */
int
-arti_light_radius(obj)
-struct obj *obj;
+arti_light_radius(struct obj *obj)
{
/*
* Used by begin_burn() when setting up a new light source
/* adverb describing lit artifact's light; depends on curse/bless state */
const char *
-arti_light_description(obj)
-struct obj *obj;
+arti_light_description(struct obj *obj)
{
switch (arti_light_radius(obj)) {
case 3:
}
int
-wiz_light_sources()
+wiz_light_sources(void)
{
winid win;
char buf[BUFSZ];
#include "hack.h"
/* occupation callbacks */
-static int NDECL(picklock);
-static int NDECL(forcelock);
+static int picklock(void);
+static int forcelock(void);
-static const char *NDECL(lock_action);
-static boolean FDECL(obstructed, (int, int, BOOLEAN_P));
-static void FDECL(chest_shatter_msg, (struct obj *));
+static const char *lock_action(void);
+static boolean obstructed(int, int, boolean);
+static void chest_shatter_msg(struct obj *);
boolean
-picking_lock(x, y)
-int *x, *y;
+picking_lock(int *x, int *y)
{
if (g.occupation == picklock) {
*x = u.ux + u.dx;
}
boolean
-picking_at(x, y)
-int x, y;
+picking_at(int x, int y)
{
return (boolean) (g.occupation == picklock && g.xlock.door == &levl[x][y]);
}
/* produce an occupation string appropriate for the current activity */
static const char *
-lock_action()
+lock_action(void)
{
/* "unlocking"+2 == "locking" */
static const char *actions[] = {
/* try to open/close a lock */
static int
-picklock(VOID_ARGS)
+picklock(void)
{
if (g.xlock.box) {
if (g.xlock.box->where != OBJ_FLOOR
}
void
-breakchestlock(box, destroyit)
-struct obj *box;
-boolean destroyit;
+breakchestlock(struct obj *box, boolean destroyit)
{
if (!destroyit) { /* bill for the box but not for its contents */
struct obj *hide_contents = box->cobj;
/* try to force a locked chest */
static int
-forcelock(VOID_ARGS)
+forcelock(void)
{
if ((g.xlock.box->ox != u.ux) || (g.xlock.box->oy != u.uy))
return ((g.xlock.usedtime = 0)); /* you or it moved */
}
void
-reset_pick()
+reset_pick(void)
{
g.xlock.usedtime = g.xlock.chance = g.xlock.picktyp = 0;
g.xlock.magic_key = FALSE;
/* level change or object deletion; context may no longer be valid */
void
-maybe_reset_pick(container)
-struct obj *container; /* passed from obfree() */
+maybe_reset_pick(struct obj *container) /* passed from obfree() */
{
/*
* If a specific container, only clear context if it is for that
/* pick a tool for autounlock */
struct obj *
-autokey(opening)
-boolean opening; /* True: key, pick, or card; False: key or pick */
+autokey(boolean opening) /* True: key, pick, or card; False: key or pick */
{
struct obj *o, *key, *pick, *card, *akey, *apick, *acard;
/* player is applying a key, lock pick, or credit card */
int
-pick_lock(pick, rx, ry, container)
-struct obj *pick;
-xchar rx, ry; /* coordinates of doors/container, for autounlock: does not
- prompt for direction if these are set */
-struct obj *container; /* container, for autounlock */
+pick_lock(struct obj *pick,
+ xchar rx, xchar ry, /* coordinates of doors/container,
+ for autounlock: does not prompt
+ for direction if these are set */
+ struct obj *container) /* container, for autounlock */
{
int picktyp, c, ch;
coord cc;
/* try to force a chest with your weapon */
int
-doforce()
+doforce(void)
{
register struct obj *otmp;
register int c, picktyp;
}
boolean
-stumble_on_door_mimic(x, y)
-int x, y;
+stumble_on_door_mimic(int x, int y)
{
struct monst *mtmp;
/* the 'O' command - try to open a door */
int
-doopen()
+doopen(void)
{
return doopen_indir(0, 0);
}
/* try to open a door in direction u.dx/u.dy */
int
-doopen_indir(x, y)
-int x, y;
+doopen_indir(int x, int y)
{
coord cc;
register struct rm *door;
}
static boolean
-obstructed(x, y, quietly)
-register int x, y;
-boolean quietly;
+obstructed(register int x, register int y, boolean quietly)
{
register struct monst *mtmp = m_at(x, y);
/* the 'C' command - try to close a door */
int
-doclose()
+doclose(void)
{
register int x, y;
register struct rm *door;
/* box obj was hit with spell or wand effect otmp;
returns true if something happened */
boolean
-boxlock(obj, otmp)
-struct obj *obj, *otmp; /* obj *is* a box */
+boxlock(struct obj *obj, struct obj *otmp) /* obj *is* a box */
{
boolean res = 0;
/* Door/secret door was hit with spell or wand effect otmp;
returns true if something happened */
boolean
-doorlock(otmp, x, y)
-struct obj *otmp;
-int x, y;
+doorlock(struct obj *otmp, int x, int y)
{
register struct rm *door = &levl[x][y];
boolean res = TRUE;
}
static void
-chest_shatter_msg(otmp)
-struct obj *otmp;
+chest_shatter_msg(struct obj *otmp)
{
const char *disposition;
const char *thing;
* random intervals.
*/
-static boolean FDECL(md_start, (coord *));
-static boolean FDECL(md_stop, (coord *, coord *));
-static boolean FDECL(md_rush, (struct monst *, int, int));
-static void FDECL(newmail, (struct mail_info *));
+static boolean md_start(coord *);
+static boolean md_stop(coord *, coord *);
+static boolean md_rush(struct monst *, int, int);
+static void newmail(struct mail_info *);
#if !defined(UNIX) && !defined(VMS)
int mustgetmail = -1;
#if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__))
/* DO trust all SVR4 to typedef uid_t in <sys/types.h> (probably to a long) */
#if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
-extern struct passwd *FDECL(getpwuid, (uid_t));
+extern struct passwd *getpwuid(uid_t);
#else
-extern struct passwd *FDECL(getpwuid, (int));
+extern struct passwd *getpwuid(int);
#endif
#endif
#endif
#endif
void
-free_maildata()
+free_maildata(void)
{
if (mailbox)
free((genericptr_t) mailbox), mailbox = (char *) 0;
}
void
-getmailstatus()
+getmailstatus(void)
{
if (mailbox) {
; /* no need to repeat the setup */
* from newmail() and newphone().
*/
static boolean
-md_start(startp)
-coord *startp;
+md_start(coord *startp)
{
coord testcc; /* scratch coordinates */
int row; /* current row we are checking */
* its point randomly, which is not what we want.
*/
static boolean
-md_stop(stopp, startp)
-coord *stopp; /* stopping position (we fill it in) */
-coord *startp; /* starting position (read only) */
+md_stop(coord *stopp, /* stopping position (we fill it in) */
+ coord *startp) /* starting position (read only) */
{
int x, y, distance, min_distance = -1;
* TRUE otherwise.
*/
static boolean
-md_rush(md, tx, ty)
-struct monst *md;
-register int tx, ty; /* destination of mail daemon */
+md_rush(struct monst *md,
+ register int tx, register int ty) /* destination of mail daemon */
{
struct monst *mon; /* displaced monster */
register int dx, dy; /* direction counters */
/* Deliver a scroll of mail. */
/*ARGSUSED*/
static void
-newmail(info)
-struct mail_info *info;
+newmail(struct mail_info *info)
{
struct monst *md;
coord start, stop;
#if !defined(UNIX) && !defined(VMS)
void
-ckmailstatus()
+ckmailstatus(void)
{
if (u.uswallow || !flags.biff)
return;
/*ARGSUSED*/
void
-readmail(otmp)
-struct obj *otmp UNUSED;
+readmail(struct obj *otmp UNUSED)
{
static const char *junk[] = {
"Report bugs to <%s>.", /*** must be first entry ***/
#ifdef UNIX
void
-ckmailstatus()
+ckmailstatus(void)
{
ck_server_admin_msg();
#if defined(SIMPLE_MAIL) || defined(SERVER_ADMIN_MSG)
void
-read_simplemail(mbox, adminmsg)
-char *mbox;
-boolean adminmsg;
+read_simplemail(char *mbox, boolean adminmsg)
{
FILE* mb = fopen(mbox, "r");
char curline[128], *msg;
#endif /* SIMPLE_MAIL */
void
-ck_server_admin_msg()
+ck_server_admin_msg(void)
{
#ifdef SERVER_ADMIN_MSG
static struct stat ost,nst;
/*ARGSUSED*/
void
-readmail(otmp)
-struct obj *otmp UNUSED;
+readmail(struct obj *otmp UNUSED)
{
#ifdef DEF_MAILREADER /* This implies that UNIX is defined */
register const char *mr = 0;
#ifdef VMS
-extern NDECL(struct mail_info *parse_next_broadcast);
+extern struct mail_info *parse_next_broadcast(void);
volatile int broadcasts = 0;
void
-ckmailstatus()
+ckmailstatus(void)
{
struct mail_info *brdcst;
}
void
-readmail(otmp)
-struct obj *otmp;
+readmail(struct obj *otmp)
{
#ifdef SHELL /* can't access mail reader without spawning subprocess */
const char *txt, *cmd;
(mptr->mlet == S_HUMAN && Role_if(role_pm) \
&& (mptr->msound == MS_LEADER || mptr->msound == MS_NEMESIS))
-static boolean FDECL(uncommon, (int));
-static int FDECL(align_shift, (struct permonst *));
-static boolean FDECL(mk_gen_ok, (int, unsigned, unsigned));
-static boolean FDECL(wrong_elem_type, (struct permonst *));
-static void FDECL(m_initgrp, (struct monst *, int, int, int, int));
-static void FDECL(m_initthrow, (struct monst *, int, int));
-static void FDECL(m_initweap, (struct monst *));
-static void FDECL(m_initinv, (struct monst *));
-static boolean FDECL(makemon_rnd_goodpos, (struct monst *, long, coord *));
+static boolean uncommon(int);
+static int align_shift(struct permonst *);
+static boolean mk_gen_ok(int, unsigned, unsigned);
+static boolean wrong_elem_type(struct permonst *);
+static void m_initgrp(struct monst *, int, int, int, int);
+static void m_initthrow(struct monst *, int, int);
+static void m_initweap(struct monst *);
+static void m_initinv(struct monst *);
+static boolean makemon_rnd_goodpos(struct monst *, long, coord *);
#define m_initsgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 3, mmf)
#define m_initlgrp(mtmp, x, y, mmf) m_initgrp(mtmp, x, y, 10, mmf)
boolean
-is_home_elemental(ptr)
-struct permonst *ptr;
+is_home_elemental(struct permonst *ptr)
{
if (ptr->mlet == S_ELEMENTAL)
switch (monsndx(ptr)) {
* Return true if the given monster cannot exist on this elemental level.
*/
static boolean
-wrong_elem_type(ptr)
-struct permonst *ptr;
+wrong_elem_type(struct permonst *ptr)
{
if (ptr->mlet == S_ELEMENTAL) {
return (boolean) !is_home_elemental(ptr);
/* make a group just like mtmp */
static void
-m_initgrp(mtmp, x, y, n, mmflags)
-struct monst *mtmp;
-int x, y, n, mmflags;
+m_initgrp(struct monst *mtmp, int x, int y, int n, int mmflags)
{
coord mm;
register int cnt = rnd(n);
static
void
-m_initthrow(mtmp, otyp, oquan)
-struct monst *mtmp;
-int otyp, oquan;
+m_initthrow(struct monst *mtmp, int otyp, int oquan)
{
register struct obj *otmp;
}
static void
-m_initweap(mtmp)
-register struct monst *mtmp;
+m_initweap(register struct monst *mtmp)
{
register struct permonst *ptr = mtmp->data;
register int mm = monsndx(ptr);
* Makes up money for monster's inventory.
*/
void
-mkmonmoney(mtmp, amount)
-struct monst *mtmp;
-long amount;
+mkmonmoney(struct monst *mtmp, long amount)
{
struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE);
}
static void
-m_initinv(mtmp)
-register struct monst *mtmp;
+m_initinv(register struct monst *mtmp)
{
register int cnt;
register struct obj *otmp;
/* Note: for long worms, always call cutworm (cutworm calls clone_mon) */
struct monst *
-clone_mon(mon, x, y)
-struct monst *mon;
-xchar x, y; /* clone's preferred location or 0 (near mon) */
+clone_mon(struct monst *mon,
+ xchar x, xchar y) /* clone's preferred location or 0 (near mon) */
{
coord mm;
struct monst *m2;
* TRUE propagation successful
*/
boolean
-propagate(mndx, tally, ghostly)
-int mndx;
-boolean tally;
-boolean ghostly;
+propagate(int mndx, boolean tally, boolean ghostly)
{
boolean gone, result;
int lim = mbirth_limit(mndx);
/* amount of HP to lose from level drain (or gain from Stormbringer) */
int
-monhp_per_lvl(mon)
-struct monst *mon;
+monhp_per_lvl(struct monst *mon)
{
struct permonst *ptr = mon->data;
int hp = rnd(8); /* default is d8 */
/* set up a new monster's initial level and hit points;
used by newcham() as well as by makemon() */
void
-newmonhp(mon, mndx)
-struct monst *mon;
-int mndx;
+newmonhp(struct monst *mon, int mndx)
{
struct permonst *ptr = &mons[mndx];
int basehp = 0;
static const struct mextra zeromextra = DUMMY;
static void
-init_mextra(mex)
-struct mextra *mex;
+init_mextra(struct mextra *mex)
{
*mex = zeromextra;
mex->mcorpsenm = NON_PM;
}
struct mextra *
-newmextra()
+newmextra(void)
{
struct mextra *mextra;
}
static boolean
-makemon_rnd_goodpos(mon, gpflags, cc)
-struct monst *mon;
-long gpflags;
-coord *cc;
+makemon_rnd_goodpos(struct monst *mon, long gpflags, coord *cc)
{
int tryct = 0;
int nx, ny;
* In case we make a monster group, only return the one at [x,y].
*/
struct monst *
-makemon(ptr, x, y, mmflags)
-register struct permonst *ptr;
-register int x, y;
-long mmflags;
+makemon(register struct permonst *ptr,
+ register int x, register int y, long mmflags)
{
register struct monst *mtmp;
struct monst fakemon;
/* caller rejects makemon()'s result; always returns Null */
struct monst *
-unmakemon(mon, mmflags)
-struct monst *mon;
-long mmflags;
+unmakemon(struct monst *mon, long mmflags)
{
boolean countbirth = ((mmflags & MM_NOCOUNTBIRTH) == 0);
int mndx = monsndx(mon->data);
}
int
-mbirth_limit(mndx)
-int mndx;
+mbirth_limit(int mndx)
{
/* There is an implicit limit of 4 for "high priest of <deity>",
* but aligned priests can grow into high priests, thus they aren't
/* used for wand/scroll/spell of create monster */
/* returns TRUE iff you know monsters have been created */
boolean
-create_critters(cnt, mptr, neverask)
-int cnt;
-struct permonst *mptr; /* usually null; used for confused reading */
-boolean neverask;
+create_critters(int cnt,
+ struct permonst *mptr, /* usually null; used for confused reading */
+ boolean neverask)
{
coord c;
int x, y;
}
static boolean
-uncommon(mndx)
-int mndx;
+uncommon(int mndx)
{
if (mons[mndx].geno & (G_NOGEN | G_UNIQ))
return TRUE;
* return an integer in the range of 0-5.
*/
static int
-align_shift(ptr)
-register struct permonst *ptr;
+align_shift(register struct permonst *ptr)
{
static NEARDATA long oldmoves = 0L; /* != 1, starting value of moves */
static NEARDATA s_level *lev;
/* select a random monster type */
struct permonst *
-rndmonst()
+rndmonst(void)
{
register struct permonst *ptr;
register int mndx;
/* decide whether it's ok to generate a candidate monster by mkclass() */
static boolean
-mk_gen_ok(mndx, mvflagsmask, genomask)
-int mndx;
-unsigned mvflagsmask, genomask;
+mk_gen_ok(int mndx, unsigned mvflagsmask, unsigned genomask)
{
struct permonst *ptr = &mons[mndx];
to allow the normal genesis masks to be deactivated.
Returns Null if no monsters in that class can be made. */
struct permonst *
-mkclass(class, spc)
-char class;
-int spc;
+mkclass(char class, int spc)
{
return mkclass_aligned(class, spc, A_NONE);
}
/* mkclass() with alignment restrictions; used by ndemon() */
struct permonst *
-mkclass_aligned(class, spc, atyp)
-char class;
-int spc; /* special mons[].geno handling */
-aligntyp atyp;
+mkclass_aligned(char class, int spc, /* special mons[].geno handling */
+ aligntyp atyp)
{
register int first, last, num = 0;
int k, nums[SPECIAL_PM + 1]; /* +1: insurance for final return value */
genocided types are avoided but extinct ones are acceptable; we don't
check polyok() here--caller accepts some choices !polyok() would reject */
int
-mkclass_poly(class)
-int class;
+mkclass_poly(int class)
{
register int first, last, num = 0;
unsigned gmask;
/* adjust strength of monsters based on u.uz and u.ulevel */
int
-adj_lev(ptr)
-register struct permonst *ptr;
+adj_lev(register struct permonst *ptr)
{
int tmp, tmp2;
/* monster earned experience and will gain some hit points; it might also
grow into a bigger monster (baby to adult, soldier to officer, etc) */
struct permonst *
-grow_up(mtmp, victim)
-struct monst *mtmp, *victim;
+grow_up(struct monst *mtmp, struct monst *victim)
{
int oldtype, newtype, max_increase, cur_increase, lev_limit, hp_threshold;
unsigned fem;
}
struct obj *
-mongets(mtmp, otyp)
-register struct monst *mtmp;
-int otyp;
+mongets(register struct monst *mtmp, int otyp)
{
register struct obj *otmp;
}
int
-golemhp(type)
-int type;
+golemhp(int type)
{
switch (type) {
case PM_STRAW_GOLEM:
* (Some "animal" types are co-aligned, but also hungry.)
*/
boolean
-peace_minded(ptr)
-register struct permonst *ptr;
+peace_minded(register struct permonst *ptr)
{
aligntyp mal = ptr->maligntyp, ual = u.ualign.type;
* it's never bad to kill a hostile monster, although it may not be good.
*/
void
-set_malign(mtmp)
-struct monst *mtmp;
+set_malign(struct monst *mtmp)
{
schar mal = mtmp->data->maligntyp;
boolean coaligned;
/* allocate a new mcorpsenm field for a monster; only need mextra itself */
void
-newmcorpsenm(mtmp)
-struct monst *mtmp;
+newmcorpsenm(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
/* release monster's mcorpsenm field; basically a no-op */
void
-freemcorpsenm(mtmp)
-struct monst *mtmp;
+freemcorpsenm(struct monst *mtmp)
{
if (has_mcorpsenm(mtmp))
MCORPSENM(mtmp) = NON_PM;
};
void
-set_mimic_sym(mtmp)
-register struct monst *mtmp;
+set_mimic_sym(register struct monst *mtmp)
{
int typ, roomno, rt;
unsigned appear, ap_type;
/* release monster from bag of tricks; return number of monsters created */
int
-bagotricks(bag, tipping, seencount)
-struct obj *bag;
-boolean tipping; /* caller emptying entire contents; affects shop handling */
-int *seencount; /* secondary output */
+bagotricks(struct obj *bag,
+ boolean tipping, /* caller emptying entire contents; affects shop handling */
+ int *seencount) /* secondary output */
{
int moncount = 0;
CLC_GEYSER
};
-static void FDECL(cursetxt, (struct monst *, BOOLEAN_P));
-static int FDECL(choose_magic_spell, (int));
-static int FDECL(choose_clerical_spell, (int));
-static int FDECL(m_cure_self, (struct monst *, int));
-static void FDECL(cast_wizard_spell, (struct monst *, int, int));
-static void FDECL(cast_cleric_spell, (struct monst *, int, int));
-static boolean FDECL(is_undirected_spell, (unsigned int, int));
+static void cursetxt(struct monst *, boolean);
+static int choose_magic_spell(int);
+static int choose_clerical_spell(int);
+static int m_cure_self(struct monst *, int);
+static void cast_wizard_spell(struct monst *, int, int);
+static void cast_cleric_spell(struct monst *, int, int);
+static boolean is_undirected_spell(unsigned int, int);
static boolean
-FDECL(spell_would_be_useless, (struct monst *, unsigned int, int));
+spell_would_be_useless(struct monst *, unsigned int, int);
extern const char *const flash_types[]; /* from zap.c */
/* feedback when frustrated monster couldn't cast a spell */
-static
-void
-cursetxt(mtmp, undirected)
-struct monst *mtmp;
-boolean undirected;
+static void
+cursetxt(struct monst *mtmp, boolean undirected)
{
if (canseemon(mtmp) && couldsee(mtmp->mx, mtmp->my)) {
const char *point_msg; /* spellcasting monsters are impolite */
/* convert a level based random selection into a specific mage spell;
inappropriate choices will be screened out by spell_would_be_useless() */
static int
-choose_magic_spell(spellval)
-int spellval;
+choose_magic_spell(int spellval)
{
/* for 3.4.3 and earlier, val greater than 22 selected default spell */
while (spellval > 24 && rn2(25))
/* convert a level based random selection into a specific cleric spell */
static int
-choose_clerical_spell(spellnum)
-int spellnum;
+choose_clerical_spell(int spellnum)
{
/* for 3.4.3 and earlier, num greater than 13 selected the default spell
*/
* 0: unsuccessful spell
*/
int
-castmu(mtmp, mattk, thinks_it_foundyou, foundyou)
-register struct monst *mtmp;
-register struct attack *mattk;
-boolean thinks_it_foundyou;
-boolean foundyou;
+castmu(register struct monst *mtmp,
+ register struct attack *mattk,
+ boolean thinks_it_foundyou,
+ boolean foundyou)
{
int dmg, ml = mtmp->m_lev;
int ret;
}
static int
-m_cure_self(mtmp, dmg)
-struct monst *mtmp;
-int dmg;
+m_cure_self(struct monst *mtmp, int dmg)
{
if (mtmp->mhp < mtmp->mhpmax) {
if (canseemon(mtmp))
*/
static
void
-cast_wizard_spell(mtmp, dmg, spellnum)
-struct monst *mtmp;
-int dmg;
-int spellnum;
+cast_wizard_spell(struct monst *mtmp, int dmg, int spellnum)
{
if (dmg == 0 && !is_undirected_spell(AD_SPEL, spellnum)) {
impossible("cast directed wizard spell (%d) with dmg=0?", spellnum);
mdamageu(mtmp, dmg);
}
-static
-void
-cast_cleric_spell(mtmp, dmg, spellnum)
-struct monst *mtmp;
-int dmg;
-int spellnum;
+static void
+cast_cleric_spell(struct monst *mtmp, int dmg, int spellnum)
{
if (dmg == 0 && !is_undirected_spell(AD_CLRC, spellnum)) {
impossible("cast directed cleric spell (%d) with dmg=0?", spellnum);
mdamageu(mtmp, dmg);
}
-static
-boolean
-is_undirected_spell(adtyp, spellnum)
-unsigned int adtyp;
-int spellnum;
+static boolean
+is_undirected_spell(unsigned int adtyp, int spellnum)
{
if (adtyp == AD_SPEL) {
switch (spellnum) {
}
/* Some spells are useless under some circumstances. */
-static
-boolean
-spell_would_be_useless(mtmp, adtyp, spellnum)
-struct monst *mtmp;
-unsigned int adtyp;
-int spellnum;
+static boolean
+spell_would_be_useless(struct monst *mtmp, unsigned int adtyp, int spellnum)
{
/* Some spells don't require the player to really be there and can be cast
* by the monster when you're invisible, yet still shouldn't be cast when
/* monster uses spell (ranged) */
int
-buzzmu(mtmp, mattk)
-register struct monst *mtmp;
-register struct attack *mattk;
+buzzmu(register struct monst *mtmp, register struct attack *mattk)
{
/* don't print constant stream of curse messages for 'normal'
spellcasting monsters at range */
/* REPRODUCIBLE_BUILD will change this to TRUE */
static boolean date_via_env = FALSE;
-static char *FDECL(version_string, (char *, const char *));
-static char *FDECL(version_id_string, (char *, const char *));
-static char *FDECL(bannerc_string, (char *, const char *));
+static char *version_string(char *, const char *);
+static char *version_id_string(char *, const char *);
+static char *bannerc_string(char *, const char *);
-static void NDECL(make_version);
-static char *FDECL(eos, (char *));
+static void make_version(void);
+static char *eos(char *);
#if 0
-static char *FDECL(mdlib_strsubst, (char *, const char *, const char *));
+static char *mdlib_strsubst(char *, const char *, const char *);
#endif
#ifndef HAS_NO_MKSTEMP
#ifdef _MSC_VER
-static int FDECL(mkstemp, (char *));
+static int mkstemp(char *);
#endif
#endif
#endif /* MAKEDEFS_C || FOR_RUNTIME */
#if defined(MAKEDEFS_C) || defined(FOR_RUNTIME) || defined(WIN32) \
|| (defined(CROSSCOMPILE_TARGET) && defined(__DATE__) && defined(__TIME__))
-static int FDECL(case_insensitive_comp, (const char *, const char *));
+static int case_insensitive_comp(const char *, const char *);
#endif
#if !defined(MAKEDEFS_C) && defined(WIN32)
#endif
/* these two are in extern.h but we don't include hack.h */
-void NDECL(runtime_info_init);
-const char *FDECL(do_runtime_info, (int *));
+void runtime_info_init(void);
+const char *do_runtime_info(int *);
-void NDECL(build_options);
-static int NDECL(count_and_validate_winopts);
-static void FDECL(opt_out_words, (char *, int *));
-static void NDECL(build_savebones_compat_string);
+void build_options(void);
+static int count_and_validate_winopts(void);
+static void opt_out_words(char *, int *);
+static void build_savebones_compat_string(void);
static int idxopttext, done_runtime_opt_init_once = 0;
#define MAXOPT 40
#if !defined(MAKEDEFS_C) && defined(CROSSCOMPILE_TARGET) \
#endif /* MD_IGNORED_FEATUES */
static void
-make_version()
+make_version(void)
{
register int i;
#if defined(MAKEDEFS_C) || defined(FOR_RUNTIME)
static char *
-version_string(outbuf, delim)
-char *outbuf;
-const char *delim;
+version_string(char *outbuf, const char *delim)
{
Sprintf(outbuf, "%d%s%d%s%d", VERSION_MAJOR, delim, VERSION_MINOR, delim,
PATCHLEVEL);
}
static char *
-version_id_string(outbuf, build_date)
-char *outbuf;
-const char *build_date;
+version_id_string(char *outbuf, const char *build_date)
{
char subbuf[64], versbuf[64];
char statusbuf[64];
/* still within #if MAKDEFS_C || FOR_RUNTIME */
static char *
-bannerc_string(outbuf, build_date)
-char *outbuf;
-const char *build_date;
+bannerc_string(char *outbuf, const char *build_date)
{
char subbuf[64], versbuf[64];
#ifndef HAS_NO_MKSTEMP
#ifdef _MSC_VER
int
-mkstemp(template)
-char *template;
+mkstemp(char *template)
{
int err;
#if defined(MAKEDEFS_C) || defined(FOR_RUNTIME) || defined(WIN32) \
|| (defined(CROSSCOMPILE_TARGET) && defined(__DATE__) && defined(__TIME__))
static int
-case_insensitive_comp(s1, s2)
-const char *s1;
-const char *s2;
+case_insensitive_comp(const char *s1, const char *s2)
{
uchar u1, u2;
#endif
static char *
-eos(str)
-char *str;
+eos(char *str)
{
while (*str)
str++;
#if 0
static char *
-mdlib_strsubst(bp, orig, replacement)
-char *bp;
-const char *orig, *replacement;
+mdlib_strsubst(char *bp, const char *orig, const char *replacement)
{
char *found, buf[BUFSZ];
static char save_bones_compat_buf[BUFSZ];
static void
-build_savebones_compat_string()
+build_savebones_compat_string(void)
{
#ifdef VERSION_COMPATIBILITY
unsigned long uver = VERSION_COMPATIBILITY,
};
int
-count_and_validate_winopts(VOID_ARGS)
+count_and_validate_winopts(void)
{
int i, cnt = 0;
}
static void
-opt_out_words(str, length_p)
-char *str; /* input, but modified during processing */
-int *length_p; /* in/out */
+opt_out_words(char *str, /* input, but modified during processing */
+ int *length_p) /* in/out */
{
char *word;
}
void
-build_options()
+build_options(void)
{
char buf[BUFSZ];
int i, length, winsyscnt, cnt = 0;
#endif
void
-runtime_info_init()
+runtime_info_init(void)
{
#if !defined(MAKEDEFS_C) && defined(CROSSCOMPILE_TARGET) \
&& defined(__DATE__) && defined(__TIME__)
}
const char *
-do_runtime_info(rtcontext)
-int *rtcontext;
+do_runtime_info(int *rtcontext)
{
const char *retval = (const char *) 0;
static const char brief_feeling[] =
"have a %s feeling for a moment, then it passes.";
-static int FDECL(hitmm, (struct monst *, struct monst *,
- struct attack *, struct obj *, int));
-static int FDECL(gazemm, (struct monst *, struct monst *, struct attack *));
-static int FDECL(gulpmm, (struct monst *, struct monst *, struct attack *));
-static int FDECL(explmm, (struct monst *, struct monst *, struct attack *));
-static int FDECL(mdamagem, (struct monst *, struct monst *,
- struct attack *, struct obj *, int));
-static void FDECL(mswingsm, (struct monst *, struct monst *, struct obj *));
-static void FDECL(noises, (struct monst *, struct attack *));
-static void FDECL(pre_mm_attack, (struct monst *, struct monst *));
-static void FDECL(missmm, (struct monst *, struct monst *, struct attack *));
-static int FDECL(passivemm, (struct monst *, struct monst *,
- BOOLEAN_P, int, struct obj *));
+static int hitmm(struct monst *, struct monst *, struct attack *, struct obj *,
+ int);
+static int gazemm(struct monst *, struct monst *, struct attack *);
+static int gulpmm(struct monst *, struct monst *, struct attack *);
+static int explmm(struct monst *, struct monst *, struct attack *);
+static int mdamagem(struct monst *, struct monst *, struct attack *,
+ struct obj *, int);
+static void mswingsm(struct monst *, struct monst *, struct obj *);
+static void noises(struct monst *, struct attack *);
+static void pre_mm_attack(struct monst *, struct monst *);
+static void missmm(struct monst *, struct monst *, struct attack *);
+static int passivemm(struct monst *, struct monst *, boolean, int,
+ struct obj *);
static void
-noises(magr, mattk)
-register struct monst *magr;
-register struct attack *mattk;
+noises(register struct monst *magr, register struct attack *mattk)
{
boolean farq = (distu(magr->mx, magr->my) > 15);
}
static void
-pre_mm_attack(magr, mdef)
-struct monst *magr, *mdef;
+pre_mm_attack(struct monst *magr, struct monst *mdef)
{
boolean showit = FALSE;
static
void
-missmm(magr, mdef, mattk)
-register struct monst *magr, *mdef;
-struct attack *mattk;
+missmm(register struct monst *magr, register struct monst *mdef,
+ struct attack *mattk)
{
const char *fmt;
char buf[BUFSZ];
*/
/* have monsters fight each other */
int
-fightm(mtmp)
-register struct monst *mtmp;
+fightm(register struct monst *mtmp)
{
register struct monst *mon, *nmon;
int result, has_u_swallowed;
* returns same results as mattackm().
*/
int
-mdisplacem(magr, mdef, quietly)
-register struct monst *magr, *mdef;
-boolean quietly;
+mdisplacem(register struct monst *magr, register struct monst *mdef,
+ boolean quietly)
{
struct permonst *pa, *pd;
int tx, ty, fx, fy;
* In the case of exploding monsters, the monster dies as well.
*/
int
-mattackm(magr, mdef)
-register struct monst *magr, *mdef;
+mattackm(register struct monst *magr, register struct monst *mdef)
{
int i, /* loop counter */
tmp, /* amour class difference */
/* Returns the result of mdamagem(). */
static int
-hitmm(magr, mdef, mattk, mwep, dieroll)
-register struct monst *magr, *mdef;
-struct attack *mattk;
-struct obj *mwep;
-int dieroll;
+hitmm(register struct monst *magr, register struct monst *mdef,
+ struct attack *mattk, struct obj *mwep, int dieroll)
{
boolean weaponhit = (mattk->aatyp == AT_WEAP
|| (mattk->aatyp == AT_CLAW && mwep)),
/* Returns the same values as mdamagem(). */
static int
-gazemm(magr, mdef, mattk)
-register struct monst *magr, *mdef;
-struct attack *mattk;
+gazemm(register struct monst *magr, register struct monst *mdef,
+ struct attack *mattk)
{
char buf[BUFSZ];
/* return True if magr is allowed to swallow mdef, False otherwise */
boolean
-engulf_target(magr, mdef)
-struct monst *magr, *mdef;
+engulf_target(struct monst *magr, struct monst *mdef)
{
struct rm *lev;
int dx, dy;
/* Returns the same values as mattackm(). */
static int
-gulpmm(magr, mdef, mattk)
-register struct monst *magr, *mdef;
-register struct attack *mattk;
+gulpmm(register struct monst *magr, register struct monst *mdef,
+ register struct attack *mattk)
{
xchar ax, ay, dx, dy;
int status;
}
static int
-explmm(magr, mdef, mattk)
-struct monst *magr, *mdef;
-struct attack *mattk;
+explmm(struct monst *magr, struct monst *mdef, struct attack *mattk)
{
int result;
* See comment at top of mattackm(), for return values.
*/
static int
-mdamagem(magr, mdef, mattk, mwep, dieroll)
-struct monst *magr, *mdef;
-struct attack *mattk;
-struct obj *mwep;
-int dieroll;
+mdamagem(struct monst *magr, struct monst *mdef,
+ struct attack *mattk, struct obj *mwep, int dieroll)
{
struct permonst *pa = magr->data, *pd = mdef->data;
int armpro;
}
int
-mon_poly(magr, mdef, dmg)
-struct monst *magr, *mdef;
-int dmg;
+mon_poly(struct monst *magr, struct monst *mdef, int dmg)
{
if (mdef == &g.youmonst) {
if (Antimagic) {
}
void
-paralyze_monst(mon, amt)
-struct monst *mon;
-int amt;
+paralyze_monst(struct monst *mon, int amt)
{
if (amt > 127)
amt = 127;
/* `mon' is hit by a sleep attack; return 1 if it's affected, 0 otherwise */
int
-sleep_monst(mon, amt, how)
-struct monst *mon;
-int amt, how;
+sleep_monst(struct monst *mon, int amt, int how)
{
if (resists_sleep(mon)
|| (how >= 0 && resist(mon, (char) how, 0, NOTELL))) {
/* sleeping grabber releases, engulfer doesn't; don't use for paralysis! */
void
-slept_monst(mon)
-struct monst *mon;
+slept_monst(struct monst *mon)
{
if ((mon->msleeping || !mon->mcanmove) && mon == u.ustuck
&& !sticks(g.youmonst.data) && !u.uswallow) {
}
void
-rustm(mdef, obj)
-struct monst *mdef;
-struct obj *obj;
+rustm(struct monst *mdef, struct obj *obj)
{
int dmgtyp = -1, chance = 1;
}
static void
-mswingsm(magr, mdef, otemp)
-struct monst *magr, *mdef;
-struct obj *otemp;
+mswingsm(struct monst *magr, struct monst *mdef, struct obj *otemp)
{
if (flags.verbose && !Blind && mon_visible(magr)) {
pline("%s %s %s%s %s at %s.", Monnam(magr),
* handled above. Returns same values as mattackm.
*/
static int
-passivemm(magr, mdef, mhitb, mdead, mwep)
-register struct monst *magr, *mdef;
-boolean mhitb;
-int mdead;
-struct obj *mwep;
+passivemm(register struct monst *magr, register struct monst *mdef,
+ boolean mhitb, int mdead, struct obj *mwep)
{
register struct permonst *mddat = mdef->data;
register struct permonst *madat = magr->data;
/* hero or monster has successfully hit target mon with drain energy attack */
void
-xdrainenergym(mon, givemsg)
-struct monst *mon;
-boolean givemsg;
+xdrainenergym(struct monst *mon, boolean givemsg)
{
if (mon->mspec_used < 20 /* limit draining */
&& (attacktype(mon->data, AT_MAGC)
/* "aggressive defense"; what type of armor prevents specified attack
from touching its target? */
long
-attk_protection(aatyp)
-int aatyp;
+attk_protection(int aatyp)
{
long w_mask = 0L;
static NEARDATA struct obj *mon_currwep = (struct obj *) 0;
-static void FDECL(missmu, (struct monst *, BOOLEAN_P, struct attack *));
-static void FDECL(mswings, (struct monst *, struct obj *));
-static void FDECL(wildmiss, (struct monst *, struct attack *));
-static void FDECL(summonmu, (struct monst *, BOOLEAN_P));
-static int FDECL(hitmu, (struct monst *, struct attack *));
-static int FDECL(gulpmu, (struct monst *, struct attack *));
-static int FDECL(explmu, (struct monst *, struct attack *, BOOLEAN_P));
-static void FDECL(mayberem, (struct monst *, const char *,
- struct obj *, const char *));
-static int FDECL(passiveum, (struct permonst *, struct monst *,
- struct attack *));
+static void missmu(struct monst *, boolean, struct attack *);
+static void mswings(struct monst *, struct obj *);
+static void wildmiss(struct monst *, struct attack *);
+static void summonmu(struct monst *, boolean);
+static int hitmu(struct monst *, struct attack *);
+static int gulpmu(struct monst *, struct attack *);
+static int explmu(struct monst *, struct attack *, boolean);
+static void mayberem(struct monst *, const char *, struct obj *,
+ const char *);
+static int passiveum(struct permonst *, struct monst *, struct attack *);
#define ld() ((yyyymmdd((time_t) 0) - (getyear() * 10000L)) == 0xe5)
void
-hitmsg(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+hitmsg(struct monst *mtmp, struct attack *mattk)
{
int compat;
const char *pfmt = 0;
/* monster missed you */
static void
-missmu(mtmp, nearmiss, mattk)
-struct monst *mtmp;
-boolean nearmiss;
-struct attack *mattk;
+missmu(struct monst *mtmp, boolean nearmiss, struct attack *mattk)
{
if (!canspotmon(mtmp))
map_invisible(mtmp->mx, mtmp->my);
/* monster swings obj */
static void
-mswings(mtmp, otemp)
-struct monst *mtmp;
-struct obj *otemp;
+mswings(struct monst *mtmp, struct obj *otemp)
{
if (flags.verbose && !Blind && mon_visible(mtmp)) {
pline("%s %s %s%s %s.", Monnam(mtmp),
/* return how a poison attack was delivered */
const char *
-mpoisons_subj(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+mpoisons_subj(struct monst *mtmp, struct attack *mattk)
{
if (mattk->aatyp == AT_WEAP) {
struct obj *mwep = (mtmp == &g.youmonst) ? uwep : MON_WEP(mtmp);
/* called when your intrinsic speed is taken away */
void
-u_slow_down()
+u_slow_down(void)
{
HFast = 0L;
if (!Fast)
/* monster attacked your displaced image */
static void
-wildmiss(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+wildmiss(struct monst *mtmp, struct attack *mattk)
{
int compat;
const char *Monst_name; /* Monnam(mtmp) */
}
void
-expels(mtmp, mdat, message)
-struct monst *mtmp;
-struct permonst *mdat; /* if mtmp is polymorphed, mdat != mtmp->data */
-boolean message;
+expels(struct monst *mtmp,
+ struct permonst *mdat, /* if mtmp is polymorphed, mdat != mtmp->data */
+ boolean message)
{
g.context.botl = 1;
if (message) {
/* select a monster's next attack, possibly substituting for its usual one */
struct attack *
-getmattk(magr, mdef, indx, prev_result, alt_attk_buf)
-struct monst *magr, *mdef;
-int indx, prev_result[];
-struct attack *alt_attk_buf;
+getmattk(struct monst *magr, struct monst *mdef,
+ int indx, int prev_result[], struct attack *alt_attk_buf)
{
struct permonst *mptr = magr->data;
struct attack *attk = &mptr->mattk[indx];
* take care of it...
*/
int
-mattacku(mtmp)
-register struct monst *mtmp;
+mattacku(register struct monst *mtmp)
{
struct attack *mattk, alt_attk;
int i, j = 0, tmp, sum[NATTK];
/* monster summons help for its fight against hero */
static void
-summonmu(mtmp, youseeit)
-struct monst *mtmp;
-boolean youseeit;
+summonmu(struct monst *mtmp, boolean youseeit)
{
struct permonst *mdat = mtmp->data;
}
boolean
-diseasemu(mdat)
-struct permonst *mdat;
+diseasemu(struct permonst *mdat)
{
if (Sick_resistance) {
You_feel("a slight illness.");
/* check whether slippery clothing protects from hug or wrap attack */
boolean
-u_slip_free(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+u_slip_free(struct monst *mtmp, struct attack *mattk)
{
struct obj *obj = (uarmc ? uarmc : uarm);
/* armor that sufficiently covers the body might be able to block magic */
int
-magic_negation(mon)
-struct monst *mon;
+magic_negation(struct monst *mon)
{
struct obj *o;
long wearmask;
* returns MM_ flags
*/
static int
-hitmu(mtmp, mattk)
-register struct monst *mtmp;
-register struct attack *mattk;
+hitmu(register struct monst *mtmp, register struct attack *mattk)
{
struct permonst *mdat = mtmp->data;
/* int uncancelled; */
* to see if an engulfing attack should immediately take affect, like
* a passive attack. TRUE if engulfing blindness occurred */
boolean
-gulp_blnd_check()
+gulp_blnd_check(void)
{
struct attack *mattk;
/* monster swallows you, or damage if u.uswallow */
static int
-gulpmu(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+gulpmu(struct monst *mtmp, struct attack *mattk)
{
struct trap *t = t_at(u.ux, u.uy);
int tmp = d((int) mattk->damn, (int) mattk->damd);
/* monster explodes in your face */
static int
-explmu(mtmp, mattk, ufound)
-struct monst *mtmp;
-struct attack *mattk;
-boolean ufound;
+explmu(struct monst *mtmp, struct attack *mattk, boolean ufound)
{
boolean physical_damage = TRUE, kill_agr = TRUE;
/* monster gazes at you */
int
-gazemu(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+gazemu(struct monst *mtmp, struct attack *mattk)
{
static const char *const reactions[] = {
"confused", /* [0] */
/* mtmp hits you for n points damage */
void
-mdamageu(mtmp, n)
-struct monst *mtmp;
-int n;
+mdamageu(struct monst *mtmp, int n)
{
g.context.botl = 1;
if (Upolyd) {
* 2 if wrong gender for nymph
*/
int
-could_seduce(magr, mdef, mattk)
-struct monst *magr, *mdef;
-struct attack *mattk; /* non-Null: current attack; Null: general capability */
+could_seduce(struct monst *magr, struct monst *mdef,
+ struct attack *mattk) /* non-Null: current attack; Null: general capability */
{
struct permonst *pagr;
boolean agrinvis, defperc;
/* returns 1 if monster teleported (or hero leaves monster's vicinity) */
int
-doseduce(mon)
-struct monst *mon;
+doseduce(struct monst *mon)
{
struct obj *ring, *nring;
boolean fem = (mon->data == &mons[PM_AMOROUS_DEMON]
/* 'mon' tries to remove a piece of hero's armor */
static void
-mayberem(mon, seducer, obj, str)
-struct monst *mon;
-const char *seducer; /* only used for alternate message */
-struct obj *obj;
-const char *str;
+mayberem(struct monst *mon,
+ const char *seducer, /* only used for alternate message */
+ struct obj *obj, const char *str)
{
char qbuf[QBUFSZ];
* damage applies.
*/
static int
-passiveum(olduasmon, mtmp, mattk)
-struct permonst *olduasmon;
-struct monst *mtmp;
-struct attack *mattk;
+passiveum(struct permonst *olduasmon, struct monst *mtmp, struct attack *mattk)
{
int i, tmp;
struct attack *oldu_mattk = 0;
}
struct monst *
-cloneu()
+cloneu(void)
{
struct monst *mon;
int mndx = monsndx(g.youmonst.data);
#include "hack.h"
void
-newemin(mtmp)
-struct monst *mtmp;
+newemin(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
}
void
-free_emin(mtmp)
-struct monst *mtmp;
+free_emin(struct monst *mtmp)
{
if (mtmp->mextra && EMIN(mtmp)) {
free((genericptr_t) EMIN(mtmp));
/* count the number of monsters on the level */
int
-monster_census(spotted)
-boolean spotted; /* seen|sensed vs all */
+monster_census(boolean spotted) /* seen|sensed vs all */
{
struct monst *mtmp;
int count = 0;
/* mon summons a monster */
int
-msummon(mon)
-struct monst *mon;
+msummon(struct monst *mon)
{
struct permonst *ptr;
int dtype = NON_PM, cnt = 0, result = 0, census;
}
void
-summon_minion(alignment, talk)
-aligntyp alignment;
-boolean talk;
+summon_minion(aligntyp alignment, boolean talk)
{
register struct monst *mon;
int mnum;
/* returns 1 if it won't attack. */
int
-demon_talk(mtmp)
-register struct monst *mtmp;
+demon_talk(register struct monst *mtmp)
{
long cash, demand, offer;
}
long
-bribe(mtmp)
-struct monst *mtmp;
+bribe(struct monst *mtmp)
{
char buf[BUFSZ] = DUMMY;
long offer;
}
int
-dprince(atyp)
-aligntyp atyp;
+dprince(aligntyp atyp)
{
int tryct, pm;
}
int
-dlord(atyp)
-aligntyp atyp;
+dlord(aligntyp atyp)
{
int tryct, pm;
/* create lawful (good) lord */
int
-llord()
+llord(void)
{
if (!(g.mvitals[PM_ARCHON].mvflags & G_GONE))
return PM_ARCHON;
}
int
-lminion()
+lminion(void)
{
int tryct;
struct permonst *ptr;
}
int
-ndemon(atyp)
-aligntyp atyp; /* A_NONE is used for 'any alignment' */
+ndemon(aligntyp atyp) /* A_NONE is used for 'any alignment' */
{
struct permonst *ptr;
/* guardian angel has been affected by conflict so is abandoning hero */
void
-lose_guardian_angel(mon)
-struct monst *mon; /* if null, angel hasn't been created yet */
+lose_guardian_angel(struct monst *mon) /* if null, angel hasn't been created yet */
{
coord mm;
int i;
/* just entered the Astral Plane; receive tame guardian angel if worthy */
void
-gain_guardian_angel()
+gain_guardian_angel(void)
{
struct monst *mtmp;
struct obj *otmp;
/* croom->lx etc are schar (width <= int), so % arith ensures that */
/* conversion of result to int is reasonable */
-static boolean FDECL(generate_stairs_room_good, (struct mkroom *, int));
-static struct mkroom *NDECL(generate_stairs_find_room);
-static void NDECL(generate_stairs);
-static void FDECL(mkfount, (int, struct mkroom *));
-static boolean FDECL(find_okay_roompos, (struct mkroom *, coord *));
-static void FDECL(mksink, (struct mkroom *));
-static void FDECL(mkaltar, (struct mkroom *));
-static void FDECL(mkgrave, (struct mkroom *));
-static void NDECL(makevtele);
-void NDECL(clear_level_structures);
-static void FDECL(fill_ordinary_room, (struct mkroom *));
-static void NDECL(makelevel);
-static boolean FDECL(bydoor, (XCHAR_P, XCHAR_P));
-static struct mkroom *FDECL(find_branch_room, (coord *));
-static struct mkroom *FDECL(pos_to_room, (XCHAR_P, XCHAR_P));
-static boolean FDECL(place_niche, (struct mkroom *, int *, int *, int *));
-static void FDECL(makeniche, (int));
-static void NDECL(make_niches);
-static int FDECL(CFDECLSPEC do_comp, (const genericptr,
- const genericptr));
-static void FDECL(dosdoor, (XCHAR_P, XCHAR_P, struct mkroom *, int));
-static void FDECL(join, (int, int, BOOLEAN_P));
-static void FDECL(do_room_or_subroom, (struct mkroom *, int, int,
- int, int, BOOLEAN_P,
- SCHAR_P, BOOLEAN_P, BOOLEAN_P));
-static void NDECL(makerooms);
-static boolean FDECL(door_into_nonjoined, (XCHAR_P, XCHAR_P));
-static void FDECL(finddpos, (coord *, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P));
-static void FDECL(mkinvpos, (XCHAR_P, XCHAR_P, int));
-static void FDECL(mk_knox_portal, (XCHAR_P, XCHAR_P));
+static boolean generate_stairs_room_good(struct mkroom *, int);
+static struct mkroom *generate_stairs_find_room(void);
+static void generate_stairs(void);
+static void mkfount(int, struct mkroom *);
+static boolean find_okay_roompos(struct mkroom *, coord *);
+static void mksink(struct mkroom *);
+static void mkaltar(struct mkroom *);
+static void mkgrave(struct mkroom *);
+static void makevtele(void);
+void clear_level_structures(void);
+static void fill_ordinary_room(struct mkroom *);
+static void makelevel(void);
+static boolean bydoor(xchar, xchar);
+static struct mkroom *find_branch_room(coord *);
+static struct mkroom *pos_to_room(xchar, xchar);
+static boolean place_niche(struct mkroom *, int *, int *, int *);
+static void makeniche(int);
+static void make_niches(void);
+static int CFDECLSPEC do_comp(const genericptr, const genericptr);
+static void dosdoor(xchar, xchar, struct mkroom *, int);
+static void join(int, int, boolean);
+static void do_room_or_subroom(struct mkroom *, int, int, int, int, boolean,
+ schar, boolean, boolean);
+static void makerooms(void);
+static boolean door_into_nonjoined(xchar, xchar);
+static void finddpos(coord *, xchar, xchar, xchar, xchar);
+static void mkinvpos(xchar, xchar, int);
+static void mk_knox_portal(xchar, xchar);
#define create_vault() create_room(-1, -1, 2, 2, -1, -1, VAULT, TRUE)
#define init_vault() g.vault_x = -1
/* Args must be (const genericptr) so that qsort will always be happy. */
static int CFDECLSPEC
-do_comp(vx, vy)
-const genericptr vx;
-const genericptr vy;
+do_comp(const genericptr vx, const genericptr vy)
{
#ifdef LINT
/* lint complains about possible pointer alignment problems, but we know
* connect them up to other areas.
*/
static boolean
-door_into_nonjoined(x, y)
-xchar x, y;
+door_into_nonjoined(xchar x, xchar y)
{
xchar tx, ty, diridx;
}
static void
-finddpos(cc, xl, yl, xh, yh)
-coord *cc;
-xchar xl, yl, xh, yh;
+finddpos(coord *cc, xchar xl, xchar yl, xchar xh, xchar yh)
{
register xchar x, y;
/* Sort rooms on the level so they're ordered from left to right on the map.
makecorridors() by default links rooms N and N+1 */
void
-sort_rooms()
+sort_rooms(void)
{
int i, x, y;
int ri[MAXNROFROOMS+1];
}
static void
-do_room_or_subroom(croom, lowx, lowy, hix, hiy, lit, rtype, special, is_room)
-register struct mkroom *croom;
-int lowx, lowy;
-register int hix, hiy;
-boolean lit;
-schar rtype;
-boolean special;
-boolean is_room;
+do_room_or_subroom(register struct mkroom *croom,
+ int lowx, int lowy, register int hix, register int hiy,
+ boolean lit, schar rtype, boolean special, boolean is_room)
{
register int x, y;
struct rm *lev;
}
void
-add_room(lowx, lowy, hix, hiy, lit, rtype, special)
-int lowx, lowy, hix, hiy;
-boolean lit;
-schar rtype;
-boolean special;
+add_room(int lowx, int lowy, int hix, int hiy,
+ boolean lit, schar rtype, boolean special)
{
register struct mkroom *croom;
}
void
-add_subroom(proom, lowx, lowy, hix, hiy, lit, rtype, special)
-struct mkroom *proom;
-int lowx, lowy, hix, hiy;
-boolean lit;
-schar rtype;
-boolean special;
+add_subroom(struct mkroom *proom, int lowx, int lowy, int hix, int hiy,
+ boolean lit, schar rtype, boolean special)
{
register struct mkroom *croom;
}
void
-free_luathemes(keependgame)
-boolean keependgame; /* False: exiting, True: discarding main dungeon */
+free_luathemes(boolean keependgame) /* False: exiting, True: discarding main dungeon */
{
int i;
}
static void
-makerooms()
+makerooms(void)
{
boolean tried_vault = FALSE;
int themeroom_tries = 0;
}
static void
-join(a, b, nxcor)
-register int a, b;
-boolean nxcor;
+join(register int a, register int b, boolean nxcor)
{
coord cc, tt, org, dest;
register xchar tx, ty, xx, yy;
}
void
-makecorridors()
+makecorridors(void)
{
int a, b, i;
boolean any = TRUE;
}
void
-add_door(x, y, aroom)
-register int x, y;
-register struct mkroom *aroom;
+add_door(register int x, register int y, register struct mkroom *aroom)
{
register struct mkroom *broom;
register int tmp;
}
static void
-dosdoor(x, y, aroom, type)
-register xchar x, y;
-struct mkroom *aroom;
-int type;
+dosdoor(register xchar x, register xchar y, struct mkroom *aroom, int type)
{
boolean shdoor = *in_rooms(x, y, SHOPBASE) ? TRUE : FALSE;
}
static boolean
-place_niche(aroom, dy, xx, yy)
-register struct mkroom *aroom;
-int *dy, *xx, *yy;
+place_niche(register struct mkroom *aroom, int *dy, int *xx, int *yy)
{
coord dd;
};
static void
-makeniche(trap_type)
-int trap_type;
+makeniche(int trap_type)
{
register struct mkroom *aroom;
struct rm *rm;
}
static void
-make_niches()
+make_niches(void)
{
int ct = rnd((g.nroom >> 1) + 1), dep = depth(&u.uz);
boolean ltptr = (!g.level.flags.noteleport && dep > 15),
}
static void
-makevtele()
+makevtele(void)
{
makeniche(TELEP_TRAP);
}
* each type initializes what it needs to separately.
*/
void
-clear_level_structures()
+clear_level_structures(void)
{
static struct rm zerorm = { GLYPH_UNEXPLORED,
0, 0, 0, 0, 0, 0, 0, 0, 0 };
* Doom) with random monsters, objects, and dungeon features.
*/
static void
-fill_ordinary_room(croom)
-struct mkroom *croom;
+fill_ordinary_room(struct mkroom *croom)
{
int trycnt = 0;
coord pos;
}
static void
-makelevel()
+makelevel(void)
{
register struct mkroom *croom;
branch *branchp;
* mineralize(-1, -1, -1, -1, FALSE); => "default" behaviour
*/
void
-mineralize(kelp_pool, kelp_moat, goldprob, gemprob, skip_lvl_checks)
-int kelp_pool, kelp_moat, goldprob, gemprob;
-boolean skip_lvl_checks;
+mineralize(int kelp_pool, int kelp_moat, int goldprob, int gemprob,
+ boolean skip_lvl_checks)
{
s_level *sp;
struct obj *otmp;
}
void
-mklev()
+mklev(void)
{
struct mkroom *croom;
int ridx;
void
#ifdef SPECIALIZATION
-topologize(croom, do_ordinary)
-struct mkroom *croom;
-boolean do_ordinary;
+topologize(struct mkroom *croom, boolean do_ordinary)
#else
-topologize(croom)
-struct mkroom *croom;
+topologize(struct mkroom *croom)
#endif
{
register int x, y, roomno = (int) ((croom - g.rooms) + ROOMOFFSET);
/* Find an unused room for a branch location. */
static struct mkroom *
-find_branch_room(mp)
-coord *mp;
+find_branch_room(coord *mp)
{
struct mkroom *croom = 0;
/* Find the room for (x,y). Return null if not in a room. */
static struct mkroom *
-pos_to_room(x, y)
-xchar x, y;
+pos_to_room(xchar x, xchar y)
{
int i;
struct mkroom *curr;
/* If given a branch, randomly place a special stair or portal. */
void
-place_branch(br, x, y)
-branch *br; /* branch to place */
-xchar x, y; /* location */
+place_branch(branch *br, /* branch to place */
+ xchar x, xchar y) /* location */
{
coord m = {0};
d_level *dest;
}
static boolean
-bydoor(x, y)
-register xchar x, y;
+bydoor(register xchar x, register xchar y)
{
register int typ;
/* see whether it is allowable to create a door at [x,y] */
int
-okdoor(x, y)
-xchar x, y;
+okdoor(xchar x, xchar y)
{
boolean near_door = bydoor(x, y);
}
void
-dodoor(x, y, aroom)
-int x, y;
-struct mkroom *aroom;
+dodoor(int x, int y, struct mkroom *aroom)
{
if (g.doorindex >= DOORMAX) {
impossible("DOORMAX exceeded?");
}
boolean
-occupied(x, y)
-register xchar x, y;
+occupied(register xchar x, register xchar y)
{
return (boolean) (t_at(x, y) || IS_FURNITURE(levl[x][y].typ)
|| is_lava(x, y) || is_pool(x, y)
/* make a trap somewhere (in croom if mazeflag = 0 && !tm) */
/* if tm != null, make trap at that location */
void
-mktrap(num, mazeflag, croom, tm)
-int num, mazeflag;
-struct mkroom *croom;
-coord *tm;
+mktrap(int num, int mazeflag, struct mkroom *croom, coord *tm)
{
register int kind;
struct trap *t;
}
void
-mkstairs(x, y, up, croom)
-xchar x, y;
-char up; /* [why 'char' when usage is boolean?] */
-struct mkroom *croom UNUSED;
+mkstairs(xchar x, xchar y,
+ char up, /* [why 'char' when usage is boolean?] */
+ struct mkroom *croom UNUSED)
{
d_level dest;
-1 == allow an unjoined room
*/
static boolean
-generate_stairs_room_good(croom, phase)
-struct mkroom *croom;
-int phase;
+generate_stairs_room_good(struct mkroom *croom, int phase)
{
return (croom && (croom->needjoining || (phase < 0))
&& ((!has_dnstairs(croom) && !has_upstairs(croom))
/* find a good room to generate an up or down stairs in */
static struct mkroom *
-generate_stairs_find_room()
+generate_stairs_find_room(void)
{
struct mkroom *croom;
int i, phase, tryct = 0;
/* construct stairs up and down within the same branch,
up and down in different rooms if possible */
static void
-generate_stairs()
+generate_stairs(void)
{
struct mkroom *croom = generate_stairs_find_room();
coord pos;
}
static void
-mkfount(mazeflag, croom)
-int mazeflag;
-struct mkroom *croom;
+mkfount(int mazeflag, struct mkroom *croom)
{
coord m;
register int tryct = 0;
}
static boolean
-find_okay_roompos(croom, crd)
-struct mkroom *croom;
-coord *crd;
+find_okay_roompos(struct mkroom *croom, coord *crd)
{
int tryct = 0;
}
static void
-mksink(croom)
-struct mkroom *croom;
+mksink(struct mkroom *croom)
{
coord m;
}
static void
-mkaltar(croom)
-struct mkroom *croom;
+mkaltar(struct mkroom *croom)
{
coord m;
aligntyp al;
}
static void
-mkgrave(croom)
-struct mkroom *croom;
+mkgrave(struct mkroom *croom)
{
coord m;
register int tryct = 0;
* attempted while blind (in order to make blind-from-birth conduct viable).]
*/
void
-mkinvokearea()
+mkinvokearea(void)
{
int dist;
xchar xmin = g.inv_pos.x, xmax = g.inv_pos.x,
* Temporarily overrides vision in the name of a nice effect.
*/
static void
-mkinvpos(x, y, dist)
-xchar x, y;
-int dist;
+mkinvpos(xchar x, xchar y, int dist)
{
struct trap *ttmp;
struct obj *otmp;
* Ludios will remain isolated until the branch is corrected by this function.
*/
static void
-mk_knox_portal(x, y)
-xchar x, y;
+mk_knox_portal(xchar x, xchar y)
{
d_level *source;
branch *br;
#define HEIGHT (ROWNO - 1)
#define WIDTH (COLNO - 2)
-static void FDECL(init_map, (SCHAR_P));
-static void FDECL(init_fill, (SCHAR_P, SCHAR_P));
-static schar FDECL(get_map, (int, int, SCHAR_P));
-static void FDECL(pass_one, (SCHAR_P, SCHAR_P));
-static void FDECL(pass_two, (SCHAR_P, SCHAR_P));
-static void FDECL(pass_three, (SCHAR_P, SCHAR_P));
-static void FDECL(join_map, (SCHAR_P, SCHAR_P));
-static void FDECL(finish_map,
- (SCHAR_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-static void FDECL(remove_room, (unsigned));
-void FDECL(mkmap, (lev_init *));
+static void init_map(schar);
+static void init_fill(schar, schar);
+static schar get_map(int, int, schar);
+static void pass_one(schar, schar);
+static void pass_two(schar, schar);
+static void pass_three(schar, schar);
+static void join_map(schar, schar);
+static void finish_map(schar, schar, boolean, boolean, boolean);
+static void remove_room(unsigned);
+void mkmap(lev_init *);
static void
-init_map(bg_typ)
-schar bg_typ;
+init_map(schar bg_typ)
{
register int i, j;
}
static void
-init_fill(bg_typ, fg_typ)
-schar bg_typ, fg_typ;
+init_fill(schar bg_typ, schar fg_typ)
{
register int i, j;
long limit, count;
}
static schar
-get_map(col, row, bg_typ)
-int col, row;
-schar bg_typ;
+get_map(int col, int row, schar bg_typ)
{
if (col <= 0 || row < 0 || col > WIDTH || row >= HEIGHT)
return bg_typ;
0, 1 /**/, 1, -1 /**/, 1, 0 /**/, 1, 1 };
static void
-pass_one(bg_typ, fg_typ)
-schar bg_typ, fg_typ;
+pass_one(schar bg_typ, schar fg_typ)
{
register int i, j;
short count, dr;
#define new_loc(i, j) *(g.new_locations + ((j) * (WIDTH + 1)) + (i))
static void
-pass_two(bg_typ, fg_typ)
-schar bg_typ, fg_typ;
+pass_two(schar bg_typ, schar fg_typ)
{
register int i, j;
short count, dr;
}
static void
-pass_three(bg_typ, fg_typ)
-schar bg_typ, fg_typ;
+pass_three(schar bg_typ, schar fg_typ)
{
register int i, j;
short count, dr;
* exactly matching levl[sx][sy].typ and walls are included as well.
*/
void
-flood_fill_rm(sx, sy, rmno, lit, anyroom)
-int sx;
-register int sy;
-register int rmno;
-boolean lit;
-boolean anyroom;
+flood_fill_rm(
+ int sx,
+ register int sy,
+ register int rmno,
+ boolean lit,
+ boolean anyroom)
{
register int i;
int nx;
}
static void
-join_map(bg_typ, fg_typ)
-schar bg_typ, fg_typ;
+join_map(schar bg_typ, schar fg_typ)
{
register struct mkroom *croom, *croom2;
}
static void
-finish_map(fg_typ, bg_typ, lit, walled, icedpools)
-schar fg_typ, bg_typ;
-boolean lit, walled, icedpools;
+finish_map(
+ schar fg_typ,
+ schar bg_typ,
+ boolean lit,
+ boolean walled,
+ boolean icedpools)
{
int i, j;
* region are all set.
*/
void
-remove_rooms(lx, ly, hx, hy)
-int lx, ly, hx, hy;
+remove_rooms(int lx, int ly, int hx, int hy)
{
int i;
struct mkroom *croom;
* Currently handles only the removal of rooms that have no subrooms.
*/
static void
-remove_room(roomno)
-unsigned roomno;
+remove_room(unsigned int roomno)
{
struct mkroom *croom = &g.rooms[roomno];
struct mkroom *maxroom = &g.rooms[--g.nroom];
#define N_P3_ITER 2 /* tune map smoothing via this value */
boolean
-litstate_rnd(litstate)
-int litstate;
+litstate_rnd(int litstate)
{
if (litstate < 0)
return (rnd(1 + abs(depth(&u.uz))) < 11 && rn2(77)) ? TRUE : FALSE;
}
void
-mkmap(init_lev)
-lev_init *init_lev;
+mkmap(lev_init* init_lev)
{
schar bg_typ = init_lev->bg, fg_typ = init_lev->fg;
boolean smooth = init_lev->smoothed, join = init_lev->joined;
#include "hack.h"
#include "sp_lev.h"
-static int FDECL(iswall, (int, int));
-static int FDECL(iswall_or_stone, (int, int));
-static boolean FDECL(is_solid, (int, int));
-static int FDECL(extend_spine, (int[3][3], int, int, int));
-static void FDECL(wall_cleanup, (int, int, int, int));
-static boolean FDECL(okay, (int, int, int));
-static void FDECL(maze0xy, (coord *));
-static boolean FDECL(put_lregion_here, (XCHAR_P, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P, XCHAR_P,
- XCHAR_P, BOOLEAN_P, d_level *));
-static void NDECL(baalz_fixup);
-static void NDECL(setup_waterlevel);
-static void NDECL(unsetup_waterlevel);
-static void FDECL(check_ransacked, (char *));
-static void FDECL(migr_booty_item, (int, const char *));
-static void FDECL(migrate_orc, (struct monst *, unsigned long));
-static void FDECL(shiny_orc_stuff, (struct monst *));
-static void NDECL(stolen_booty);
-static boolean FDECL(maze_inbounds, (int, int));
-static void FDECL(maze_remove_deadends, (XCHAR_P));
+static int iswall(int, int);
+static int iswall_or_stone(int, int);
+static boolean is_solid(int, int);
+static int extend_spine(int[3][3], int, int, int);
+static void wall_cleanup(int, int, int, int);
+static boolean okay(int, int, int);
+static void maze0xy(coord *);
+static boolean put_lregion_here(xchar, xchar, xchar, xchar, xchar,
+ xchar, xchar, boolean, d_level *);
+static void baalz_fixup(void);
+static void setup_waterlevel(void);
+static void unsetup_waterlevel(void);
+static void check_ransacked(char *);
+static void migr_booty_item(int, const char *);
+static void migrate_orc(struct monst *, unsigned long);
+static void shiny_orc_stuff(struct monst *);
+static void stolen_booty(void);
+static boolean maze_inbounds(int, int);
+static void maze_remove_deadends(xchar);
/* adjust a coordinate one step in the specified direction */
#define mz_move(X, Y, dir) \
} while (0)
static int
-iswall(x, y)
-int x, y;
+iswall(int x, int y)
{
int type;
}
static int
-iswall_or_stone(x, y)
-int x, y;
+iswall_or_stone(int x, int y)
{
/* out of bounds = stone */
if (!isok(x, y))
/* return TRUE if out of bounds, wall or rock */
static boolean
-is_solid(x, y)
-int x, y;
+is_solid(int x, int y)
{
return (boolean) (!isok(x, y) || IS_STWALL(levl[x][y].typ));
}
* . W W
*/
static int
-extend_spine(locale, wall_there, dx, dy)
-int locale[3][3];
-int wall_there, dx, dy;
+extend_spine(int locale[3][3], int wall_there, int dx, int dy)
{
int spine, nx, ny;
/* Remove walls totally surrounded by stone */
static void
-wall_cleanup(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+wall_cleanup(int x1, int y1, int x2, int y2)
{
uchar type;
int x, y;
/* Correct wall types so they extend and connect to each other */
void
-fix_wall_spines(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+fix_wall_spines(int x1, int y1, int x2, int y2)
{
uchar type;
int x, y;
struct rm *lev;
- int FDECL((*loc_f), (int, int));
+ int (*loc_f)(int, int);
int bits;
int locale[3][3]; /* rock or wall status surrounding positions */
}
void
-wallification(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+wallification(int x1, int y1, int x2, int y2)
{
wall_cleanup(x1, y1, x2, y2);
fix_wall_spines(x1, y1, x2, y2);
}
static boolean
-okay(x, y, dir)
-int x, y;
-int dir;
+okay(int x, int y, int dir)
{
mz_move(x, y, dir);
mz_move(x, y, dir);
/* find random starting point for maze generation */
static void
-maze0xy(cc)
-coord *cc;
+maze0xy(coord * cc)
{
cc->x = 3 + 2 * rn2((g.x_maze_max >> 1) - 1);
cc->y = 3 + 2 * rn2((g.y_maze_max >> 1) - 1);
* NOT (pos is corridor and a maze level OR pos is a room OR pos is air)
*/
boolean
-bad_location(x, y, lx, ly, hx, hy)
-xchar x, y;
-xchar lx, ly, hx, hy;
+bad_location(xchar x, xchar y, xchar lx, xchar ly, xchar hx, xchar hy)
{
return (boolean) (occupied(x, y)
|| within_bounded_area(x, y, lx, ly, hx, hy)
/* pick a location in area (lx, ly, hx, hy) but not in (nlx, nly, nhx, nhy)
and place something (based on rtype) in that region */
void
-place_lregion(lx, ly, hx, hy, nlx, nly, nhx, nhy, rtype, lev)
-xchar lx, ly, hx, hy;
-xchar nlx, nly, nhx, nhy;
-xchar rtype;
-d_level *lev;
+place_lregion(
+ xchar lx, xchar ly, xchar hx, xchar hy,
+ xchar nlx, xchar nly, xchar nhx,xchar nhy,
+ xchar rtype,
+ d_level *lev)
{
int trycnt;
boolean oneshot;
}
static boolean
-put_lregion_here(x, y, nlx, nly, nhx, nhy, rtype, oneshot, lev)
-xchar x, y;
-xchar nlx, nly, nhx, nhy;
-xchar rtype;
-boolean oneshot;
-d_level *lev;
+put_lregion_here(
+ xchar x, xchar y,
+ xchar nlx, xchar nly, xchar nhx, xchar nhy,
+ xchar rtype,
+ boolean oneshot,
+ d_level *lev)
{
struct monst *mtmp;
its legs are walls within solid rock--regular wallification
classifies them as superfluous and gets rid of them */
static void
-baalz_fixup()
+baalz_fixup(void)
{
struct monst *mtmp;
int x, y, lastx, lasty;
/* this is special stuff that the level compiler cannot (yet) handle */
void
-fixup_special()
+fixup_special(void)
{
lev_region *r = g.lregions;
struct d_level lev;
}
static void
-check_ransacked(s)
-char *s;
+check_ransacked(char * s)
{
/* this kludge only works as long as orctown is minetn-1 */
g.ransacked = (u.uz.dnum == mines_dnum && !strcmp(s, "minetn-1"));
static const char *orcfruit[] = { "paddle cactus", "dwarven root" };
static void
-migrate_orc(mtmp, mflags)
-struct monst *mtmp;
-unsigned long mflags;
+migrate_orc(struct monst* mtmp, unsigned long mflags)
{
int nlev, max_depth, cur_depth;
d_level dest;
}
static void
-shiny_orc_stuff(mtmp)
-struct monst *mtmp;
+shiny_orc_stuff(struct monst* mtmp)
{
int gemprob, goldprob, otyp;
struct obj *otmp;
}
}
static void
-migr_booty_item(otyp, gang)
-int otyp;
-const char *gang;
+migr_booty_item(int otyp, const char* gang)
{
struct obj *otmp;
#undef ORC_LEADER
static boolean
-maze_inbounds(x, y)
-int x, y;
+maze_inbounds(int x, int y)
{
return (x >= 2 && y >= 2
&& x < g.x_maze_max && y < g.y_maze_max && isok(x, y));
}
static void
-maze_remove_deadends(typ)
-xchar typ;
+maze_remove_deadends(xchar typ)
{
char dirok[4];
int x, y, dir, idx, idx2, dx, dy, dx2, dy2;
* TODO: rewrite walkfrom so it works on temp space, not levl
*/
void
-create_maze(corrwid, wallthick, rmdeadends)
-int corrwid, wallthick;
-boolean rmdeadends;
+create_maze(int corrwid, int wallthick, boolean rmdeadends)
{
int x,y;
coord mm;
void
-makemaz(s)
-const char *s;
+makemaz(const char *s)
{
int x, y;
char protofile[20];
* that is totally safe.
*/
void
-walkfrom(x, y, typ)
-int x, y;
-schar typ;
+walkfrom(int x, int y, schar typ)
{
#define CELLS (ROWNO * COLNO) / 4 /* a maze cell is 4 squares */
char mazex[CELLS + 1], mazey[CELLS + 1]; /* char's are OK */
#else /* !MICRO */
void
-walkfrom(x, y, typ)
-int x, y;
-schar typ;
+walkfrom(int x, int y, schar typ)
{
int q, a, dir;
int dirs[4];
/* find random point in generated corridors,
so we don't create items in moats, bunkers, or walls */
void
-mazexy(cc)
-coord *cc;
+mazexy(coord *cc)
{
int cpt = 0;
}
void
-get_level_extends(left, top, right, bottom)
-int *left, *top, *right, *bottom;
+get_level_extends(int * left, int * top, int * right, int * bottom)
{
int x, y;
unsigned typ;
* that provides a window of abuse for wallified special levels
*/
void
-bound_digging()
+bound_digging(void)
{
int x, y;
int xmin, xmax, ymin, ymax;
}
void
-mkportal(x, y, todnum, todlevel)
-xchar x, y, todnum, todlevel;
+mkportal(xchar x, xchar y, xchar todnum, xchar todlevel)
{
/* a portal "trap" must be matched by a
portal in the destination dungeon/dlevel */
}
void
-fumaroles()
+fumaroles(void)
{
xchar n;
boolean snd = FALSE, loud = FALSE;
#define gbxmax (g.xmax - 1)
#define gbymax (g.ymax - 1)
-static void NDECL(set_wportal);
-static void FDECL(mk_bubble, (int, int, int));
-static void FDECL(mv_bubble, (struct bubble *, int, int, BOOLEAN_P));
+static void set_wportal(void);
+static void mk_bubble(int, int, int);
+static void mv_bubble(struct bubble *, int, int, boolean);
void
-movebubbles()
+movebubbles(void)
{
static const struct rm water_pos = { cmap_to_glyph(S_water), WATER, 0, 0,
0, 0, 0, 0, 0, 0 };
/* when moving in water, possibly (1 in 3) alter the intended destination */
void
-water_friction()
+water_friction(void)
{
int x, y, dx, dy;
boolean eff = FALSE;
}
void
-save_waterlevel(nhfp)
-NHFILE *nhfp;
+save_waterlevel(NHFILE* nhfp)
{
struct bubble *b;
}
void
-restore_waterlevel(nhfp)
-NHFILE *nhfp;
+restore_waterlevel(NHFILE* nhfp)
{
struct bubble *b = (struct bubble *) 0, *btmp;
int i, n = 0;
}
const char *
-waterbody_name(x, y)
-xchar x, y;
+waterbody_name(xchar x, xchar y)
{
struct rm *lev;
schar ltyp;
}
static void
-set_wportal()
+set_wportal(void)
{
/* there better be only one magic portal on water level... */
for (g.wportal = g.ftrap; g.wportal; g.wportal = g.wportal->ntrap)
}
static void
-setup_waterlevel()
+setup_waterlevel(void)
{
int x, y, xskip, yskip, typ, glyph;
}
static void
-unsetup_waterlevel()
+unsetup_waterlevel(void)
{
struct bubble *b, *bb;
}
static void
-mk_bubble(x, y, n)
-int x, y, n;
+mk_bubble(int x, int y, int n)
{
/*
* These bit masks make visually pleasing bubbles on a normal aspect
* This property also makes leaving a bubble slightly difficult.
*/
static void
-mv_bubble(b, dx, dy, ini)
-struct bubble *b;
-int dx, dy;
-boolean ini;
+mv_bubble(struct bubble* b, int dx, int dy, boolean ini)
{
int x, y, i, j, colli = 0;
struct container *cons, *ctemp;
#include "hack.h"
-static void FDECL(mkbox_cnts, (struct obj *));
-static unsigned FDECL(nextoid, (struct obj *, struct obj *));
-static void FDECL(maybe_adjust_light, (struct obj *, int));
-static void FDECL(obj_timer_checks, (struct obj *,
- XCHAR_P, XCHAR_P, int));
-static void FDECL(container_weight, (struct obj *));
-static struct obj *FDECL(save_mtraits, (struct obj *, struct monst *));
-static void FDECL(objlist_sanity, (struct obj *, int, const char *));
-static void FDECL(mon_obj_sanity, (struct monst *, const char *));
-static const char *FDECL(where_name, (struct obj *));
-static void FDECL(insane_object, (struct obj *, const char *,
- const char *, struct monst *));
-static void FDECL(check_contained, (struct obj *, const char *));
-static void FDECL(check_glob, (struct obj *, const char *));
-static void FDECL(sanity_check_worn, (struct obj *));
+static void mkbox_cnts(struct obj *);
+static unsigned nextoid(struct obj *, struct obj *);
+static void maybe_adjust_light(struct obj *, int);
+static void obj_timer_checks(struct obj *, xchar, xchar, int);
+static void container_weight(struct obj *);
+static struct obj *save_mtraits(struct obj *, struct monst *);
+static void objlist_sanity(struct obj *, int, const char *);
+static void mon_obj_sanity(struct monst *, const char *);
+static const char *where_name(struct obj *);
+static void insane_object(struct obj *, const char *, const char *,
+ struct monst *);
+static void check_contained(struct obj *, const char *);
+static void check_glob(struct obj *, const char *);
+static void sanity_check_worn(struct obj *);
struct icp {
int iprob; /* probability of an item type */
static const struct oextra zerooextra = DUMMY;
static void
-init_oextra(oex)
-struct oextra *oex;
+init_oextra(struct oextra* oex)
{
*oex = zerooextra;
}
struct oextra *
-newoextra()
+newoextra(void)
{
struct oextra *oextra;
}
void
-dealloc_oextra(o)
-struct obj *o;
+dealloc_oextra(struct obj* o)
{
struct oextra *x = o->oextra;
}
void
-newomonst(otmp)
-struct obj *otmp;
+newomonst(struct obj* otmp)
{
if (!otmp->oextra)
otmp->oextra = newoextra();
}
void
-free_omonst(otmp)
-struct obj *otmp;
+free_omonst(struct obj* otmp)
{
if (otmp->oextra) {
struct monst *m = OMONST(otmp);
}
void
-newomid(otmp)
-struct obj *otmp;
+newomid(struct obj* otmp)
{
if (!otmp->oextra)
otmp->oextra = newoextra();
}
void
-free_omid(otmp)
-struct obj *otmp;
+free_omid(struct obj* otmp)
{
OMID(otmp) = 0;
}
void
-new_omailcmd(otmp, response_cmd)
-struct obj *otmp;
-const char *response_cmd;
+new_omailcmd(struct obj* otmp, const char * response_cmd)
{
if (!otmp->oextra)
otmp->oextra = newoextra();
}
void
-free_omailcmd(otmp)
-struct obj *otmp;
+free_omailcmd(struct obj* otmp)
{
if (otmp->oextra && OMAILCMD(otmp)) {
free((genericptr_t) OMAILCMD(otmp));
}
struct obj *
-mkobj_at(let, x, y, artif)
-char let;
-int x, y;
-boolean artif;
+mkobj_at(char let, int x, int y, boolean artif)
{
struct obj *otmp;
}
struct obj *
-mksobj_at(otyp, x, y, init, artif)
-int otyp, x, y;
-boolean init, artif;
+mksobj_at(int otyp, int x, int y, boolean init, boolean artif)
{
struct obj *otmp;
}
struct obj *
-mksobj_migr_to_species(otyp, mflags2, init, artif)
-int otyp;
-unsigned mflags2;
-boolean init, artif;
+mksobj_migr_to_species(
+ int otyp,
+ unsigned int mflags2,
+ boolean init,
+ boolean artif)
{
struct obj *otmp;
/* mkobj(): select a type of item from a class, use mksobj() to create it;
result is always non-Null */
struct obj *
-mkobj(oclass, artif)
-int oclass;
-boolean artif;
+mkobj(int oclass, boolean artif)
{
int tprob, i, prob = rnd(1000);
}
static void
-mkbox_cnts(box)
-struct obj *box;
+mkbox_cnts(struct obj* box)
{
register int n;
register struct obj *otmp;
/* select a random, common monster type */
int
-rndmonnum()
+rndmonnum(void)
{
register struct permonst *ptr;
register int i;
}
void
-copy_oextra(obj2, obj1)
-struct obj *obj2, *obj1;
+copy_oextra(struct obj* obj2, struct obj* obj1)
{
if (!obj2 || !obj1 || !obj1->oextra)
return;
* in the nobj chain (and nexthere chain when on the floor).
*/
struct obj *
-splitobj(obj, num)
-struct obj *obj;
-long num;
+splitobj(struct obj* obj, long num)
{
struct obj *otmp;
/* when splitting a stack that has o_id-based shop prices, pick an
o_id value for the new stack that will maintain the same price */
static unsigned
-nextoid(oldobj, newobj)
-struct obj *oldobj, *newobj;
+nextoid(struct obj* oldobj, struct obj* newobj)
{
int olddif, newdif, trylimit = 256; /* limit of 4 suffices at present */
unsigned oid = g.context.ident - 1; /* loop increment will reverse -1 */
/* try to find the stack obj was split from, then merge them back together;
returns the combined object if unsplit is successful, null otherwise */
struct obj *
-unsplitobj(obj)
-struct obj *obj;
+unsplitobj(struct obj* obj)
{
unsigned target_oid = 0;
struct obj *oparent = 0, *ochild = 0, *list = 0;
/* reset splitobj()/unsplitobj() context */
void
-clear_splitobjs()
+clear_splitobjs(void)
{
g.context.objsplit.parent_oid = g.context.objsplit.child_oid = 0;
}
* not actually moving something.
*/
void
-replace_object(obj, otmp)
-struct obj *obj;
-struct obj *otmp;
+replace_object(struct obj* obj, struct obj* otmp)
{
otmp->where = obj->where;
switch (obj->where) {
/* is 'obj' inside a container whose contents aren't known?
if so, return the outermost container meeting that criterium */
struct obj *
-unknwn_contnr_contents(obj)
-struct obj *obj;
+unknwn_contnr_contents(struct obj* obj)
{
struct obj *result = 0, *parent;
* usage of an object.
*/
void
-bill_dummy_object(otmp)
-register struct obj *otmp;
+bill_dummy_object(struct obj* otmp)
{
register struct obj *dummy;
long cost = 0L;
/* possibly bill for an object which the player has just modified */
void
-costly_alteration(obj, alter_type)
-struct obj *obj;
-int alter_type;
+costly_alteration(struct obj* obj, int alter_type)
{
xchar ox, oy;
char objroom;
/* mksobj(): create a specific type of object; result it always non-Null */
struct obj *
-mksobj(otyp, init, artif)
-int otyp;
-boolean init;
-boolean artif;
+mksobj(int otyp, boolean init, boolean artif)
{
int mndx, tryct;
struct obj *otmp;
*
*/
void
-set_corpsenm(obj, id)
-struct obj *obj;
-int id;
+set_corpsenm(struct obj* obj, int id)
{
long when = 0L;
/* Return the number of turns after which a Rider corpse revives */
long
-rider_revival_time(body, retry)
-struct obj *body;
-boolean retry;
+rider_revival_time(struct obj* body, boolean retry)
{
long when;
long minturn = retry ? 3L : (body->corpsenm == PM_DEATH) ? 6L : 12L;
* This takes the age of the corpse into consideration as of 3.4.0.
*/
void
-start_corpse_timeout(body)
-struct obj *body;
+start_corpse_timeout(struct obj* body)
{
long when; /* rot away when this old */
long corpse_age; /* age of corpse */
}
static void
-maybe_adjust_light(obj, old_range)
-struct obj *obj;
-int old_range;
+maybe_adjust_light(struct obj* obj, int old_range)
{
char buf[BUFSZ];
xchar ox, oy;
*/
void
-bless(otmp)
-register struct obj *otmp;
+bless(struct obj* otmp)
{
int old_light = 0;
}
void
-unbless(otmp)
-register struct obj *otmp;
+unbless(struct obj* otmp)
{
int old_light = 0;
}
void
-curse(otmp)
-register struct obj *otmp;
+curse(struct obj* otmp)
{
unsigned already_cursed;
int old_light = 0;
}
void
-uncurse(otmp)
-register struct obj *otmp;
+uncurse(struct obj* otmp)
{
int old_light = 0;
}
void
-blessorcurse(otmp, chance)
-register struct obj *otmp;
-register int chance;
+blessorcurse(struct obj* otmp, int chance)
{
if (otmp->blessed || otmp->cursed)
return;
}
int
-bcsign(otmp)
-register struct obj *otmp;
+bcsign(struct obj* otmp)
{
return (!!otmp->blessed - !!otmp->cursed);
}
/* set the object's bless/curse-state known flag */
void
-set_bknown(obj, onoff)
-struct obj *obj;
-unsigned onoff; /* 1 or 0 */
+set_bknown(struct obj* obj, unsigned int onoff /* 1 or 0 */)
{
if (obj->bknown != onoff) {
obj->bknown = onoff;
* container's weight.
*/
int
-weight(obj)
-register struct obj *obj;
+weight(struct obj* obj)
{
int wt = (int) objects[obj->otyp].oc_weight;
/* called when a tree is kicked; never returns Null */
struct obj *
-rnd_treefruit_at(x, y)
-int x, y;
+rnd_treefruit_at(int x, int y)
{
return mksobj_at(treefruits[rn2(SIZE(treefruits))], x, y, TRUE, FALSE);
}
/* create a stack of N gold pieces; never returns Null */
struct obj *
-mkgold(amount, x, y)
-long amount;
-int x, y;
+mkgold(long amount, int x, int y)
{
struct obj *gold = g_at(x, y);
* resurrection.
*/
struct obj *
-mkcorpstat(objtype, mtmp, ptr, x, y, corpstatflags)
-int objtype; /* CORPSE or STATUE */
-struct monst *mtmp;
-struct permonst *ptr;
-int x, y;
-unsigned corpstatflags;
+mkcorpstat(
+ int objtype, /* CORPSE or STATUE */
+ struct monst *mtmp,
+ struct permonst *ptr,
+ int x, int y,
+ unsigned corpstatflags)
{
struct obj *otmp;
boolean init = ((corpstatflags & CORPSTAT_INIT) != 0);
* The return value is an index into mons[].
*/
int
-corpse_revive_type(obj)
-struct obj *obj;
+corpse_revive_type(struct obj* obj)
{
int revivetype = obj->corpsenm;
struct monst *mtmp;
* a lasting association between the two.
*/
struct obj *
-obj_attach_mid(obj, mid)
-struct obj *obj;
-unsigned mid;
+obj_attach_mid(struct obj* obj, unsigned int mid)
{
if (!mid || !obj)
return (struct obj *) 0;
}
static struct obj *
-save_mtraits(obj, mtmp)
-struct obj *obj;
-struct monst *mtmp;
+save_mtraits(struct obj* obj, struct monst* mtmp)
{
if (mtmp->ispriest)
forget_temple_entry(mtmp); /* EPRI() */
* the one contained within the obj.
*/
struct monst *
-get_mtraits(obj, copyof)
-struct obj *obj;
-boolean copyof;
+get_mtraits(struct obj* obj, boolean copyof)
{
struct monst *mtmp = (struct monst *) 0;
struct monst *mnew = (struct monst *) 0;
/* make an object named after someone listed in the scoreboard file;
never returns Null */
struct obj *
-mk_tt_object(objtype, x, y)
-int objtype; /* CORPSE or STATUE */
-int x, y;
+mk_tt_object(
+ int objtype, /* CORPSE or STATUE */
+ int x, int y)
{
struct obj *otmp;
boolean initialize_it;
/* make a new corpse or statue, uninitialized if a statue (i.e. no books);
never returns Null */
struct obj *
-mk_named_object(objtype, ptr, x, y, nm)
-int objtype; /* CORPSE or STATUE */
-struct permonst *ptr;
-int x, y;
-const char *nm;
+mk_named_object(
+int objtype, /* CORPSE or STATUE */
+struct permonst *ptr,
+int x, int y,
+const char *nm)
{
struct obj *otmp;
unsigned corpstatflags = (objtype != STATUE) ? CORPSTAT_INIT
}
boolean
-is_flammable(otmp)
-register struct obj *otmp;
+is_flammable(struct obj* otmp)
{
int otyp = otmp->otyp;
int omat = objects[otyp].oc_material;
}
boolean
-is_rottable(otmp)
-register struct obj *otmp;
+is_rottable(struct obj* otmp)
{
int otyp = otmp->otyp;
/* put the object at the given location */
void
-place_object(otmp, x, y)
-register struct obj *otmp;
-int x, y;
+place_object(struct obj* otmp, int x, int y)
{
register struct obj *otmp2 = g.level.objects[x][y];
if (!isok(x, y)) { /* validate location */
- void VDECL((*func), (const char *, ...)) PRINTF_F(1, 2);
+ void (*func)(const char *, ...);
func = (x < 0 || y < 0 || x > COLNO - 1 || y > ROWNO - 1) ? panic
: impossible;
* Also used for starting ice effects too. [zap.c]
*/
void
-obj_ice_effects(x, y, do_buried)
-int x, y;
-boolean do_buried;
+obj_ice_effects(int x, int y, boolean do_buried)
{
struct obj *otmp;
* restarted etc.
*/
long
-peek_at_iced_corpse_age(otmp)
-struct obj *otmp;
+peek_at_iced_corpse_age(struct obj* otmp)
{
long age, retval = otmp->age;
}
static void
-obj_timer_checks(otmp, x, y, force)
-struct obj *otmp;
-xchar x, y;
-int force; /* 0 = no force so do checks, <0 = force off, >0 force on */
+obj_timer_checks(
+ struct obj* otmp,
+ xchar x, xchar y,
+ int force) /* 0 = no force so do checks, <0 = force off, >0 force on */
{
long tleft = 0L;
short action = ROT_CORPSE;
#undef ROT_ICE_ADJUSTMENT
void
-remove_object(otmp)
-register struct obj *otmp;
+remove_object(struct obj* otmp)
{
xchar x = otmp->ox;
xchar y = otmp->oy;
/* throw away all of a monster's inventory */
void
-discard_minvent(mtmp, uncreate_artifacts)
-struct monst *mtmp;
-boolean uncreate_artifacts;
+discard_minvent(struct monst* mtmp, boolean uncreate_artifacts)
{
struct obj *otmp, *mwep = MON_WEP(mtmp);
boolean keeping_mon = !DEADMONSTER(mtmp);
* OBJ_LUAFREE obj is dealloc'd from core, but still used by lua
*/
void
-obj_extract_self(obj)
-struct obj *obj;
+obj_extract_self(struct obj* obj)
{
switch (obj->where) {
case OBJ_FREE:
/* Extract the given object from the chain, following nobj chain. */
void
-extract_nobj(obj, head_ptr)
-struct obj *obj, **head_ptr;
+extract_nobj(struct obj* obj, struct obj** head_ptr)
{
struct obj *curr, *prev;
* in tandem with extract_nobj, which does set it.
*/
void
-extract_nexthere(obj, head_ptr)
-struct obj *obj, **head_ptr;
+extract_nexthere(struct obj* obj, struct obj** head_ptr)
{
struct obj *curr, *prev;
* Otherwise 0 is returned.
*/
int
-add_to_minv(mon, obj)
-struct monst *mon;
-struct obj *obj;
+add_to_minv(struct monst *mon, struct obj* obj)
{
struct obj *otmp;
* The input obj may be deleted in the process.
*/
struct obj *
-add_to_container(container, obj)
-struct obj *container, *obj;
+add_to_container(struct obj* container, struct obj* obj)
{
struct obj *otmp;
}
void
-add_to_migration(obj)
-struct obj *obj;
+add_to_migration(struct obj* obj)
{
if (obj->where != OBJ_FREE)
panic("add_to_migration: obj not free");
}
void
-add_to_buried(obj)
-struct obj *obj;
+add_to_buried(struct obj* obj)
{
if (obj->where != OBJ_FREE)
panic("add_to_buried: obj not free");
/* Recalculate the weight of this container and all of _its_ containers. */
static void
-container_weight(container)
-struct obj *container;
+container_weight(struct obj* container)
{
container->owt = weight(container);
if (container->where == OBJ_CONTAINED)
* them to be deallocated.
*/
void
-dealloc_obj(obj)
-struct obj *obj;
+dealloc_obj(struct obj* obj)
{
if (obj->where != OBJ_FREE && obj->where != OBJ_LUAFREE)
panic("dealloc_obj: obj not free");
/* create an object from a horn of plenty; mirrors bagotricks(makemon.c) */
int
-hornoplenty(horn, tipping)
-struct obj *horn;
-boolean tipping; /* caller emptying entire contents; affects shop handling */
+hornoplenty(
+ struct obj* horn,
+ boolean tipping) /* caller emptying entire contents; affects shop handling */
{
int objcount = 0;
/* Check all object lists for consistency. */
void
-obj_sanity_check()
+obj_sanity_check(void)
{
int x, y;
struct obj *obj;
/* sanity check for objects on specified list (fobj, &c) */
static void
-objlist_sanity(objlist, wheretype, mesg)
-struct obj *objlist;
-int wheretype;
-const char *mesg;
+objlist_sanity(struct obj* objlist, int wheretype, const char * mesg)
{
struct obj *obj;
/* sanity check for objects carried by all monsters in specified list */
static void
-mon_obj_sanity(monlist, mesg)
-struct monst *monlist;
-const char *mesg;
+mon_obj_sanity(struct monst* monlist, const char* mesg)
{
struct monst *mon;
struct obj *obj, *mwep;
"luafree" };
static const char *
-where_name(obj)
-struct obj *obj;
+where_name(struct obj* obj)
{
static char unknown[32]; /* big enough to handle rogue 64-bit int */
int where;
}
static void
-insane_object(obj, fmt, mesg, mon)
-struct obj *obj;
-const char *fmt, *mesg;
-struct monst *mon;
+insane_object(
+ struct obj* obj,
+ const char* fmt,
+ const char* mesg,
+ struct monst* mon)
{
const char *objnm, *monnm;
char altfmt[BUFSZ];
* take an obj pointer to work.
*/
struct obj *
-init_dummyobj(obj, otyp, oquan)
-struct obj *obj;
-short otyp;
-long oquan;
+init_dummyobj(struct obj* obj, short otyp, long oquan)
{
if (obj) {
*obj = cg.zeroobj;
/* obj sanity check: check objects inside container */
static void
-check_contained(container, mesg)
-struct obj *container;
-const char *mesg;
+check_contained(struct obj* container, const char *mesg)
{
struct obj *obj;
/* big enough to work with, not too big to blow out stack in recursion */
/* called when 'obj->globby' is set so we don't recheck it here */
static void
-check_glob(obj, mesg)
-struct obj *obj;
-const char *mesg;
+check_glob(struct obj* obj, const char *mesg)
{
#define LOWEST_GLOB GLOB_OF_GRAY_OOZE
#define HIGHEST_GLOB GLOB_OF_BLACK_PUDDING
/* check an object in hero's or monster's inventory which has worn mask set */
static void
-sanity_check_worn(obj)
-struct obj *obj;
+sanity_check_worn(struct obj* obj)
{
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) || defined(DEBUG)
static unsigned long wearbits[] = {
* wrapper to make "near this object" convenient
*/
struct obj *
-obj_nexto(otmp)
-struct obj *otmp;
+obj_nexto(struct obj* otmp)
{
if (!otmp) {
impossible("obj_nexto: wasn't given an object to check");
* reliably predict which one we want to 'find' first
*/
struct obj *
-obj_nexto_xy(obj, x, y, recurs)
-struct obj *obj;
-int x, y;
-boolean recurs;
+obj_nexto_xy(struct obj* obj, int x, int y, boolean recurs)
{
struct obj *otmp;
int fx, fy, ex, ey, otyp = obj->otyp;
* is returned.
*/
struct obj *
-obj_absorb(obj1, obj2)
-struct obj **obj1, **obj2;
+obj_absorb(struct obj** obj1, struct obj** obj2)
{
struct obj *otmp1, *otmp2;
int o1wt, o2wt;
* cleanly (since we don't know which we want to stay around)
*/
struct obj *
-obj_meld(obj1, obj2)
-struct obj **obj1, **obj2;
+obj_meld(struct obj** obj1, struct obj** obj2)
{
struct obj *otmp1, *otmp2, *result = 0;
int ox, oy;
/* give a message if hero notices two globs merging [used to be in pline.c] */
void
-pudding_merge_message(otmp, otmp2)
-struct obj *otmp;
-struct obj *otmp2;
+pudding_merge_message(struct obj* otmp, struct obj* otmp2)
{
boolean visible = (cansee(otmp->ox, otmp->oy)
|| cansee(otmp2->ox, otmp2->oy)),
#include "hack.h"
-static boolean FDECL(isbig, (struct mkroom *));
-static struct mkroom *FDECL(pick_room, (BOOLEAN_P));
-static void NDECL(mkshop), FDECL(mkzoo, (int)), NDECL(mkswamp);
-static void FDECL(mk_zoo_thronemon, (int, int));
-static void NDECL(mktemple);
-static coord *FDECL(shrine_pos, (int));
-static struct permonst *NDECL(morguemon);
-static struct permonst *NDECL(squadmon);
-static void FDECL(save_room, (NHFILE *, struct mkroom *));
-static void FDECL(rest_room, (NHFILE *, struct mkroom *));
+static boolean isbig(struct mkroom *);
+static struct mkroom *pick_room(boolean);
+static void mkshop(void), mkzoo(int), mkswamp(void);
+static void mk_zoo_thronemon(int, int);
+static void mktemple(void);
+static coord *shrine_pos(int);
+static struct permonst *morguemon(void);
+static struct permonst *squadmon(void);
+static void save_room(NHFILE *, struct mkroom *);
+static void rest_room(NHFILE *, struct mkroom *);
#define sq(x) ((x) * (x))
extern const struct shclass shtypes[]; /* defined in shknam.c */
static boolean
-isbig(sroom)
-register struct mkroom *sroom;
+isbig(struct mkroom* sroom)
{
register int area = (sroom->hx - sroom->lx + 1)
* (sroom->hy - sroom->ly + 1);
/* make and stock a room of a given type */
void
-mkroom(roomtype)
-int roomtype;
+mkroom(int roomtype)
{
if (roomtype >= SHOPBASE)
mkshop(); /* someday, we should be able to specify shop type */
}
static void
-mkshop()
+mkshop(void)
{
register struct mkroom *sroom;
int i = -1;
/* pick an unused room, preferably with only one door */
static struct mkroom *
-pick_room(strict)
-register boolean strict;
+pick_room(boolean strict)
{
register struct mkroom *sroom;
register int i = g.nroom;
}
static void
-mkzoo(type)
-int type;
+mkzoo(int type)
{
register struct mkroom *sroom;
}
static void
-mk_zoo_thronemon(x,y)
-int x,y;
+mk_zoo_thronemon(int x,int y)
{
int i = rnd(level_difficulty());
int pm = (i > 9) ? PM_OGRE_TYRANT
}
void
-fill_zoo(sroom)
-struct mkroom *sroom;
+fill_zoo(struct mkroom* sroom)
{
struct monst *mon;
register int sx, sy, i;
/* make a swarm of undead around mm */
void
-mkundead(mm, revive_corpses, mm_flags)
-coord *mm;
-boolean revive_corpses;
-int mm_flags;
+mkundead(
+ coord *mm,
+ boolean revive_corpses,
+ int mm_flags)
{
int cnt = (level_difficulty() + 1) / 10 + rnd(5);
struct permonst *mdat;
}
static struct permonst *
-morguemon()
+morguemon(void)
{
register int i = rn2(100), hd = rn2(level_difficulty());
}
struct permonst *
-antholemon()
+antholemon(void)
{
int mtyp, indx, trycnt = 0;
}
static void
-mkswamp() /* Michiel Huisjes & Fred de Wilde */
+mkswamp(void) /* Michiel Huisjes & Fred de Wilde */
{
register struct mkroom *sroom;
register int sx, sy, i, eelct = 0;
}
static coord *
-shrine_pos(roomno)
-int roomno;
+shrine_pos(int roomno)
{
static coord buf;
int delta;
}
static void
-mktemple()
+mktemple(void)
{
register struct mkroom *sroom;
coord *shrine_spot;
}
boolean
-nexttodoor(sx, sy)
-register int sx, sy;
+nexttodoor(int sx, int sy)
{
register int dx, dy;
register struct rm *lev;
}
boolean
-has_dnstairs(sroom)
-register struct mkroom *sroom;
+has_dnstairs(struct mkroom* sroom)
{
stairway *stway = g.stairs;
}
boolean
-has_upstairs(sroom)
-register struct mkroom *sroom;
+has_upstairs(struct mkroom* sroom)
{
stairway *stway = g.stairs;
}
int
-somex(croom)
-register struct mkroom *croom;
+somex(struct mkroom* croom)
{
return rn1(croom->hx - croom->lx + 1, croom->lx);
}
int
-somey(croom)
-register struct mkroom *croom;
+somey(struct mkroom* croom)
{
return rn1(croom->hy - croom->ly + 1, croom->ly);
}
boolean
-inside_room(croom, x, y)
-struct mkroom *croom;
-xchar x, y;
+inside_room(struct mkroom* croom, xchar x, xchar y)
{
if (croom->irregular) {
int i = (int) ((croom - g.rooms) + ROOMOFFSET);
}
boolean
-somexy(croom, c)
-struct mkroom *croom;
-coord *c;
+somexy(struct mkroom* croom,coord * c)
{
int try_cnt = 0;
int i;
}
boolean
-somexyspace(croom, c)
-struct mkroom *croom;
-coord *c;
+somexyspace(struct mkroom* croom, coord *c)
{
int trycnt = 0;
boolean okay;
* - ANY_TYPE
*/
struct mkroom *
-search_special(type)
-schar type;
+search_special(schar type)
{
register struct mkroom *croom;
}
struct permonst *
-courtmon()
+courtmon(void)
{
int i = rn2(60) + rn2(3 * level_difficulty());
/* return soldier types. */
static struct permonst *
-squadmon()
+squadmon(void)
{
int sel_prob, i, cpro, mndx;
* (if any).
*/
static void
-save_room(nhfp, r)
-NHFILE *nhfp;
-struct mkroom *r;
+save_room(NHFILE* nhfp, struct mkroom* r)
{
short i;
* save_rooms : Save all the rooms on disk!
*/
void
-save_rooms(nhfp)
-NHFILE *nhfp;
+save_rooms(NHFILE* nhfp)
{
short i;
}
static void
-rest_room(nhfp, r)
-NHFILE *nhfp;
-struct mkroom *r;
+rest_room(NHFILE* nhfp, struct mkroom* r)
{
short i;
* the disk.
*/
void
-rest_rooms(nhfp)
-NHFILE *nhfp;
+rest_rooms(NHFILE* nhfp)
{
short i;
/* convert a display symbol for terrain into topology type;
used for remembered terrain when mimics pose as furniture */
int
-cmap_to_type(sym)
-int sym;
+cmap_to_type(int sym)
{
int typ = STONE; /* catchall */
#include "mfndpos.h"
#include <ctype.h>
-static void FDECL(sanity_check_single_mon, (struct monst *, BOOLEAN_P,
- const char *));
-static boolean FDECL(restrap, (struct monst *));
-static long FDECL(mm_2way_aggression, (struct monst *, struct monst *));
-static long FDECL(mm_aggression, (struct monst *, struct monst *));
-static long FDECL(mm_displacement, (struct monst *, struct monst *));
-static int NDECL(pick_animal);
-static void FDECL(kill_eggs, (struct obj *));
-static int FDECL(pickvampshape, (struct monst *));
-static boolean FDECL(isspecmon, (struct monst *));
-static boolean FDECL(validspecmon, (struct monst *, int));
-static struct permonst *FDECL(accept_newcham_form, (struct monst *, int));
-static struct obj *FDECL(make_corpse, (struct monst *, unsigned));
-static int FDECL(minliquid_core, (struct monst *));
-static void FDECL(m_detach, (struct monst *, struct permonst *));
-static void FDECL(set_mon_min_mhpmax, (struct monst *, int));
-static void FDECL(lifesaved_monster, (struct monst *));
-static void FDECL(migrate_mon, (struct monst *, XCHAR_P, XCHAR_P));
-static boolean FDECL(ok_to_obliterate, (struct monst *));
-static void FDECL(deal_with_overcrowding, (struct monst *));
+static void sanity_check_single_mon(struct monst *, boolean,
+ const char *);
+static boolean restrap(struct monst *);
+static long mm_2way_aggression(struct monst *, struct monst *);
+static long mm_aggression(struct monst *, struct monst *);
+static long mm_displacement(struct monst *, struct monst *);
+static int pick_animal(void);
+static void kill_eggs(struct obj *);
+static int pickvampshape(struct monst *);
+static boolean isspecmon(struct monst *);
+static boolean validspecmon(struct monst *, int);
+static struct permonst *accept_newcham_form(struct monst *, int);
+static struct obj *make_corpse(struct monst *, unsigned);
+static int minliquid_core(struct monst *);
+static void m_detach(struct monst *, struct permonst *);
+static void set_mon_min_mhpmax(struct monst *, int);
+static void lifesaved_monster(struct monst *);
+static void migrate_mon(struct monst *, xchar, xchar);
+static boolean ok_to_obliterate(struct monst *);
+static void deal_with_overcrowding(struct monst *);
#define LEVEL_SPECIFIC_NOCORPSE(mdat) \
(Is_rogue_level(&u.uz) \
static void
-sanity_check_single_mon(mtmp, chk_geno, msg)
-struct monst *mtmp;
-boolean chk_geno;
-const char *msg;
+sanity_check_single_mon(
+ struct monst *mtmp,
+ boolean chk_geno,
+ const char *msg)
{
struct permonst *mptr = mtmp->data;
int mx = mtmp->mx, my = mtmp->my;
}
void
-mon_sanity_check()
+mon_sanity_check(void)
{
int x, y;
struct monst *mtmp, *m;
/* Does not check for actual poison gas at the location. */
/* Returns one of M_POISONGAS_foo */
int
-m_poisongas_ok(mtmp)
-struct monst *mtmp;
+m_poisongas_ok(struct monst* mtmp)
{
int px, py;
boolean is_you = (mtmp == &g.youmonst);
/* Return TRUE if this monster is capable of converting other monsters into
* zombies. */
boolean
-zombie_maker(pm)
-struct permonst *pm;
+zombie_maker(struct permonst* pm)
{
switch(pm->mlet) {
case S_ZOMBIE:
* If a zombie gets passed to this function, it should return NON_PM, not the
* same monster again. */
int
-zombie_form(pm)
-struct permonst *pm;
+zombie_form(struct permonst* pm)
{
switch(pm->mlet) {
case S_KOBOLD:
/* convert the monster index of an undead to its living counterpart */
int
-undead_to_corpse(mndx)
-int mndx;
+undead_to_corpse(int mndx)
{
switch (mndx) {
case PM_KOBOLD_ZOMBIE:
* if mode is 1.
*/
int
-genus(mndx, mode)
-int mndx, mode;
+genus(int mndx, int mode)
{
switch (mndx) {
/* Quest guardians */
/* return monster index if chameleon, or NON_PM if not */
int
-pm_to_cham(mndx)
-int mndx;
+pm_to_cham(int mndx)
{
int mcham = NON_PM;
* etc....
*/
static struct obj *
-make_corpse(mtmp, corpseflags)
-register struct monst *mtmp;
-unsigned corpseflags;
+make_corpse(register struct monst* mtmp, unsigned int corpseflags)
{
register struct permonst *mdat = mtmp->data;
int num;
/* check mtmp and water/lava for compatibility, 0 (survived), 1 (died) */
int
-minliquid(mtmp)
-struct monst *mtmp;
+minliquid(struct monst* mtmp)
{
int res;
/* guts of minliquid() */
static int
-minliquid_core(mtmp)
-struct monst *mtmp;
+minliquid_core(struct monst* mtmp)
{
boolean inpool, inlava, infountain;
/* calculate 'mon's movement for current turn; called from moveloop() */
int
-mcalcmove(mon, m_moving)
-struct monst *mon;
-boolean m_moving; /* True: adjust for moving; False: just adjust for speed */
+mcalcmove(
+ struct monst *mon,
+ boolean m_moving) /* True: adjust for moving; False: just adjust for speed */
{
int mmove = mon->data->mmove;
int mmove_adj;
individual monster's metabolism; some of these might need to
be reclassified to occur more in proportion with movement rate */
void
-mcalcdistress()
+mcalcdistress(void)
{
struct monst *mtmp;
}
int
-movemon()
+movemon(void)
{
register struct monst *mtmp, *nmtmp;
register boolean somebody_can_move = FALSE;
* has young and old forms).
*/
int
-meatmetal(mtmp)
-register struct monst *mtmp;
+meatmetal(register struct monst* mtmp)
{
register struct obj *otmp;
struct permonst *ptr;
/* monster eats a pile of objects */
int
-meatobj(mtmp) /* for gelatinous cubes */
-struct monst *mtmp;
+meatobj(struct monst* mtmp) /* for gelatinous cubes */
{
struct obj *otmp, *otmp2;
struct permonst *ptr, *original_ptr = mtmp->data;
/* Monster eats a corpse off the ground.
* Return value is 0 = nothing eaten, 1 = ate a corpse, 2 = died */
int
-meatcorpse(mtmp) /* for purple worms and other voracious monsters */
-struct monst* mtmp;
+meatcorpse(struct monst* mtmp) /* for purple worms and other voracious monsters */
{
struct obj *otmp;
struct permonst *ptr, *original_ptr = mtmp->data, *corpsepm;
}
void
-mpickgold(mtmp)
-register struct monst *mtmp;
+mpickgold(register struct monst* mtmp)
{
register struct obj *gold;
int mat_idx;
}
boolean
-mpickstuff(mtmp, str)
-register struct monst *mtmp;
-register const char *str;
+mpickstuff(register struct monst* mtmp, register const char* str)
{
register struct obj *otmp, *otmp2, *otmp3;
int carryamt = 0;
}
int
-curr_mon_load(mtmp)
-struct monst *mtmp;
+curr_mon_load(struct monst* mtmp)
{
int curload = 0;
struct obj *obj;
}
int
-max_mon_load(mtmp)
-struct monst *mtmp;
+max_mon_load(struct monst* mtmp)
{
long maxload;
* likesgold handling m_move results in picking up the whole stack.
*/
int
-can_carry(mtmp, otmp)
-struct monst *mtmp;
-struct obj *otmp;
+can_carry(struct monst* mtmp, struct obj* otmp)
{
int iquan, otyp = otmp->otyp, newload = otmp->owt;
struct permonst *mdat = mtmp->data;
/* return flags based on monster data, for mfndpos() */
long
-mon_allowflags(mtmp)
-struct monst *mtmp;
+mon_allowflags(struct monst* mtmp)
{
long allowflags = 0L;
boolean can_open = !(nohands(mtmp->data) || verysmall(mtmp->data));
/* return number of acceptable neighbour positions */
int
-mfndpos(mon, poss, info, flag)
-struct monst *mon;
-coord *poss; /* coord poss[9] */
-long *info; /* long info[9] */
-long flag;
+mfndpos(
+ struct monst *mon,
+ coord *poss, /* coord poss[9] */
+ long *info, /* long info[9] */
+ long flag)
{
struct permonst *mdat = mon->data;
register struct trap *ttmp;
* code each case twice, this function contains those cases that ought to
* happen twice, and mm_aggression will call it twice. */
static long
-mm_2way_aggression(magr, mdef)
-struct monst *magr, *mdef;
+mm_2way_aggression(struct monst* magr, struct monst* mdef)
{
struct permonst *ma = magr->data;
struct permonst *md = mdef->data;
other monsters; just hand to hand fighting when they happen to be
next to each other. */
static long
-mm_aggression(magr, mdef)
-struct monst *magr, /* monster that is currently deciding where to move */
- *mdef; /* another monster which is next to it */
+mm_aggression(
+ struct monst *magr, /* monster that is currently deciding where to move */
+ struct monst *mdef) /* another monster which is next to it */
{
int mndx = monsndx(magr->data);
/* Monster displacing another monster out of the way */
static long
-mm_displacement(magr, mdef)
-struct monst *magr, /* monster that is currently deciding where to move */
- *mdef; /* another monster which is next to it */
+mm_displacement(
+ struct monst *magr, /* monster that is currently deciding where to move */
+ struct monst *mdef) /* another monster which is next to it */
{
struct permonst *pa = magr->data, *pd = mdef->data;
/* Is the square close enough for the monster to move or attack into? */
boolean
-monnear(mon, x, y)
-struct monst *mon;
-int x, y;
+monnear(struct monst* mon, int x, int y)
{
int distance = dist2(mon->mx, mon->my, x, y);
/* really free dead monsters */
void
-dmonsfree()
+dmonsfree(void)
{
struct monst **mtmp, *freetmp;
int count = 0;
/* called when monster is moved to larger structure */
void
-replmon(mtmp, mtmp2)
-struct monst *mtmp, *mtmp2;
+replmon(struct monst* mtmp, struct monst* mtmp2)
{
struct obj *otmp;
/* release mon from the display and the map's monster list,
maybe transfer it to one of the other monster lists */
void
-relmon(mon, monst_list)
-struct monst *mon;
-struct monst **monst_list; /* &g.migrating_mons or &g.mydogs or null */
+relmon(
+ struct monst *mon,
+ struct monst **monst_list) /* &g.migrating_mons or &g.mydogs or null */
{
struct monst *mtmp;
int mx = mon->mx, my = mon->my;
}
void
-copy_mextra(mtmp2, mtmp1)
-struct monst *mtmp2, *mtmp1;
+copy_mextra(struct monst* mtmp2, struct monst* mtmp1)
{
if (!mtmp2 || !mtmp1 || !mtmp1->mextra)
return;
}
void
-dealloc_mextra(m)
-struct monst *m;
+dealloc_mextra(struct monst* m)
{
struct mextra *x = m->mextra;
}
void
-dealloc_monst(mon)
-struct monst *mon;
+dealloc_monst(struct monst* mon)
{
char buf[QBUFSZ];
/* remove effects of mtmp from other data structures */
static void
-m_detach(mtmp, mptr)
-struct monst *mtmp;
-struct permonst *mptr; /* reflects mtmp->data _prior_ to mtmp's death */
+m_detach(
+ struct monst *mtmp,
+ struct permonst *mptr) /* reflects mtmp->data _prior_ to mtmp's death */
{
boolean onmap = (mtmp->mx > 0);
/* give a life-saved monster a reasonable mhpmax value in case it has
been the victim of excessive life draining */
static void
-set_mon_min_mhpmax(mon, minimum_mhpmax)
-struct monst *mon;
-int minimum_mhpmax; /* monster life-saving has traditionally used 10 */
+set_mon_min_mhpmax(
+ struct monst *mon,
+ int minimum_mhpmax) /* monster life-saving has traditionally used 10 */
{
/* can't be less than m_lev+1 (if we just used m_lev itself, level 0
monsters would end up allowing a minimum of 0); since life draining
/* find the worn amulet of life saving which will save a monster */
struct obj *
-mlifesaver(mon)
-struct monst *mon;
+mlifesaver(struct monst* mon)
{
if (!nonliving(mon->data) || is_vampshifter(mon)) {
struct obj *otmp = which_armor(mon, W_AMUL);
}
static void
-lifesaved_monster(mtmp)
-struct monst *mtmp;
+lifesaved_monster(struct monst* mtmp)
{
boolean surviver;
struct obj *lifesave = mlifesaver(mtmp);
}
void
-mondead(mtmp)
-register struct monst *mtmp;
+mondead(register struct monst* mtmp)
{
struct permonst *mptr;
boolean be_sad;
/* TRUE if corpse might be dropped, magr may die if mon was swallowed */
boolean
-corpse_chance(mon, magr, was_swallowed)
-struct monst *mon;
-struct monst *magr; /* killer, if swallowed */
-boolean was_swallowed; /* digestion */
+corpse_chance(
+ struct monst *mon,
+ struct monst *magr, /* killer, if swallowed */
+ boolean was_swallowed) /* digestion */
{
struct permonst *mdat = mon->data;
int i, tmp;
/* drop (perhaps) a cadaver and remove monster */
void
-mondied(mdef)
-register struct monst *mdef;
+mondied(register struct monst* mdef)
{
mondead(mdef);
if (!DEADMONSTER(mdef))
/* monster disappears, not dies */
void
-mongone(mdef)
-struct monst *mdef;
+mongone(struct monst* mdef)
{
mdef->mhp = 0; /* can skip some inventory bookkeeping */
/* drop a statue or rock and remove monster */
void
-monstone(mdef)
-struct monst *mdef;
+monstone(struct monst* mdef)
{
struct obj *otmp, *obj, *oldminvent;
xchar x = mdef->mx, y = mdef->my;
/* another monster has killed the monster mdef */
void
-monkilled(mdef, fltxt, how)
-struct monst *mdef;
-const char *fltxt;
-int how;
+monkilled(
+ struct monst *mdef,
+ const char *fltxt,
+ int how)
{
struct permonst *mptr = mdef->data;
}
void
-set_ustuck(mtmp)
-struct monst *mtmp;
+set_ustuck(struct monst* mtmp)
{
if (iflags.sanity_check || iflags.debug_fuzzer) {
if (mtmp && distu(mtmp->mx, mtmp->my) > 2)
}
void
-unstuck(mtmp)
-struct monst *mtmp;
+unstuck(struct monst* mtmp)
{
if (u.ustuck == mtmp) {
/* do this first so that docrt()'s botl update is accurate;
}
void
-killed(mtmp)
-struct monst *mtmp;
+killed(struct monst* mtmp)
{
xkilled(mtmp, XKILL_GIVEMSG);
}
/* the player has killed the monster mtmp */
void
-xkilled(mtmp, xkill_flags)
-struct monst *mtmp;
-int xkill_flags; /* 1: suppress message, 2: suppress corpse, 4: pacifist */
+xkilled(
+ struct monst *mtmp,
+ int xkill_flags) /* 1: suppress message, 2: suppress corpse, 4: pacifist */
{
int tmp, mndx, x = mtmp->mx, y = mtmp->my;
struct permonst *mdat;
/* changes the monster into a stone monster of the same type
this should only be called when poly_when_stoned() is true */
void
-mon_to_stone(mtmp)
-struct monst *mtmp;
+mon_to_stone(struct monst* mtmp)
{
if (mtmp->data->mlet == S_GOLEM) {
/* it's a golem, and not a stone golem */
}
boolean
-vamp_stone(mtmp)
-struct monst *mtmp;
+vamp_stone(struct monst* mtmp)
{
if (is_vampshifter(mtmp)) {
int mndx = mtmp->cham;
/* drop monster into "limbo" - that is, migrate to the current level */
void
-m_into_limbo(mtmp)
-struct monst *mtmp;
+m_into_limbo(struct monst* mtmp)
{
xchar target_lev = ledger_no(&u.uz), xyloc = MIGR_APPROX_XY;
}
static void
-migrate_mon(mtmp, target_lev, xyloc)
-struct monst *mtmp;
-xchar target_lev, xyloc;
+migrate_mon(struct monst* mtmp, xchar target_lev, xchar xyloc)
{
unstuck(mtmp);
mdrop_special_objs(mtmp);
}
static boolean
-ok_to_obliterate(mtmp)
-struct monst *mtmp;
+ok_to_obliterate(struct monst* mtmp)
{
/*
* Add checks for monsters that should not be obliterated
}
void
-elemental_clog(mon)
-struct monst *mon;
+elemental_clog(struct monst* mon)
{
int m_lev = 0;
static long msgmv = 0L;
/* make monster mtmp next to you (if possible);
might place monst on far side of a wall or boulder */
void
-mnexto(mtmp)
-struct monst *mtmp;
+mnexto(struct monst* mtmp)
{
coord mm;
boolean couldspot = canspotmon(mtmp);
}
static void
-deal_with_overcrowding(mtmp)
-struct monst *mtmp;
+deal_with_overcrowding(struct monst* mtmp)
{
if (In_endgame(&u.uz)) {
debugpline1("overcrowding: elemental_clog on %s", m_monnam(mtmp));
/* like mnexto() but requires destination to be directly accessible */
void
-maybe_mnexto(mtmp)
-struct monst *mtmp;
+maybe_mnexto(struct monst* mtmp)
{
coord mm;
struct permonst *ptr = mtmp->data;
* will be False on the nested call so there won't be any further recursion.
*/
int
-mnearto(mtmp, x, y, move_other)
-register struct monst *mtmp;
-xchar x, y;
-boolean move_other; /* make sure mtmp gets to x, y! so move m_at(x, y) */
+mnearto(
+ register struct monst *mtmp,
+ xchar x,
+ xchar y,
+ boolean move_other) /* make sure mtmp gets to x, y! so move m_at(x, y) */
{
struct monst *othermon = (struct monst *) 0;
xchar newx, newy;
/* monster responds to player action; not the same as a passive attack;
assumes reason for response has been tested, and response _must_ be made */
void
-m_respond(mtmp)
-struct monst *mtmp;
+m_respond(struct monst* mtmp)
{
if (mtmp->data->msound == MS_SHRIEK) {
if (!Deaf) {
where mtmp was already hostile; it checks for situations where the player
shouldn't be attacking and any ramifications /that/ might have. */
void
-setmangry(mtmp, via_attack)
-struct monst *mtmp;
-boolean via_attack;
+setmangry(struct monst* mtmp, boolean via_attack)
{
if (via_attack && sengr_at("Elbereth", u.ux, u.uy, TRUE)
/* only hypocritical if monster is vulnerable to Elbereth (or
/* wake up a monster, possibly making it angry in the process */
void
-wakeup(mtmp, via_attack)
-register struct monst *mtmp;
-boolean via_attack;
+wakeup(struct monst* mtmp, boolean via_attack)
{
mtmp->msleeping = 0;
if (M_AP_TYPE(mtmp) != M_AP_NOTHING) {
/* Wake up nearby monsters without angering them. */
void
-wake_nearby()
+wake_nearby(void)
{
wake_nearto(u.ux, u.uy, u.ulevel * 20);
}
/* Wake up monsters near some particular location. */
void
-wake_nearto(x, y, distance)
-int x, y, distance;
+wake_nearto(int x, int y, int distance)
{
struct monst *mtmp;
/* NOTE: we must check for mimicry before calling this routine */
void
-seemimic(mtmp)
-register struct monst *mtmp;
+seemimic(register struct monst* mtmp)
{
boolean is_blocker_appear = (is_lightblocker_mappear(mtmp));
/* force all chameleons to become normal */
void
-rescham()
+rescham(void)
{
register struct monst *mtmp;
int mcham;
/* Let the chameleons change again -dgk */
void
-restartcham()
+restartcham(void)
{
register struct monst *mtmp;
against shape-changing might be different now than it was at the
time the level was saved. */
void
-restore_cham(mon)
-struct monst *mon;
+restore_cham(struct monst* mon)
{
int mcham;
/* unwatched hiders may hide again; if so, returns True */
static boolean
-restrap(mtmp)
-register struct monst *mtmp;
+restrap(struct monst* mtmp)
{
struct trap *t;
/* reveal a monster at x,y hiding under an object,
if there are no objects there */
void
-maybe_unhide_at(x, y)
-xchar x, y;
+maybe_unhide_at(xchar x, xchar y)
{
struct monst *mtmp;
/* monster/hero tries to hide under something at the current location */
boolean
-hideunder(mtmp)
-struct monst *mtmp;
+hideunder(struct monst* mtmp)
{
struct trap *t;
boolean undetected = FALSE, is_u = (mtmp == &g.youmonst);
/* called when returning to a previously visited level */
void
-hide_monst(mon)
-struct monst *mon;
+hide_monst(struct monst* mon)
{
boolean hider_under = hides_under(mon->data) || mon->data->mlet == S_EEL;
}
void
-mon_animal_list(construct)
-boolean construct;
+mon_animal_list(boolean construct)
{
if (construct) {
short animal_temp[SPECIAL_PM];
}
static int
-pick_animal()
+pick_animal(void)
{
int res;
}
void
-decide_to_shapeshift(mon, shiftflags)
-struct monst *mon;
-int shiftflags;
+decide_to_shapeshift(struct monst* mon, int shiftflags)
{
struct permonst *ptr = 0;
int mndx;
}
static int
-pickvampshape(mon)
-struct monst *mon;
+pickvampshape(struct monst* mon)
{
int mndx = mon->cham, wolfchance = 10;
/* avoid picking monsters with lowercase display symbols ('d' for wolf
/* nonshapechangers who warrant special polymorph handling */
static boolean
-isspecmon(mon)
-struct monst *mon;
+isspecmon(struct monst* mon)
{
return (mon->isshk || mon->ispriest || mon->isgd
|| mon->m_id == g.quest_status.leader_m_id);
vault guards) to forms that allow them to behave sensibly (catching
gold, speaking?) so that they don't need too much extra code */
static boolean
-validspecmon(mon, mndx)
-struct monst *mon;
-int mndx;
+validspecmon(struct monst* mon, int mndx)
{
if (mndx == NON_PM)
return TRUE; /* caller wants random */
/* used for hero polyself handling */
boolean
-valid_vampshiftform(base, form)
-int base, form;
+valid_vampshiftform(int base, int form)
{
if (base >= LOW_PM && is_vampire(&mons[base])) {
if (form == PM_VAMPIRE_BAT || form == PM_FOG_CLOUD
/* prevent wizard mode user from specifying invalid vampshifter shape
when using monpolycontrol to assign a new form to a vampshifter */
boolean
-validvamp(mon, mndx_p, monclass)
-struct monst *mon;
-int *mndx_p, monclass;
+validvamp(struct monst* mon, int* mndx_p, int monclass)
{
/* simplify caller's usage */
if (!is_vampshifter(mon))
}
int
-select_newcham_form(mon)
-struct monst *mon;
+select_newcham_form(struct monst* mon)
{
int mndx = NON_PM, tryct;
/* this used to be inline within newcham() but monpolycontrol needs it too */
static struct permonst *
-accept_newcham_form(mon, mndx)
-struct monst *mon;
-int mndx;
+accept_newcham_form(struct monst* mon, int mndx)
{
struct permonst *mdat;
}
void
-mgender_from_permonst(mtmp, mdat)
-struct monst *mtmp;
-struct permonst *mdat;
+mgender_from_permonst(struct monst* mtmp, struct permonst* mdat)
{
if (is_male(mdat)) {
if (mtmp->female)
(possibly self-inflicted) become a different monster;
returns 1 if it actually changes form */
int
-newcham(mtmp, mdat, polyspot, msg)
-struct monst *mtmp;
-struct permonst *mdat;
-boolean polyspot; /* change is the result of wand or spell of polymorph */
-boolean msg; /* "The oldmon turns into a newmon!" */
+newcham(
+ struct monst *mtmp,
+ struct permonst *mdat,
+ boolean polyspot, /* change is the result of wand or spell of polymorph */
+ boolean msg) /* "The oldmon turns into a newmon!" */
{
int hpn, hpd;
int mndx, tryct;
* NON_PM if the given monster can't be hatched.
*/
int
-can_be_hatched(mnum)
-int mnum;
+can_be_hatched(int mnum)
{
/* ranger quest nemesis has the oviparous bit set, making it
be possible to wish for eggs of that unique monster; turn
/* type of egg laid by #sit; usually matches parent */
int
-egg_type_from_parent(mnum, force_ordinary)
-int mnum; /* parent monster; caller must handle lays_eggs() check */
-boolean force_ordinary;
+egg_type_from_parent(
+ int mnum, /* parent monster; caller must handle lays_eggs() check */
+ boolean force_ordinary)
{
if (force_ordinary || !BREEDER_EGG) {
if (mnum == PM_QUEEN_BEE)
/* decide whether an egg of the indicated monster type is viable;
also used to determine whether an egg or tin can be created... */
boolean
-dead_species(m_idx, egg)
-int m_idx;
-boolean egg;
+dead_species(int m_idx, boolean egg)
{
int alt_idx;
/* kill off any eggs of genocided monsters */
static void
-kill_eggs(obj_list)
-struct obj *obj_list;
+kill_eggs(struct obj* obj_list)
{
struct obj *otmp;
/* kill all members of genocided species */
void
-kill_genocided_monsters()
+kill_genocided_monsters(void)
{
struct monst *mtmp, *mtmp2;
boolean kill_cham;
}
void
-golemeffects(mon, damtype, dam)
-register struct monst *mon;
-int damtype, dam;
+golemeffects(register struct monst* mon, int damtype, int dam)
{
int heal = 0, slow = 0;
}
boolean
-angry_guards(silent)
-boolean silent;
+angry_guards(boolean silent)
{
struct monst *mtmp;
int ct = 0, nct = 0, sct = 0, slct = 0;
}
void
-pacify_guards()
+pacify_guards(void)
{
struct monst *mtmp;
}
void
-mimic_hit_msg(mtmp, otyp)
-struct monst *mtmp;
-short otyp;
+mimic_hit_msg(struct monst* mtmp, short otyp)
{
short ap = mtmp->mappearance;
}
boolean
-usmellmon(mdat)
-struct permonst *mdat;
+usmellmon(struct permonst* mdat)
{
int mndx;
boolean nonspecific = FALSE;
/* set up an individual monster's base type (initial creation, shapechange) */
void
-set_mon_data(mon, ptr)
-struct monst *mon;
-struct permonst *ptr;
+set_mon_data(struct monst* mon, struct permonst* ptr)
{
int new_speed, old_speed = mon->data ? mon->data->mmove : 0;
/* does monster-type have any attack for a specific type of damage? */
struct attack *
-attacktype_fordmg(ptr, atyp, dtyp)
-struct permonst *ptr;
-int atyp, dtyp;
+attacktype_fordmg(struct permonst* ptr, int atyp, int dtyp)
{
struct attack *a;
/* does monster-type have a particular type of attack */
boolean
-attacktype(ptr, atyp)
-struct permonst *ptr;
-int atyp;
+attacktype(struct permonst* ptr, int atyp)
{
return attacktype_fordmg(ptr, atyp, AD_ANY) ? TRUE : FALSE;
}
/* returns True if monster doesn't attack, False if it does */
boolean
-noattacks(ptr)
-struct permonst *ptr;
+noattacks(struct permonst* ptr)
{
int i;
struct attack *mattk = ptr->mattk;
/* does monster-type transform into something else when petrified? */
boolean
-poly_when_stoned(ptr)
-struct permonst *ptr;
+poly_when_stoned(struct permonst* ptr)
{
/* non-stone golems turn into stone golems unless latter is genocided */
return (boolean) (is_golem(ptr) && ptr != &mons[PM_STONE_GOLEM]
/* returns True if monster is drain-life resistant */
boolean
-resists_drli(mon)
-struct monst *mon;
+resists_drli(struct monst* mon)
{
struct permonst *ptr = mon->data;
struct obj *wep;
/* True if monster is magic-missile (actually, general magic) resistant */
boolean
-resists_magm(mon)
-struct monst *mon;
+resists_magm(struct monst* mon)
{
struct permonst *ptr = mon->data;
boolean is_you = (mon == &g.youmonst);
/* True iff monster is resistant to light-induced blindness */
boolean
-resists_blnd(mon)
-struct monst *mon;
+resists_blnd(struct monst* mon)
{
struct permonst *ptr = mon->data;
boolean is_you = (mon == &g.youmonst);
magr can be NULL.
*/
boolean
-can_blnd(magr, mdef, aatyp, obj)
-struct monst *magr; /* NULL == no specific aggressor */
-struct monst *mdef;
-uchar aatyp;
-struct obj *obj; /* aatyp == AT_WEAP, AT_SPIT */
+can_blnd(
+ struct monst *magr, /* NULL == no specific aggressor */
+ struct monst *mdef,
+ uchar aatyp,
+ struct obj *obj) /* aatyp == AT_WEAP, AT_SPIT */
{
boolean is_you = (mdef == &g.youmonst);
boolean check_visor = FALSE;
/* returns True if monster can attack at range */
boolean
-ranged_attk(ptr)
-struct permonst *ptr;
+ranged_attk(struct permonst* ptr)
{
register int i, atyp;
long atk_mask = (1L << AT_BREA) | (1L << AT_SPIT) | (1L << AT_GAZE);
/* True if specific monster is especially affected by silver weapons */
boolean
-mon_hates_silver(mon)
-struct monst *mon;
+mon_hates_silver(struct monst* mon)
{
return (boolean) (is_vampshifter(mon) || hates_silver(mon->data));
}
/* True if monster-type is especially affected by silver weapons */
boolean
-hates_silver(ptr)
-register struct permonst *ptr;
+hates_silver(register struct permonst* ptr)
{
return (boolean) (is_were(ptr) || ptr->mlet == S_VAMPIRE || is_demon(ptr)
|| ptr == &mons[PM_SHADE]
/* True if specific monster is especially affected by light-emitting weapons */
boolean
-mon_hates_light(mon)
-struct monst *mon;
+mon_hates_light(struct monst* mon)
{
return (boolean) (hates_light(mon->data));
}
/* True iff the type of monster pass through iron bars */
boolean
-passes_bars(mptr)
-struct permonst *mptr;
+passes_bars(struct permonst* mptr)
{
return (boolean) (passes_walls(mptr) || amorphous(mptr) || unsolid(mptr)
|| is_whirly(mptr) || verysmall(mptr)
/* returns True if monster can blow (whistle, etc) */
boolean
-can_blow(mtmp)
-struct monst *mtmp;
+can_blow(struct monst* mtmp)
{
if ((is_silent(mtmp->data) || mtmp->data->msound == MS_BUZZ)
&& (breathless(mtmp->data) || verysmall(mtmp->data)
/* for casting spells and reading scrolls while blind */
boolean
-can_chant(mtmp)
-struct monst *mtmp;
+can_chant(struct monst* mtmp)
{
if ((mtmp == &g.youmonst && Strangled)
|| is_silent(mtmp->data) || !has_head(mtmp->data)
/* True if mon is vulnerable to strangulation */
boolean
-can_be_strangled(mon)
-struct monst *mon;
+can_be_strangled(struct monst* mon)
{
struct obj *mamul;
boolean nonbreathing, nobrainer;
/* returns True if monster can track well */
boolean
-can_track(ptr)
-register struct permonst *ptr;
+can_track(register struct permonst* ptr)
{
if (uwep && uwep->oartifact == ART_EXCALIBUR)
return TRUE;
/* creature will slide out of armor */
boolean
-sliparm(ptr)
-register struct permonst *ptr;
+sliparm(register struct permonst* ptr)
{
return (boolean) (is_whirly(ptr) || ptr->msize <= MZ_SMALL
|| noncorporeal(ptr));
/* creature will break out of armor */
boolean
-breakarm(ptr)
-register struct permonst *ptr;
+breakarm(register struct permonst* ptr)
{
if (sliparm(ptr))
return FALSE;
/* creature sticks other creatures it hits */
boolean
-sticks(ptr)
-register struct permonst *ptr;
+sticks(register struct permonst* ptr)
{
return (boolean) (dmgtype(ptr, AD_STCK) || dmgtype(ptr, AD_WRAP)
|| attacktype(ptr, AT_HUGS));
/* some monster-types can't vomit */
boolean
-cantvomit(ptr)
-struct permonst *ptr;
+cantvomit(struct permonst* ptr)
{
/* rats and mice are incapable of vomiting;
which other creatures have the same limitation? */
/* number of horns this type of monster has on its head */
int
-num_horns(ptr)
-struct permonst *ptr;
+num_horns(struct permonst* ptr)
{
switch (monsndx(ptr)) {
case PM_HORNED_DEVIL: /* ? "more than one" */
/* does monster-type deal out a particular type of damage from a particular
type of attack? */
struct attack *
-dmgtype_fromattack(ptr, dtyp, atyp)
-struct permonst *ptr;
-int dtyp, atyp;
+dmgtype_fromattack(struct permonst* ptr, int dtyp, int atyp)
{
struct attack *a;
/* does monster-type deal out a particular type of damage from any attack */
boolean
-dmgtype(ptr, dtyp)
-struct permonst *ptr;
-int dtyp;
+dmgtype(struct permonst* ptr, int dtyp)
{
return dmgtype_fromattack(ptr, dtyp, AT_ANY) ? TRUE : FALSE;
}
/* returns the maximum damage a defender can do to the attacker via
a passive defense */
int
-max_passive_dmg(mdef, magr)
-register struct monst *mdef, *magr;
+max_passive_dmg(register struct monst* mdef, register struct monst* magr)
{
int i, dmg, multi2 = 0;
uchar adtyp;
/* determine whether two monster types are from the same species */
boolean
-same_race(pm1, pm2)
-struct permonst *pm1, *pm2;
+same_race(struct permonst* pm1, struct permonst* pm2)
{
char let1 = pm1->mlet, let2 = pm2->mlet;
/* return an index into the mons array */
int
-monsndx(ptr)
-struct permonst *ptr;
+monsndx(struct permonst* ptr)
{
register int i;
/* figure out what type of monster a user-supplied string is specifying;
ingore anything past the monster name */
int
-name_to_mon(in_str, gender_name_var)
-const char *in_str;
-int *gender_name_var;
+name_to_mon(const char *in_str, int * gender_name_var)
{
return name_to_monplus(in_str, (const char **) 0, gender_name_var);
}
caller wants to strip off the name and it matches one of the alternate
names rather the canonical mons[].mname */
int
-name_to_monplus(in_str, remainder_p, gender_name_var)
-const char *in_str;
-const char **remainder_p;
-int *gender_name_var;
+name_to_monplus(
+ const char *in_str,
+ const char **remainder_p,
+ int *gender_name_var)
{
/* Be careful. We must check the entire string in case it was
* something such as "ettin zombie corpse". The calling routine
/* monster class from user input; used for genocide and controlled polymorph;
returns 0 rather than MAXMCLASSES if no match is found */
int
-name_to_monclass(in_str, mndx_p)
-const char *in_str;
-int *mndx_p;
+name_to_monclass(const char *in_str, int * mndx_p)
{
/* Single letters are matched against def_monsyms[].sym; words
or phrases are first matched against def_monsyms[].explain
/* returns 3 values (0=male, 1=female, 2=none) */
int
-gender(mtmp)
-register struct monst *mtmp;
+gender(register struct monst* mtmp)
{
if (is_neuter(mtmp->data))
return 2;
and lower animals and such are "it" even when seen; hallucination might
yield "they". This is the one we want to use when printing messages. */
int
-pronoun_gender(mtmp, pg_flags)
-register struct monst *mtmp;
-unsigned pg_flags; /* flags&1: 'no it' unless neuter,
- * flags&2: random if hallucinating */
+pronoun_gender(
+ register struct monst *mtmp,
+ unsigned pg_flags) /* flags&1: 'no it' unless neuter,
+ * flags&2: random if hallucinating */
{
boolean override_vis = (pg_flags & PRONOUN_NO_IT) ? TRUE : FALSE,
hallu_rand = (pg_flags & PRONOUN_HALLU) ? TRUE : FALSE;
/* used for nearby monsters when you go to another level */
boolean
-levl_follower(mtmp)
-struct monst *mtmp;
+levl_follower(struct monst* mtmp)
{
if (mtmp == u.usteed)
return TRUE;
};
int
-little_to_big(montype)
-int montype;
+little_to_big(int montype)
{
register int i;
}
int
-big_to_little(montype)
-int montype;
+big_to_little(int montype)
{
register int i;
/* determine whether two permonst indices are part of the same progression;
existence of progressions with more than one step makes it a bit tricky */
boolean
-big_little_match(montyp1, montyp2)
-int montyp1, montyp2;
+big_little_match(int montyp1, int montyp2)
{
int l, b;
* player. It does not return a pointer to player role character.
*/
const struct permonst *
-raceptr(mtmp)
-struct monst *mtmp;
+raceptr(struct monst* mtmp)
{
if (mtmp == &g.youmonst && !Upolyd)
return &mons[g.urace.malenum];
static const char *crawl[4] = { "crawl", "Crawl", "falter", "Falter" };
const char *
-locomotion(ptr, def)
-const struct permonst *ptr;
-const char *def;
+locomotion(const struct permonst* ptr, const char* def)
{
int capitalize = (*def == highc(*def));
}
const char *
-stagger(ptr, def)
-const struct permonst *ptr;
-const char *def;
+stagger(const struct permonst* ptr, const char* def)
{
int capitalize = 2 + (*def == highc(*def));
/* return phrase describing the effect of fire attack on a type of monster */
const char *
-on_fire(mptr, mattk)
-struct permonst *mptr;
-struct attack *mattk;
+on_fire(struct permonst* mptr, struct attack* mattk)
{
const char *what;
* We're assuming all insects can smell at a distance too.
*/
boolean
-olfaction(mdat)
-struct permonst *mdat;
+olfaction(struct permonst* mdat)
{
if (is_golem(mdat)
|| mdat->mlet == S_EYE /* spheres */
#include "mfndpos.h"
#include "artifact.h"
-static void FDECL(watch_on_duty, (struct monst *));
-static int FDECL(disturb, (struct monst *));
-static void FDECL(release_hero, (struct monst *));
-static void FDECL(distfleeck, (struct monst *, int *, int *, int *));
-static int FDECL(m_arrival, (struct monst *));
-static boolean FDECL(m_balks_at_approaching, (struct monst *));
-static boolean FDECL(stuff_prevents_passage, (struct monst *));
-static int FDECL(vamp_shift, (struct monst *, struct permonst *,
- BOOLEAN_P));
+static void watch_on_duty(struct monst *);
+static int disturb(struct monst *);
+static void release_hero(struct monst *);
+static void distfleeck(struct monst *, int *, int *, int *);
+static int m_arrival(struct monst *);
+static boolean m_balks_at_approaching(struct monst *);
+static boolean stuff_prevents_passage(struct monst *);
+static int vamp_shift(struct monst *, struct permonst *, boolean);
/* True if mtmp died */
boolean
-mb_trapped(mtmp)
-struct monst *mtmp;
+mb_trapped(struct monst* mtmp)
{
if (flags.verbose) {
if (cansee(mtmp->mx, mtmp->my) && !Unaware)
/* check whether a monster is carrying a locking/unlocking tool */
boolean
-monhaskey(mon, for_unlocking)
-struct monst *mon;
-boolean for_unlocking; /* true => credit card ok, false => not ok */
+monhaskey(
+ struct monst *mon,
+ boolean for_unlocking) /* true => credit card ok, false => not ok */
{
if (for_unlocking && m_carrying(mon, CREDIT_CARD))
return TRUE;
}
void
-mon_yells(mon, shout)
-struct monst *mon;
-const char *shout;
+mon_yells(struct monst* mon, const char* shout)
{
if (Deaf) {
if (canspotmon(mon))
}
static void
-watch_on_duty(mtmp)
-register struct monst *mtmp;
+watch_on_duty(register struct monst* mtmp)
{
int x, y;
}
int
-dochugw(mtmp)
-register struct monst *mtmp;
+dochugw(register struct monst* mtmp)
{
int x = mtmp->mx, y = mtmp->my;
boolean already_saw_mon = !g.occupation ? 0 : canspotmon(mtmp);
}
boolean
-onscary(x, y, mtmp)
-int x, y;
-struct monst *mtmp;
+onscary(int x, int y, struct monst* mtmp)
{
/* creatures who are directly resistant to magical scaring:
* humans aren't monsters
/* regenerate lost hit points */
void
-mon_regen(mon, digest_meal)
-struct monst *mon;
-boolean digest_meal;
+mon_regen(struct monst* mon, boolean digest_meal)
{
if (mon->mhp < mon->mhpmax && (g.moves % 20 == 0 || regenerates(mon->data)))
mon->mhp++;
* jolted awake.
*/
static int
-disturb(mtmp)
-register struct monst *mtmp;
+disturb(register struct monst* mtmp)
{
/*
* + Ettins are hard to surprise.
/* ungrab/expel held/swallowed hero */
static void
-release_hero(mon)
-struct monst *mon;
+release_hero(struct monst* mon)
{
if (mon == u.ustuck) {
if (u.uswallow) {
}
struct monst *
-find_pmmonst(pm)
-int pm;
+find_pmmonst(int pm)
{
struct monst *mtmp = 0;
will eat it if there is no queen bee on the level; return 1: mon died,
0: mon ate jelly and lived; -1: mon didn't eat jelly to use its move */
int
-bee_eat_jelly(mon, obj)
-struct monst *mon;
-struct obj *obj;
+bee_eat_jelly(struct monst* mon, struct obj* obj)
{
int m_delay;
struct monst *mtmp = find_pmmonst(PM_QUEEN_BEE);
* if first, only adds fleetime if monster isn't already fleeing
* if fleemsg, prints a message about new flight, otherwise, caller should */
void
-monflee(mtmp, fleetime, first, fleemsg)
-struct monst *mtmp;
-int fleetime;
-boolean first;
-boolean fleemsg;
+monflee(
+ struct monst *mtmp,
+ int fleetime,
+ boolean first,
+ boolean fleemsg)
{
/* shouldn't happen; maybe warrants impossible()? */
if (DEADMONSTER(mtmp))
}
static void
-distfleeck(mtmp, inrange, nearby, scared)
-register struct monst *mtmp;
-int *inrange, *nearby, *scared;
+distfleeck(register struct monst* mtmp, int* inrange, int* nearby, int* scared)
{
int seescaryx, seescaryy;
boolean sawscary = FALSE, bravegremlin = (rn2(5) == 0);
/* perform a special one-time action for a monster; returns -1 if nothing
special happened, 0 if monster uses up its turn, 1 if monster is killed */
static int
-m_arrival(mon)
-struct monst *mon;
+m_arrival(struct monst* mon)
{
mon->mstrategy &= ~STRAT_ARRIVE; /* always reset */
* code. --KAA
*/
int
-dochug(mtmp)
-register struct monst *mtmp;
+dochug(register struct monst* mtmp)
{
register struct permonst *mdat;
register int tmp = 0;
static NEARDATA const char gem_class[] = { GEM_CLASS, 0 };
boolean
-itsstuck(mtmp)
-register struct monst *mtmp;
+itsstuck(register struct monst* mtmp)
{
if (sticks(g.youmonst.data) && mtmp == u.ustuck && !u.uswallow) {
pline("%s cannot escape from you!", Monnam(mtmp));
* those should be used instead. This function does that evaluation.
*/
boolean
-should_displace(mtmp, poss, info, cnt, gx, gy)
-struct monst *mtmp;
-coord *poss; /* coord poss[9] */
-long *info; /* long info[9] */
-int cnt;
-xchar gx, gy;
+should_displace(
+ struct monst *mtmp,
+ coord *poss, /* coord poss[9] */
+ long *info, /* long info[9] */
+ int cnt,
+ xchar gx,
+ xchar gy)
{
int shortest_with_displacing = -1;
int shortest_without_displacing = -1;
}
boolean
-m_digweapon_check(mtmp, nix, niy)
-struct monst *mtmp;
-xchar nix,niy;
+m_digweapon_check(struct monst* mtmp, xchar nix, xchar niy)
{
boolean can_tunnel = 0;
struct obj *mw_tmp = MON_WEP(mtmp);
/* does monster want to avoid you? */
static boolean
-m_balks_at_approaching(mtmp)
-struct monst *mtmp;
+m_balks_at_approaching(struct monst* mtmp)
{
/* peaceful, far away, or can't see you */
if (mtmp->mpeaceful
* 3: did not move, and can't do anything else either.
*/
int
-m_move(mtmp, after)
-register struct monst *mtmp;
-register int after;
+m_move(register struct monst* mtmp, register int after)
{
int appr, etmp;
xchar gx, gy, nix, niy, chcnt;
* (mtmp died) or 3 (mtmp made its move).
*/
int
-m_move_aggress(mtmp, x, y)
-struct monst * mtmp;
-xchar x, y;
+m_move_aggress(struct monst* mtmp, xchar x, xchar y)
{
struct monst *mtmp2;
int mstatus;
}
void
-dissolve_bars(x, y)
-register int x, y;
+dissolve_bars(register int x, register int y)
{
levl[x][y].typ = (Is_special(&u.uz) || *in_rooms(x, y, 0)) ? ROOM : CORR;
levl[x][y].flags = 0;
}
boolean
-closed_door(x, y)
-register int x, y;
+closed_door(register int x, register int y)
{
return (boolean) (IS_DOOR(levl[x][y].typ)
&& (levl[x][y].doormask & (D_LOCKED | D_CLOSED)));
}
boolean
-accessible(x, y)
-register int x, y;
+accessible(register int x, register int y)
{
int levtyp = levl[x][y].typ;
/* decide where the monster thinks you are standing */
void
-set_apparxy(mtmp)
-register struct monst *mtmp;
+set_apparxy(register struct monst* mtmp)
{
boolean notseen, notthere, gotu;
int disp, mx = mtmp->mux, my = mtmp->muy;
* location however.
*/
boolean
-undesirable_disp(mtmp, x, y)
-struct monst *mtmp; /* barging creature */
-xchar x, y; /* spot 'mtmp' is considering moving to */
+undesirable_disp(
+ struct monst *mtmp, /* barging creature */
+ xchar x,
+ xchar y) /* spot 'mtmp' is considering moving to */
{
boolean is_pet = (mtmp && mtmp->mtame && !mtmp->isminion);
struct trap *trap = t_at(x, y);
* Used by can_ooze() and can_fog().
*/
static boolean
-stuff_prevents_passage(mtmp)
-struct monst *mtmp;
+stuff_prevents_passage(struct monst* mtmp)
{
struct obj *chain, *obj;
}
boolean
-can_ooze(mtmp)
-struct monst *mtmp;
+can_ooze(struct monst* mtmp)
{
if (!amorphous(mtmp->data) || stuff_prevents_passage(mtmp))
return FALSE;
/* monster can change form into a fog if necessary */
boolean
-can_fog(mtmp)
-struct monst *mtmp;
+can_fog(struct monst* mtmp)
{
if (!(g.mvitals[PM_FOG_CLOUD].mvflags & G_GENOD) && is_vampshifter(mtmp)
&& !Protection_from_shape_changers && !stuff_prevents_passage(mtmp))
}
static int
-vamp_shift(mon, ptr, domsg)
-struct monst *mon;
-struct permonst *ptr;
-boolean domsg;
+vamp_shift(
+ struct monst *mon,
+ struct permonst *ptr,
+ boolean domsg)
{
int reslt = 0;
char oldmtype[BUFSZ];
#ifndef SPLITMON_1
-void NDECL(monst_globals_init); /* in hack.h but we're using config.h */
+void monst_globals_init(void); /* in hack.h but we're using config.h */
struct permonst mons[SIZE(mons_init)];
void
-monst_globals_init()
+monst_globals_init(void)
{
memcpy(mons, mons_init, sizeof(mons));
return;
#include "hack.h"
-static const char *NDECL(dev_name);
-static void FDECL(get_mplname, (struct monst *, char *));
-static void FDECL(mk_mplayer_armor, (struct monst *, SHORT_P));
+static const char *dev_name(void);
+static void get_mplname(struct monst *, char *);
+static void mk_mplayer_armor(struct monst *, short);
/* These are the names of those who
* contributed to the development of NetHack 3.2/3.3/3.4/3.6.
/* return a randomly chosen developer name */
static const char *
-dev_name()
+dev_name(void)
{
register int i, m = 0, n = SIZE(developers);
register struct monst *mtmp;
}
static void
-get_mplname(mtmp, nam)
-register struct monst *mtmp;
-char *nam;
+get_mplname(register struct monst* mtmp, char *nam)
{
boolean fmlkind = is_female(mtmp->data);
const char *devnam;
}
static void
-mk_mplayer_armor(mon, typ)
-struct monst *mon;
-short typ;
+mk_mplayer_armor(struct monst* mon, short typ)
{
struct obj *obj;
}
struct monst *
-mk_mplayer(ptr, x, y, special)
-register struct permonst *ptr;
-xchar x, y;
-register boolean special;
+mk_mplayer(register struct permonst* ptr, xchar x, xchar y, register boolean special)
{
register struct monst *mtmp;
char nam[PL_NSIZ];
* fill up the overflow.
*/
void
-create_mplayers(num, special)
-register int num;
-boolean special;
+create_mplayers(register int num, boolean special)
{
int pm, x, y;
struct monst fakemon;
}
void
-mplayer_talk(mtmp)
-register struct monst *mtmp;
+mplayer_talk(register struct monst* mtmp)
{
static const char
*same_class_msg[3] = {
#include "hack.h"
-static int FDECL(monmulti, (struct monst *, struct obj *, struct obj *));
-static void FDECL(monshoot, (struct monst *, struct obj *, struct obj *));
-static int FDECL(drop_throw, (struct obj *, BOOLEAN_P, int, int));
-static int FDECL(m_lined_up, (struct monst *, struct monst *));
+static int monmulti(struct monst *, struct obj *, struct obj *);
+static void monshoot(struct monst *, struct obj *, struct obj *);
+static int drop_throw(struct obj *, boolean, int, int);
+static int m_lined_up(struct monst *, struct monst *);
#define URETREATING(x, y) \
(distmin(u.ux, u.uy, x, y) > distmin(u.ux0, u.uy0, x, y))
};
boolean
-m_has_launcher_and_ammo(mtmp)
-struct monst *mtmp;
+m_has_launcher_and_ammo(struct monst* mtmp)
{
struct obj *mwep = MON_WEP(mtmp);
/* hero is hit by something other than a monster */
int
-thitu(tlev, dam, objp, name)
-int tlev, dam;
-struct obj **objp;
-const char *name; /* if null, then format `*objp' */
+thitu(
+ int tlev,
+ int dam,
+ struct obj **objp,
+ const char *name) /* if null, then format `*objp' */
{
struct obj *obj = objp ? *objp : 0;
const char *onm, *knm;
* Returns 0 if object still exists (not destroyed).
*/
static int
-drop_throw(obj, ohit, x, y)
-register struct obj *obj;
-boolean ohit;
-int x, y;
+drop_throw(
+ register struct obj *obj,
+ boolean ohit,
+ int x,
+ int y)
{
int retvalu = 1;
int create;
/* calculate multishot volley count for mtmp throwing otmp (if not ammo) or
shooting otmp with mwep (if otmp is ammo and mwep appropriate launcher) */
static int
-monmulti(mtmp, otmp, mwep)
-struct monst *mtmp;
-struct obj *otmp, *mwep;
+monmulti(struct monst* mtmp, struct obj* otmp, struct obj* mwep)
{
int multishot = 1;
/* mtmp throws otmp, or shoots otmp with mwep, at hero or at monster mtarg */
static void
-monshoot(mtmp, otmp, mwep)
-struct monst *mtmp;
-struct obj *otmp, *mwep;
+monshoot(struct monst* mtmp, struct obj* otmp, struct obj* mwep)
{
struct monst *mtarg = g.mtarget;
int dm = distmin(mtmp->mx, mtmp->my,
/* an object launched by someone/thing other than player attacks a monster;
return 1 if the object has stopped moving (hit or its range used up) */
int
-ohitmon(mtmp, otmp, range, verbose)
-struct monst *mtmp; /* accidental target, located at <g.bhitpos.x,.y> */
-struct obj *otmp; /* missile; might be destroyed by drop_throw */
-int range; /* how much farther will object travel if it misses;
- use -1 to signify to keep going even after hit,
- unless it's gone (used for rolling_boulder_traps) */
-boolean verbose; /* give message(s) even when you can't see what happened */
+ohitmon(
+ struct monst *mtmp, /* accidental target, located at <g.bhitpos.x,.y> */
+ struct obj *otmp, /* missile; might be destroyed by drop_throw */
+ int range, /* how much farther will object travel if it misses;
+ use -1 to signify to keep going even after hit,
+ unless it's gone (used for rolling_boulder_traps) */
+ boolean verbose)/* give message(s) even when you can't see what happened */
{
int damage, tmp;
boolean vis, ismimic;
|| (!(pre) && IS_SINK(levl[g.bhitpos.x][g.bhitpos.y].typ)))
void
-m_throw(mon, x, y, dx, dy, range, obj)
-struct monst *mon; /* launching monster */
-int x, y, dx, dy, range; /* launch point, direction, and range */
-struct obj *obj; /* missile (or stack providing it) */
+m_throw(
+ struct monst *mon, /* launching monster */
+ int x,
+ int y,
+ int dx,
+ int dy,
+ int range, /* launch point, direction, and range */
+ struct obj *obj) /* missile (or stack providing it) */
{
struct monst *mtmp;
struct obj *singleobj;
/* Monster throws item at another monster */
int
-thrwmm(mtmp, mtarg)
-struct monst *mtmp, *mtarg;
+thrwmm(struct monst* mtmp, struct monst* mtarg)
{
struct obj *otmp, *mwep;
register xchar x, y;
/* monster spits substance at monster */
int
-spitmm(mtmp, mattk, mtarg)
-struct monst *mtmp, *mtarg;
-struct attack *mattk;
+spitmm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
{
struct obj *otmp;
/* monster breathes at monster (ranged) */
int
-breamm(mtmp, mattk, mtarg)
-struct monst *mtmp, *mtarg;
-struct attack *mattk;
+breamm(struct monst* mtmp, struct attack* mattk, struct monst* mtarg)
{
/* if new breath types are added, change AD_ACID to max type */
int typ = (mattk->adtyp == AD_RBRE) ? rnd(AD_ACID) : mattk->adtyp ;
/* remove an entire item from a monster's inventory; destroy that item */
void
-m_useupall(mon, obj)
-struct monst *mon;
-struct obj *obj;
+m_useupall(struct monst* mon, struct obj* obj)
{
obj_extract_self(obj);
if (obj->owornmask) {
/* remove one instance of an item from a monster's inventory */
void
-m_useup(mon, obj)
-struct monst *mon;
-struct obj *obj;
+m_useup(struct monst* mon, struct obj* obj)
{
if (obj->quan > 1L) {
obj->quan--;
/* monster attempts ranged weapon attack against player */
void
-thrwmu(mtmp)
-struct monst *mtmp;
+thrwmu(struct monst* mtmp)
{
struct obj *otmp, *mwep;
xchar x, y;
/* monster spits substance at you */
int
-spitmu(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+spitmu(struct monst* mtmp, struct attack* mattk)
{
return spitmm(mtmp, mattk, &g.youmonst);
}
/* monster breathes at you (ranged) */
int
-breamu(mtmp, mattk)
-struct monst *mtmp;
-struct attack *mattk;
+breamu(struct monst* mtmp, struct attack* mattk)
{
return breamm(mtmp, mattk, &g.youmonst);
}
Stops if fnc return TRUE, or if step was blocked by wall or closed door.
Returns TRUE if fnc returned TRUE. */
boolean
-linedup_callback(ax, ay, bx, by, fnc)
-xchar ax, ay, bx, by;
-boolean FDECL((*fnc), (int, int));
+linedup_callback(
+ xchar ax,
+ xchar ay,
+ xchar bx,
+ xchar by,
+ boolean (*fnc)(int, int))
{
int dx, dy;
}
boolean
-linedup(ax, ay, bx, by, boulderhandling)
-register xchar ax, ay, bx, by;
-int boulderhandling; /* 0=block, 1=ignore, 2=conditionally block */
+linedup(
+ register xchar ax,
+ register xchar ay,
+ register xchar bx,
+ register xchar by,
+ int boulderhandling) /* 0=block, 1=ignore, 2=conditionally block */
{
int dx, dy, boulderspots;
}
static int
-m_lined_up(mtarg, mtmp)
-struct monst *mtarg, *mtmp;
+m_lined_up(struct monst* mtarg, struct monst* mtmp)
{
boolean utarget = (mtarg == &g.youmonst);
xchar tx = utarget ? mtmp->mux : mtarg->mx;
/* is mtmp in position to use ranged attack on hero? */
boolean
-lined_up(mtmp)
-register struct monst *mtmp;
+lined_up(register struct monst* mtmp)
{
return m_lined_up(&g.youmonst, mtmp) ? TRUE : FALSE;
}
/* check if a monster is carrying a particular item */
struct obj *
-m_carrying(mtmp, type)
-struct monst *mtmp;
-int type;
+m_carrying(struct monst* mtmp, int type)
{
register struct obj *otmp;
}
void
-hit_bars(objp, objx, objy, barsx, barsy, your_fault, from_invent)
-struct obj **objp; /* *objp will be set to NULL if object breaks */
-int objx, objy, barsx, barsy;
-boolean your_fault, from_invent;
+hit_bars(
+ struct obj **objp, /* *objp will be set to NULL if object breaks */
+ int objx, int objy, int barsx, int barsy,
+ boolean your_fault, boolean from_invent)
{
struct obj *otmp = *objp;
int obj_type = otmp->otyp;
/* TRUE iff thrown/kicked/rolled object doesn't pass through iron bars */
boolean
-hits_bars(obj_p, x, y, barsx, barsy, always_hit, whodidit)
-struct obj **obj_p; /* *obj_p will be set to NULL if object breaks */
-int x, y, barsx, barsy;
-int always_hit; /* caller can force a hit for items which would fit through */
-int whodidit; /* 1==hero, 0=other, -1==just check whether it'll pass thru */
+hits_bars(
+ struct obj **obj_p, /* *obj_p will be set to NULL if object breaks */
+ int x, int y, int barsx, int barsy,
+ int always_hit, /* caller can force a hit for items which would fit through */
+ int whodidit) /* 1==hero, 0=other, -1==just check whether it'll pass thru */
{
struct obj *otmp = *obj_p;
int obj_type = otmp->otyp;
* are confused don't know not to read scrolls, etc....
*/
-static int FDECL(precheck, (struct monst *, struct obj *));
-static void FDECL(mzapwand, (struct monst *, struct obj *, BOOLEAN_P));
-static void FDECL(mplayhorn, (struct monst *, struct obj *, BOOLEAN_P));
-static void FDECL(mreadmsg, (struct monst *, struct obj *));
-static void FDECL(mquaffmsg, (struct monst *, struct obj *));
-static boolean FDECL(m_use_healing, (struct monst *));
-static boolean FDECL(linedup_chk_corpse, (int, int));
-static void FDECL(m_use_undead_turning, (struct monst *, struct obj *));
-static int FDECL(mbhitm, (struct monst *, struct obj *));
-static void FDECL(mbhit, (struct monst *, int,
- int FDECL((*), (MONST_P, OBJ_P)),
- int FDECL((*), (OBJ_P, OBJ_P)), struct obj *));
-static struct permonst *FDECL(muse_newcham_mon, (struct monst *));
-static int FDECL(mloot_container, (struct monst *mon, struct obj *,
- BOOLEAN_P));
-static void FDECL(you_aggravate, (struct monst *));
+static int precheck(struct monst *, struct obj *);
+static void mzapwand(struct monst *, struct obj *, boolean);
+static void mplayhorn(struct monst *, struct obj *, boolean);
+static void mreadmsg(struct monst *, struct obj *);
+static void mquaffmsg(struct monst *, struct obj *);
+static boolean m_use_healing(struct monst *);
+static boolean linedup_chk_corpse(int, int);
+static void m_use_undead_turning(struct monst *, struct obj *);
+static int mbhitm(struct monst *, struct obj *);
+static void mbhit(struct monst *, int, int (*)(MONST_P, OBJ_P),
+ int (*)(OBJ_P, OBJ_P), struct obj *);
+static struct permonst *muse_newcham_mon(struct monst *);
+static int mloot_container(struct monst *mon, struct obj *, boolean);
+static void you_aggravate(struct monst *);
#if 0
-static boolean FDECL(necrophiliac, (struct obj *, BOOLEAN_P));
+static boolean necrophiliac(struct obj *, boolean);
#endif
-static void FDECL(mon_consume_unstone, (struct monst *, struct obj *,
- BOOLEAN_P, BOOLEAN_P));
-static boolean FDECL(cures_stoning, (struct monst *, struct obj *,
- BOOLEAN_P));
-static boolean FDECL(mcould_eat_tin, (struct monst *));
-static boolean FDECL(muse_unslime, (struct monst *, struct obj *,
- struct trap *, BOOLEAN_P));
-static int FDECL(cures_sliming, (struct monst *, struct obj *));
-static boolean FDECL(green_mon, (struct monst *));
+static void mon_consume_unstone(struct monst *, struct obj *, boolean,
+ boolean);
+static boolean cures_stoning(struct monst *, struct obj *, boolean);
+static boolean mcould_eat_tin(struct monst *);
+static boolean muse_unslime(struct monst *, struct obj *, struct trap *,
+ boolean);
+static int cures_sliming(struct monst *, struct obj *);
+static boolean green_mon(struct monst *);
/* Any preliminary checks which may result in the monster being unable to use
* the item. Returns 0 if nothing happened, 2 if the monster can't do
* anything (i.e. it teleported) and 1 if it's dead.
*/
static int
-precheck(mon, obj)
-struct monst *mon;
-struct obj *obj;
+precheck(struct monst* mon, struct obj* obj)
{
boolean vis;
/* when a monster zaps a wand give a message, deduct a charge, and if it
isn't directly seen, remove hero's memory of the number of charges */
static void
-mzapwand(mtmp, otmp, self)
-struct monst *mtmp;
-struct obj *otmp;
-boolean self;
+mzapwand(
+ struct monst *mtmp,
+ struct obj *otmp,
+ boolean self)
{
if (otmp->spe < 1) {
impossible("Mon zapping wand with %d charges?", otmp->spe);
/* similar to mzapwand() but for magical horns (only instrument mons play) */
static void
-mplayhorn(mtmp, otmp, self)
-struct monst *mtmp;
-struct obj *otmp;
-boolean self;
+mplayhorn(
+ struct monst *mtmp,
+ struct obj *otmp,
+ boolean self)
{
char *objnamp, objbuf[BUFSZ];
}
static void
-mreadmsg(mtmp, otmp)
-struct monst *mtmp;
-struct obj *otmp;
+mreadmsg(struct monst* mtmp, struct obj* otmp)
{
boolean vismon = canseemon(mtmp);
char onambuf[BUFSZ];
}
static void
-mquaffmsg(mtmp, otmp)
-struct monst *mtmp;
-struct obj *otmp;
+mquaffmsg(struct monst* mtmp, struct obj* otmp)
{
if (canseemon(mtmp)) {
otmp->dknown = 1;
*/
static boolean
-m_use_healing(mtmp)
-struct monst *mtmp;
+m_use_healing(struct monst* mtmp)
{
struct obj *obj = 0;
if ((obj = m_carrying(mtmp, POT_FULL_HEALING)) != 0) {
/* Select a defensive item/action for a monster. Returns TRUE iff one is
found. */
boolean
-find_defensive(mtmp)
-struct monst *mtmp;
+find_defensive(struct monst* mtmp)
{
struct obj *obj;
struct trap *t;
* 2: did something and can't attack again (i.e. teleported).
*/
int
-use_defensive(mtmp)
-struct monst *mtmp;
+use_defensive(struct monst* mtmp)
{
int i, fleetim, how = 0;
struct obj *otmp = g.m.defensive;
}
int
-rnd_defensive_item(mtmp)
-struct monst *mtmp;
+rnd_defensive_item(struct monst* mtmp)
{
struct permonst *pm = mtmp->data;
int difficulty = mons[(monsndx(pm))].difficulty;
* redefine; nonconsecutive value is ok */
static boolean
-linedup_chk_corpse(x, y)
-int x, y;
+linedup_chk_corpse(int x, int y)
{
return (sobj_at(CORPSE, x, y) != 0);
}
static void
-m_use_undead_turning(mtmp, obj)
-struct monst *mtmp;
-struct obj *obj;
+m_use_undead_turning(struct monst* mtmp, struct obj* obj)
{
int ax = u.ux + sgn(mtmp->mux - mtmp->mx) * 3,
ay = u.uy + sgn(mtmp->muy - mtmp->my) * 3;
* found.
*/
boolean
-find_offensive(mtmp)
-struct monst *mtmp;
+find_offensive(struct monst* mtmp)
{
register struct obj *obj;
boolean reflection_skip = (Reflecting && rn2(2));
static
int
-mbhitm(mtmp, otmp)
-register struct monst *mtmp;
-register struct obj *otmp;
+mbhitm(register struct monst* mtmp, register struct obj* otmp)
{
int tmp;
boolean reveal_invis = FALSE, hits_you = (mtmp == &g.youmonst);
* to merge the two functions...)
*/
static void
-mbhit(mon, range, fhitm, fhito, obj)
-struct monst *mon; /* monster shooting the wand */
-register int range; /* direction and range */
-int FDECL((*fhitm), (MONST_P, OBJ_P));
-int FDECL((*fhito), (OBJ_P, OBJ_P)); /* fns called when mon/obj hit */
-struct obj *obj; /* 2nd arg to fhitm/fhito */
+mbhit(
+ struct monst *mon, /* monster shooting the wand */
+ register int range, /* direction and range */
+ int (*fhitm)(MONST_P, OBJ_P),
+ int (*fhito)(OBJ_P, OBJ_P), /* fns called when mon/obj hit */
+ struct obj *obj) /* 2nd arg to fhitm/fhito */
{
register struct monst *mtmp;
register struct obj *otmp;
* after find_offensive(). Return values are same as use_defensive().
*/
int
-use_offensive(mtmp)
-struct monst *mtmp;
+use_offensive(struct monst* mtmp)
{
int i;
struct obj *otmp = g.m.offensive;
}
int
-rnd_offensive_item(mtmp)
-struct monst *mtmp;
+rnd_offensive_item(struct monst* mtmp)
{
struct permonst *pm = mtmp->data;
int difficulty = mons[(monsndx(pm))].difficulty;
#define MUSE_BAG 10
boolean
-find_misc(mtmp)
-struct monst *mtmp;
+find_misc(struct monst* mtmp)
{
register struct obj *obj;
struct permonst *mdat = mtmp->data;
/* type of monster to polymorph into; defaults to one suitable for the
current level rather than the totally arbitrary choice of newcham() */
static struct permonst *
-muse_newcham_mon(mon)
-struct monst *mon;
+muse_newcham_mon(struct monst* mon)
{
struct obj *m_armr;
}
static int
-mloot_container(mon, container, vismon)
-struct monst *mon;
-struct obj *container;
-boolean vismon;
+mloot_container(
+ struct monst *mon,
+ struct obj *container,
+ boolean vismon)
{
char contnr_nam[BUFSZ], mpronounbuf[20];
boolean nearby;
}
int
-use_misc(mtmp)
-struct monst *mtmp;
+use_misc(struct monst* mtmp)
{
int i;
struct obj *otmp = g.m.misc;
}
static void
-you_aggravate(mtmp)
-struct monst *mtmp;
+you_aggravate(struct monst* mtmp)
{
pline("For some reason, %s presence is known to you.",
s_suffix(noit_mon_nam(mtmp)));
}
int
-rnd_misc_item(mtmp)
-struct monst *mtmp;
+rnd_misc_item(struct monst* mtmp)
{
struct permonst *pm = mtmp->data;
int difficulty = mons[(monsndx(pm))].difficulty;
#if 0
/* check whether hero is carrying a corpse or contained petrifier corpse */
static boolean
-necrophiliac(objlist, any_corpse)
-struct obj *objlist;
-boolean any_corpse;
+necrophiliac(struct obj* objlist, boolean any_corpse)
{
while (objlist) {
if (objlist->otyp == CORPSE
#endif
boolean
-searches_for_item(mon, obj)
-struct monst *mon;
-struct obj *obj;
+searches_for_item(struct monst* mon, struct obj* obj)
{
int typ = obj->otyp;
}
boolean
-mon_reflects(mon, str)
-struct monst *mon;
-const char *str;
+mon_reflects(struct monst* mon, const char* str)
{
struct obj *orefl = which_armor(mon, W_ARMS);
}
boolean
-ureflects(fmt, str)
-const char *fmt, *str;
+ureflects(const char* fmt, const char* str)
{
/* Check from outermost to innermost objects */
if (EReflecting & W_ARMS) {
/* cure mon's blindness (use_defensive, dog_eat, meatobj) */
void
-mcureblindness(mon, verbos)
-struct monst *mon;
-boolean verbos;
+mcureblindness(struct monst* mon, boolean verbos)
{
if (!mon->mcansee) {
mon->mcansee = 1;
/* TRUE if the monster ate something */
boolean
-munstone(mon, by_you)
-struct monst *mon;
-boolean by_you;
+munstone(struct monst* mon, boolean by_you)
{
struct obj *obj;
boolean tinok;
}
static void
-mon_consume_unstone(mon, obj, by_you, stoning)
-struct monst *mon;
-struct obj *obj;
-boolean by_you;
-boolean stoning; /* True: stop petrification, False: cure stun && confusion */
+mon_consume_unstone(
+ struct monst *mon,
+ struct obj *obj,
+ boolean by_you,
+ boolean stoning) /* True: stop petrification, False: cure stun && confusion */
{
boolean vis = canseemon(mon), tinned = obj->otyp == TIN,
food = obj->otyp == CORPSE || tinned,
/* decide whether obj can cure petrification; also used when picking up */
static boolean
-cures_stoning(mon, obj, tinok)
-struct monst *mon;
-struct obj *obj;
-boolean tinok;
+cures_stoning(struct monst* mon, struct obj* obj, boolean tinok)
{
if (obj->otyp == POT_ACID)
return TRUE;
}
static boolean
-mcould_eat_tin(mon)
-struct monst *mon;
+mcould_eat_tin(struct monst* mon)
{
struct obj *obj, *mwep;
boolean welded_wep;
/* TRUE if monster does something to avoid turning into green slime */
boolean
-munslime(mon, by_you)
-struct monst *mon;
-boolean by_you;
+munslime(struct monst* mon, boolean by_you)
{
struct obj *obj, odummy;
struct permonst *mptr = mon->data;
/* mon uses an item--selected by caller--to burn away incipient slime */
static boolean
-muse_unslime(mon, obj, trap, by_you)
-struct monst *mon;
-struct obj *obj;
-struct trap *trap;
-boolean by_you; /* true: if mon kills itself, hero gets credit/blame */
-{ /* [by_you not honored if 'mon' triggers fire trap]. */
+muse_unslime(
+ struct monst *mon,
+ struct obj *obj,
+ struct trap *trap,
+ boolean by_you) /* true: if mon kills itself, hero gets credit/blame */
+{ /* [by_you not honored if 'mon' triggers fire trap]. */
struct obj *odummyp;
int otyp = obj->otyp, dmg = 0;
boolean vis = canseemon(mon), res = TRUE;
/* decide whether obj can be used to cure green slime */
static int
-cures_sliming(mon, obj)
-struct monst *mon;
-struct obj *obj;
+cures_sliming(struct monst* mon, struct obj* obj)
{
/* scroll of fire, non-empty wand or horn of fire */
if (obj->otyp == SCR_FIRE)
the display color, otherwise we just pick things that seem plausibly
green (which doesn't necessarily match the TEXTCOLOR categorization) */
static boolean
-green_mon(mon)
-struct monst *mon;
+green_mon(struct monst* mon)
{
struct permonst *ptr = mon->data;
#include "hack.h"
-static void FDECL(awaken_monsters, (int));
-static void FDECL(put_monsters_to_sleep, (int));
-static void FDECL(charm_snakes, (int));
-static void FDECL(calm_nymphs, (int));
-static void FDECL(charm_monsters, (int));
-static void FDECL(do_earthquake, (int));
-static const char *NDECL(generic_lvl_desc);
-static int FDECL(do_improvisation, (struct obj *));
+static void awaken_monsters(int);
+static void put_monsters_to_sleep(int);
+static void charm_snakes(int);
+static void calm_nymphs(int);
+static void charm_monsters(int);
+static void do_earthquake(int);
+static const char *generic_lvl_desc(void);
+static int do_improvisation(struct obj *);
/*
* Wake every monster in range...
*/
static void
-awaken_monsters(distance)
-int distance;
+awaken_monsters(int distance)
{
register struct monst *mtmp;
register int distm;
*/
static void
-put_monsters_to_sleep(distance)
-int distance;
+put_monsters_to_sleep(int distance)
{
register struct monst *mtmp;
*/
static void
-charm_snakes(distance)
-int distance;
+charm_snakes(int distance)
{
register struct monst *mtmp;
int could_see_mon, was_peaceful;
*/
static void
-calm_nymphs(distance)
-int distance;
+calm_nymphs(int distance)
{
register struct monst *mtmp;
/* Awake soldiers anywhere the level (and any nearby monster). */
void
-awaken_soldiers(bugler)
-struct monst *bugler; /* monster that played instrument */
+awaken_soldiers(struct monst* bugler /* monster that played instrument */)
{
register struct monst *mtmp;
int distance, distm;
* If swallowed, range is reduced to 0.
*/
static void
-charm_monsters(distance)
-int distance;
+charm_monsters(int distance)
{
struct monst *mtmp, *mtmp2;
* That is: create random chasms (pits).
*/
static void
-do_earthquake(force)
-int force;
+do_earthquake(int force)
{
static const char into_a_chasm[] = " into a chasm";
register int x, y;
}
static const char *
-generic_lvl_desc()
+generic_lvl_desc(void)
{
if (Is_astralevel(&u.uz))
return "astral plane";
* The player is trying to extract something from his/her instrument.
*/
static int
-do_improvisation(instr)
-struct obj *instr;
+do_improvisation(struct obj* instr)
{
int damage, mode, do_spec = !(Stunned || Confusion);
struct obj itmp;
* So you want music...
*/
int
-do_play_instrument(instr)
-struct obj *instr;
+do_play_instrument(struct obj* instr)
{
char buf[BUFSZ] = DUMMY, c = 'y';
char *s;
struct obj *obj;
};
-static struct _lua_obj *FDECL(l_obj_check, (lua_State *, int));
-static int FDECL(l_obj_add_to_container, (lua_State *));
-static int FDECL(l_obj_gc, (lua_State *));
-static int FDECL(l_obj_getcontents, (lua_State *));
-static int FDECL(l_obj_isnull, (lua_State *));
-static int FDECL(l_obj_new_readobjnam, (lua_State *));
-static int FDECL(l_obj_nextobj, (lua_State *));
-static int FDECL(l_obj_objects_to_table, (lua_State *));
-static int FDECL(l_obj_placeobj, (lua_State *));
-static int FDECL(l_obj_to_table, (lua_State *));
-static int FDECL(l_obj_at, (lua_State *));
-static int FDECL(l_obj_container, (lua_State *));
+static struct _lua_obj *l_obj_check(lua_State *, int);
+static int l_obj_add_to_container(lua_State *);
+static int l_obj_gc(lua_State *);
+static int l_obj_getcontents(lua_State *);
+static int l_obj_isnull(lua_State *);
+static int l_obj_new_readobjnam(lua_State *);
+static int l_obj_nextobj(lua_State *);
+static int l_obj_objects_to_table(lua_State *);
+static int l_obj_placeobj(lua_State *);
+static int l_obj_to_table(lua_State *);
+static int l_obj_at(lua_State *);
+static int l_obj_container(lua_State *);
#define lobj_is_ok(lo) ((lo) && (lo)->obj && (lo)->obj->where != OBJ_LUAFREE)
static struct _lua_obj *
-l_obj_check(L, index)
-lua_State *L;
-int index;
+l_obj_check(lua_State *L, int index)
{
struct _lua_obj *lo;
}
static int
-l_obj_gc(L)
-lua_State *L;
+l_obj_gc(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
}
static struct _lua_obj *
-l_obj_push(L, otmp)
-lua_State *L;
-struct obj *otmp;
+l_obj_push(lua_State *L, struct obj *otmp)
{
struct _lua_obj *lo = (struct _lua_obj *)lua_newuserdata(L, sizeof(struct _lua_obj));
luaL_getmetatable(L, "obj");
}
void
-nhl_push_obj(L, otmp)
-lua_State *L;
-struct obj *otmp;
+nhl_push_obj(lua_State *L, struct obj *otmp)
{
(void) l_obj_push(L, otmp);
}
/* local o = obj.new("large chest");
local cobj = o:contents(); */
static int
-l_obj_getcontents(L)
-lua_State *L;
+l_obj_getcontents(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
struct obj *obj = lo->obj;
box.addcontent(obj.new("rock"));
*/
static int
-l_obj_add_to_container(L)
-lua_State *L;
+l_obj_add_to_container(lua_State *L)
{
struct _lua_obj *lobox = l_obj_check(L, 1);
struct _lua_obj *lo = l_obj_check(L, 2);
/* Put object into player's inventory */
/* u.giveobj(obj.new("rock")); */
int
-nhl_obj_u_giveobj(L)
-lua_State *L;
+nhl_obj_u_giveobj(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
struct obj *otmp;
/* local odata = obj.class(obj.new("rock")); */
/* local odata = o:class(); */
static int
-l_obj_objects_to_table(L)
-lua_State *L;
+l_obj_objects_to_table(lua_State *L)
{
int argc = lua_gettop(L);
int otyp = -1;
local o = obj.new("rock");
local otbl = o:totable(); */
static int
-l_obj_to_table(L)
-lua_State *L;
+l_obj_to_table(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
struct obj *obj = lo->obj;
/* create a new object via wishing routine */
/* local o = obj.new("rock"); */
static int
-l_obj_new_readobjnam(L)
-lua_State *L;
+l_obj_new_readobjnam(lua_State *L)
{
int argc = lua_gettop(L);
/* Get the topmost object on the map at x,y */
/* local o = obj.at(x, y); */
static int
-l_obj_at(L)
-lua_State *L;
+l_obj_at(lua_State *L)
{
int argc = lua_gettop(L);
local o = obj.new("rock");
o:placeobj(u.ux, u.uy); */
static int
-l_obj_placeobj(L)
-lua_State *L;
+l_obj_placeobj(lua_State *L)
{
int argc = lua_gettop(L);
struct _lua_obj *lo = l_obj_check(L, 1);
local o2 = o:next();
*/
static int
-l_obj_nextobj(L)
-lua_State *L;
+l_obj_nextobj(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
/* Get the container object is in */
/* local box = o:container(); */
static int
-l_obj_container(L)
-lua_State *L;
+l_obj_container(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
/* Is the object a null? */
/* local badobj = o:isnull(); */
static int
-l_obj_isnull(L)
-lua_State *L;
+l_obj_isnull(lua_State *L)
{
struct _lua_obj *lo = l_obj_check(L, 1);
};
int
-l_obj_register(L)
-lua_State *L;
+l_obj_register(lua_State *L)
{
int lib_id, meta_id;
#include "sp_lev.h"
/* lua_CFunction prototypes */
-static int FDECL(l_selection_new, (lua_State *));
-static int FDECL(l_selection_clone, (lua_State *));
-static int FDECL(l_selection_getpoint, (lua_State *));
-static int FDECL(l_selection_setpoint, (lua_State *));
-static int FDECL(l_selection_not, (lua_State *));
-static int FDECL(l_selection_filter_percent, (lua_State *));
-static int FDECL(l_selection_rndcoord, (lua_State *));
-static boolean FDECL(params_sel_2coords, (lua_State *, struct selectionvar **,
- xchar *, xchar *, xchar *, xchar *));
-static int FDECL(l_selection_line, (lua_State *));
-static int FDECL(l_selection_randline, (lua_State *));
-static int FDECL(l_selection_rect, (lua_State *));
-static int FDECL(l_selection_fillrect, (lua_State *));
-static int FDECL(l_selection_grow, (lua_State *));
-static int FDECL(l_selection_filter_mapchar, (lua_State *));
-static int FDECL(l_selection_match, (lua_State *));
-static int FDECL(l_selection_flood, (lua_State *));
-static int FDECL(l_selection_circle, (lua_State *));
-static int FDECL(l_selection_ellipse, (lua_State *));
-static int FDECL(l_selection_gradient, (lua_State *));
-static int FDECL(l_selection_iterate, (lua_State *));
-static int FDECL(l_selection_gc, (lua_State *));
-static int FDECL(l_selection_not, (lua_State *));
-static int FDECL(l_selection_and, (lua_State *));
-static int FDECL(l_selection_or, (lua_State *));
-static int FDECL(l_selection_xor, (lua_State *));
-static int FDECL(l_selection_not, (lua_State *));
+static int l_selection_new(lua_State *);
+static int l_selection_clone(lua_State *);
+static int l_selection_getpoint(lua_State *);
+static int l_selection_setpoint(lua_State *);
+static int l_selection_not(lua_State *);
+static int l_selection_filter_percent(lua_State *);
+static int l_selection_rndcoord(lua_State *);
+static boolean params_sel_2coords(lua_State *, struct selectionvar **,
+ xchar *, xchar *, xchar *, xchar *);
+static int l_selection_line(lua_State *);
+static int l_selection_randline(lua_State *);
+static int l_selection_rect(lua_State *);
+static int l_selection_fillrect(lua_State *);
+static int l_selection_grow(lua_State *);
+static int l_selection_filter_mapchar(lua_State *);
+static int l_selection_match(lua_State *);
+static int l_selection_flood(lua_State *);
+static int l_selection_circle(lua_State *);
+static int l_selection_ellipse(lua_State *);
+static int l_selection_gradient(lua_State *);
+static int l_selection_iterate(lua_State *);
+static int l_selection_gc(lua_State *);
+static int l_selection_not(lua_State *);
+static int l_selection_and(lua_State *);
+static int l_selection_or(lua_State *);
+static int l_selection_xor(lua_State *);
+static int l_selection_not(lua_State *);
#if 0
/* the following do not appear to currently be
used and because they are static, the OSX
if ifdef'd out the prototype here and the
function body below.
*/
-static int FDECL(l_selection_add, (lua_State *));
-static int FDECL(l_selection_sub, (lua_State *));
-static int FDECL(l_selection_ipairs, (lua_State *));
-static struct selectionvar *FDECL(l_selection_to, (lua_State *, int));
+static int l_selection_add(lua_State *);
+static int l_selection_sub(lua_State *);
+static int l_selection_ipairs(lua_State *);
+static struct selectionvar *l_selection_to(lua_State *, int);
#endif
struct selectionvar *
-l_selection_check(L, index)
-lua_State *L;
-int index;
+l_selection_check(lua_State *L, int index)
{
struct selectionvar *sel;
}
static int
-l_selection_gc(L)
-lua_State *L;
+l_selection_gc(lua_State *L)
{
struct selectionvar *sel = l_selection_check(L, 1);
#if 0
static struct selectionvar *
-l_selection_to(L, index)
-lua_State *L;
-int index;
+l_selection_to(lua_State *L, int index)
{
struct selectionvar *sel = (struct selectionvar *)lua_touserdata(L, index);
#endif
static struct selectionvar *
-l_selection_push(L)
-lua_State *L;
+l_selection_push(lua_State *L)
{
struct selectionvar *tmp = selection_new();
struct selectionvar
/* local sel = selection.new(); */
static int
-l_selection_new(L)
-lua_State *L;
+l_selection_new(lua_State *L)
{
(void) l_selection_push(L);
return 1;
/* Replace the topmost selection in the stack with a clone of it. */
/* local sel = selection.clone(sel); */
static int
-l_selection_clone(L)
-lua_State *L;
+l_selection_clone(lua_State *L)
{
struct selectionvar *sel = l_selection_check(L, 1);
struct selectionvar *tmp;
/* local sel = selection.set(sel); */
/* TODO: allow setting multiple coordinates at once: set({x,y}, {x,y}, ...); */
static int
-l_selection_setpoint(L)
-lua_State *L;
+l_selection_setpoint(lua_State *L)
{
struct selectionvar *sel = (struct selectionvar *) 0;
xchar x = -1, y = -1;
/* local value = selection.get(sel, x, y); */
static int
-l_selection_getpoint(L)
-lua_State *L;
+l_selection_getpoint(lua_State *L)
{
struct selectionvar *sel = l_selection_check(L, 1);
xchar x = (xchar) luaL_checkinteger(L, 2);
/* local s = selection.negate(); */
/* local s = sel:negate(); */
static int
-l_selection_not(L)
-lua_State *L;
+l_selection_not(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel, *sel2;
/* local sel = selection.area(4,5, 40,10) & selection.rect(7,8, 60,14); */
static int
-l_selection_and(L)
-lua_State *L;
+l_selection_and(lua_State *L)
{
int x,y;
struct selectionvar *sela = l_selection_check(L, 1);
/* local sel = selection.area(4,5, 40,10) | selection.rect(7,8, 60,14); */
static int
-l_selection_or(L)
-lua_State *L;
+l_selection_or(lua_State *L)
{
int x,y;
struct selectionvar *sela = l_selection_check(L, 1);
/* local sel = selection.area(4,5, 40,10) ~ selection.rect(7,8, 60,14); */
static int
-l_selection_xor(L)
-lua_State *L;
+l_selection_xor(lua_State *L)
{
int x,y;
struct selectionvar *sela = l_selection_check(L, 1);
/* local s = selection.percentage(sel, 50); */
static int
-l_selection_filter_percent(L)
-lua_State *L;
+l_selection_filter_percent(lua_State *L)
{
struct selectionvar *ret;
int p;
/* local x,y = selection.rndcoord(sel); */
/* local x,y = selection.rndcoord(sel, 1); */
static int
-l_selection_rndcoord(L)
-lua_State *L;
+l_selection_rndcoord(lua_State *L)
{
struct selectionvar *sel = l_selection_check(L, 1);
int removeit = (int) luaL_optinteger(L, 2, 0);
/* function(selection, x1,y1, x2,y2) */
/* selection:function(x1,y1, x2,y2) */
static boolean
-params_sel_2coords(L, sel, x1,y1, x2,y2)
-lua_State *L;
-struct selectionvar **sel;
-xchar *x1, *y1, *x2, *y2;
+params_sel_2coords(lua_State *L, struct selectionvar **sel,
+ xchar *x1, xchar *y1, xchar *x2, xchar *y2)
{
int argc = lua_gettop(L);
/* local s = selection.line(x1,y1, x2,y2); */
/* s:line(x1,y1, x2,y2); */
static int
-l_selection_line(L)
-lua_State *L;
+l_selection_line(lua_State *L)
{
struct selectionvar *sel = NULL;
xchar x1, y1, x2, y2;
/* local s = selection.rect(sel, x1,y1, x2,y2); */
static int
-l_selection_rect(L)
-lua_State *L;
+l_selection_rect(lua_State *L)
{
struct selectionvar *sel = NULL;
xchar x1, y1, x2, y2;
/* s:fillrect(x1,y1, x2,y2); */
/* selection.area(x1,y1, x2,y2); */
static int
-l_selection_fillrect(L)
-lua_State *L;
+l_selection_fillrect(lua_State *L)
{
struct selectionvar *sel = NULL;
int y;
/* TODO: selection.randline(x1,y1, x2,y2, roughness); */
/* TODO: selection.randline({x1,y1}, {x2,y2}, roughness); */
static int
-l_selection_randline(L)
-lua_State *L;
+l_selection_randline(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* local s = selection.grow(sel); */
/* local s = selection.grow(sel, "north"); */
static int
-l_selection_grow(L)
-lua_State *L;
+l_selection_grow(lua_State *L)
{
int argc = lua_gettop(L);
const char *const growdirs[] = { "all", "random", "north", "west", "east", "south", NULL };
/* local s = selection.filter_mapchar(sel, mapchar, lit); */
static int
-l_selection_filter_mapchar(L)
-lua_State *L;
+l_selection_filter_mapchar(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = l_selection_check(L, 1);
/* local s = selection.match([[...]]); */
static int
-l_selection_match(L)
-lua_State *L;
+l_selection_match(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* local s = selection.floodfill(x,y); */
static int
-l_selection_flood(L)
-lua_State *L;
+l_selection_flood(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* local s = selection.circle(sel, x, y, radius); */
/* local s = selection.circle(sel, x, y, radius, filled); */
static int
-l_selection_circle(L)
-lua_State *L;
+l_selection_circle(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* local s = selection.ellipse(sel, x, y, radius1, radius2); */
/* local s = selection.ellipse(sel, x, y, radius1, radius2, filled); */
static int
-l_selection_ellipse(L)
-lua_State *L;
+l_selection_ellipse(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* selection.gradient({ type = "radial", x = 3, y = 5, x2 = 10, y2 = 12,
* mindist = 4, maxdist = 10, limited = false }); */
static int
-l_selection_gradient(L)
-lua_State *L;
+l_selection_gradient(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
/* if limited is true, no points farther than maxdist will be added; if
* false, all points farther than maxdist will be added */
boolean limited = FALSE;
- long type;
+ long type = 0;
static const char *const gradtypes[] = {
"radial", "square", NULL
};
/* sel:iterate(function(x,y) ... end); */
static int
-l_selection_iterate(L)
-lua_State *L;
+l_selection_iterate(lua_State *L)
{
int argc = lua_gettop(L);
struct selectionvar *sel = (struct selectionvar *) 0;
};
int
-l_selection_register(L)
-lua_State *L;
+l_selection_register(lua_State *L)
{
int lib_id, meta_id;
/* */
/* lua_CFunction prototypes */
-static int FDECL(nhl_test, (lua_State *));
-static int FDECL(nhl_getmap, (lua_State *));
-static void FDECL(nhl_add_table_entry_bool, (lua_State *, const char *, BOOLEAN_P));
-static char FDECL(splev_typ2chr, (SCHAR_P));
-static int FDECL(nhl_gettrap, (lua_State *));
-static int FDECL(nhl_deltrap, (lua_State *));
+static int nhl_test(lua_State *);
+static int nhl_getmap(lua_State *);
+static void nhl_add_table_entry_bool(lua_State *, const char *, boolean);
+static char splev_typ2chr(schar);
+static int nhl_gettrap(lua_State *);
+static int nhl_deltrap(lua_State *);
#if 0
-static int FDECL(nhl_setmap, (lua_State *));
+static int nhl_setmap(lua_State *);
#endif
-static int FDECL(nhl_pline, (lua_State *));
-static int FDECL(nhl_verbalize, (lua_State *));
-static int FDECL(nhl_menu, (lua_State *));
-static int FDECL(nhl_getlin, (lua_State *));
-static int FDECL(nhl_makeplural, (lua_State *));
-static int FDECL(nhl_makesingular, (lua_State *));
-static int FDECL(nhl_s_suffix, (lua_State *));
-static int FDECL(nhl_ing_suffix, (lua_State *));
-static int FDECL(nhl_an, (lua_State *));
-static int FDECL(nhl_rn2, (lua_State *));
-static int FDECL(nhl_random, (lua_State *));
-static int FDECL(nhl_level_difficulty, (lua_State *));
-static void FDECL(init_nhc_data, (lua_State *));
-static int FDECL(nhl_push_anything, (lua_State *, int, void *));
-static int FDECL(nhl_meta_u_index, (lua_State *));
-static int FDECL(nhl_meta_u_newindex, (lua_State *));
-static int FDECL(nhl_u_clear_inventory, (lua_State *));
-static int FDECL(nhl_u_giveobj, (lua_State *));
-static void FDECL(init_u_data, (lua_State *));
-static int FDECL(nhl_set_package_path, (lua_State *, const char *));
-static int FDECL(traceback_handler, (lua_State *));
+static int nhl_pline(lua_State *);
+static int nhl_verbalize(lua_State *);
+static int nhl_menu(lua_State *);
+static int nhl_getlin(lua_State *);
+static int nhl_makeplural(lua_State *);
+static int nhl_makesingular(lua_State *);
+static int nhl_s_suffix(lua_State *);
+static int nhl_ing_suffix(lua_State *);
+static int nhl_an(lua_State *);
+static int nhl_rn2(lua_State *);
+static int nhl_random(lua_State *);
+static int nhl_level_difficulty(lua_State *);
+static void init_nhc_data(lua_State *);
+static int nhl_push_anything(lua_State *, int, void *);
+static int nhl_meta_u_index(lua_State *);
+static int nhl_meta_u_newindex(lua_State *);
+static int nhl_u_clear_inventory(lua_State *);
+static int nhl_u_giveobj(lua_State *);
+static void init_u_data(lua_State *);
+static int nhl_set_package_path(lua_State *, const char *);
+static int traceback_handler(lua_State *);
void
-nhl_error(L, msg)
-lua_State *L;
-const char *msg;
+nhl_error(lua_State *L, const char *msg)
{
lua_Debug ar;
char buf[BUFSZ];
/* Check that parameters are nothing but single table,
or if no parameters given, put empty table there */
void
-lcheck_param_table(L)
-lua_State *L;
+lcheck_param_table(lua_State *L)
{
int argc = lua_gettop(L);
}
schar
-get_table_mapchr(L, name)
-lua_State *L;
-const char *name;
+get_table_mapchr(lua_State *L, const char *name)
{
char *ter;
xchar typ;
}
schar
-get_table_mapchr_opt(L, name, defval)
-lua_State *L;
-const char *name;
-schar defval;
+get_table_mapchr_opt(lua_State *L, const char *name, schar defval)
{
char *ter;
xchar typ;
}
void
-nhl_add_table_entry_int(L, name, value)
-lua_State *L;
-const char *name;
-int value;
+nhl_add_table_entry_int(lua_State *L, const char *name, int value)
{
lua_pushstring(L, name);
lua_pushinteger(L, value);
}
void
-nhl_add_table_entry_char(L, name, value)
-lua_State *L;
-const char *name;
-char value;
+nhl_add_table_entry_char(lua_State *L, const char *name, char value)
{
char buf[2];
Sprintf(buf, "%c", value);
}
void
-nhl_add_table_entry_str(L, name, value)
-lua_State *L;
-const char *name;
-const char *value;
+nhl_add_table_entry_str(lua_State *L, const char *name, const char *value)
{
lua_pushstring(L, name);
lua_pushstring(L, value);
lua_rawset(L, -3);
}
void
-nhl_add_table_entry_bool(L, name, value)
-lua_State *L;
-const char *name;
-boolean value;
+nhl_add_table_entry_bool(lua_State *L, const char *name, boolean value)
{
lua_pushstring(L, name);
lua_pushboolean(L, value);
};
schar
-splev_chr2typ(c)
-char c;
+splev_chr2typ(char c)
{
int i;
}
schar
-check_mapchr(s)
-const char *s;
+check_mapchr(const char *s)
{
if (s && strlen(s) == 1)
return splev_chr2typ(s[0]);
}
static char
-splev_typ2chr(typ)
-schar typ;
+splev_typ2chr(schar typ)
{
int i;
/* local t = gettrap(x,y); */
static int
-nhl_gettrap(L)
-lua_State *L;
+nhl_gettrap(lua_State *L)
{
int argc = lua_gettop(L);
/* deltrap(x,y); */
static int
-nhl_deltrap(L)
-lua_State *L;
+nhl_deltrap(lua_State *L)
{
int argc = lua_gettop(L);
/* local loc = getmap(x,y) */
static int
-nhl_getmap(L)
-lua_State *L;
+nhl_getmap(lua_State *L)
{
int argc = lua_gettop(L);
/* pline("It hits!") */
static int
-nhl_pline(L)
-lua_State *L;
+nhl_pline(lua_State *L)
{
int argc = lua_gettop(L);
/* verbalize("Fool!") */
static int
-nhl_verbalize(L)
-lua_State *L;
+nhl_verbalize(lua_State *L)
{
int argc = lua_gettop(L);
str = getlin("What do you want to call this dungeon level?");
*/
static int
-nhl_getlin(L)
-lua_State *L;
+nhl_getlin(lua_State *L)
{
int argc = lua_gettop(L);
selected = menu("prompt", default, pickX,
{ {key:"a", text:"option a"}, {key:"b", text:"option b"}, ... } ) */
static int
-nhl_menu(L)
-lua_State *L;
+nhl_menu(lua_State *L)
{
static const char *const pickX[] = {"none", "one", "any"}; /* PICK_x */
int argc = lua_gettop(L);
/* makeplural("zorkmid") */
static int
-nhl_makeplural(L)
-lua_State *L;
+nhl_makeplural(lua_State *L)
{
int argc = lua_gettop(L);
/* makesingular("zorkmids") */
static int
-nhl_makesingular(L)
-lua_State *L;
+nhl_makesingular(lua_State *L)
{
int argc = lua_gettop(L);
/* s_suffix("foo") */
static int
-nhl_s_suffix(L)
-lua_State *L;
+nhl_s_suffix(lua_State *L)
{
int argc = lua_gettop(L);
/* ing_suffix("foo") */
static int
-nhl_ing_suffix(L)
-lua_State *L;
+nhl_ing_suffix(lua_State *L)
{
int argc = lua_gettop(L);
/* an("foo") */
static int
-nhl_an(L)
-lua_State *L;
+nhl_an(lua_State *L)
{
int argc = lua_gettop(L);
/* rn2(10) */
static int
-nhl_rn2(L)
-lua_State *L;
+nhl_rn2(lua_State *L)
{
int argc = lua_gettop(L);
/* random(10); -- is the same as rn2(10); */
/* random(5,8); -- same as 5 + rn2(8); */
static int
-nhl_random(L)
-lua_State *L;
+nhl_random(lua_State *L)
{
int argc = lua_gettop(L);
/* level_difficulty() */
static int
-nhl_level_difficulty(L)
-lua_State *L;
+nhl_level_difficulty(lua_State *L)
{
int argc = lua_gettop(L);
if (argc == 0) {
/* get mandatory integer value from table */
int
-get_table_int(L, name)
-lua_State *L;
-const char *name;
+get_table_int(lua_State *L, const char *name)
{
int ret;
/* get optional integer value from table */
int
-get_table_int_opt(L, name, defval)
-lua_State *L;
-const char *name;
-int defval;
+get_table_int_opt(lua_State *L, const char *name, int defval)
{
int ret = defval;
}
char *
-get_table_str(L, name)
-lua_State *L;
-const char *name;
+get_table_str(lua_State *L, const char *name)
{
char *ret;
/* get optional string value from table.
return value must be freed by caller. */
char *
-get_table_str_opt(L, name, defval)
-lua_State *L;
-const char *name;
-char *defval;
+get_table_str_opt(lua_State *L, const char *name, char *defval)
{
const char *ret;
}
int
-get_table_boolean(L, name)
-lua_State *L;
-const char *name;
+get_table_boolean(lua_State *L, const char *name)
{
static const char *const boolstr[] = {
"true", "false", "yes", "no", NULL
}
int
-get_table_boolean_opt(L, name, defval)
-lua_State *L;
-const char *name;
-int defval;
+get_table_boolean_opt(lua_State *L, const char *name, int defval)
{
int ret = defval;
return ret;
}
+/* opts[] is a null-terminated list */
int
-get_table_option(L, name, defval, opts)
-lua_State *L;
-const char *name;
-const char *defval;
-const char *const opts[]; /* NULL-terminated list */
+get_table_option(lua_State *L,
+ const char *name,
+ const char *defval,
+ const char *const opts[])
{
int ret;
test( { x = 123, y = 456 } );
*/
static int
-nhl_test(L)
-lua_State *L;
+nhl_test(lua_State *L)
{
int x, y;
char *name, Player[] = "Player";
/* register and init the constants table */
static void
-init_nhc_data(L)
-lua_State *L;
+init_nhc_data(lua_State *L)
{
int i;
}
static int
-nhl_push_anything(L, anytype, src)
-lua_State *L;
-int anytype;
-void *src;
+nhl_push_anything(lua_State *L, int anytype, void *src)
{
anything any = cg.zeroany;
}
static int
-nhl_meta_u_index(L)
-lua_State *L;
+nhl_meta_u_index(lua_State *L)
{
static const struct {
const char *name;
}
static int
-nhl_meta_u_newindex(L)
-lua_State *L;
+nhl_meta_u_newindex(lua_State *L)
{
nhl_error(L, "Cannot set u table values");
return 0;
}
static int
-nhl_u_clear_inventory(L)
-lua_State *L UNUSED;
+nhl_u_clear_inventory(lua_State *L UNUSED)
{
while (g.invent)
useupall(g.invent);
/* Put object into player's inventory */
/* u.giveobj(obj.new("rock")); */
static int
-nhl_u_giveobj(L)
-lua_State *L;
+nhl_u_giveobj(lua_State *L)
{
return nhl_obj_u_giveobj(L);
}
};
static void
-init_u_data(L)
-lua_State *L;
+init_u_data(lua_State *L)
{
lua_newtable(L);
luaL_setfuncs(L, nhl_u_functions, 0);
}
static int
-nhl_set_package_path(L, path)
-lua_State *L;
-const char *path;
+nhl_set_package_path(lua_State *L, const char *path)
{
lua_getglobal(L, "package");
lua_pushstring(L, path);
}
static int
-traceback_handler(L)
-lua_State *L;
+traceback_handler(lua_State *L)
{
luaL_traceback(L, L, lua_tostring(L, 1), 0);
/* TODO: call impossible() if fuzzing? */
/* read lua code/data from a dlb module or an external file
into a string buffer and feed that to lua */
boolean
-nhl_loadlua(L, fname)
-lua_State *L;
-const char *fname;
+nhl_loadlua(lua_State *L, const char *fname)
{
#define LOADCHUNKSIZE (1L << 13) /* 8K */
boolean ret = TRUE;
}
lua_State *
-nhl_init()
+nhl_init(void)
{
lua_State *L = luaL_newstate();
}
boolean
-load_lua(name)
-const char *name;
+load_lua(const char *name)
{
boolean ret = TRUE;
lua_State *L = nhl_init();
}
const char *
-get_lua_version()
+get_lua_version(void)
{
size_t len = (size_t) 0;
const char *vs = (const char *) 0;
#include "hack.h"
-static void FDECL(setgemprobs, (d_level *));
-static void FDECL(shuffle, (int, int, BOOLEAN_P));
-static void NDECL(shuffle_all);
-static boolean FDECL(interesting_to_discover, (int));
-static int FDECL(CFDECLSPEC discovered_cmp, (const genericptr,
- const genericptr));
-static char *FDECL(oclass_to_name, (CHAR_P, char *));
+static void setgemprobs(d_level *);
+static void shuffle(int, int, boolean);
+static void shuffle_all(void);
+static boolean interesting_to_discover(int);
+static int CFDECLSPEC discovered_cmp(const genericptr, const genericptr);
+static char *oclass_to_name(char, char *);
#ifdef USE_TILES
-static void NDECL(shuffle_tiles);
+static void shuffle_tiles(void);
extern short glyph2tile[]; /* from tile.c */
/* Shuffle tile assignments to match descriptions, so a red potion isn't
* another routine.
*/
static void
-shuffle_tiles()
+shuffle_tiles(void)
{
int i;
short tmp_tilemap[NUM_OBJECTS];
#endif /* USE_TILES */
static void
-setgemprobs(dlev)
-d_level *dlev;
+setgemprobs(d_level* dlev)
{
int j, first, lev;
/* shuffle descriptions on objects o_low to o_high */
static void
-shuffle(o_low, o_high, domaterial)
-int o_low, o_high;
-boolean domaterial;
+shuffle(int o_low, int o_high, boolean domaterial)
{
int i, j, num_to_shuffle;
short sw;
}
void
-init_objects()
+init_objects(void)
{
int i, first, last, sum, prevoclass;
char oclass;
/* retrieve the range of objects that otyp shares descriptions with */
void
-obj_shuffle_range(otyp, lo_p, hi_p)
-int otyp; /* input: representative item */
-int *lo_p, *hi_p; /* output: range that item belongs among */
+obj_shuffle_range(
+ int otyp, /* input: representative item */
+ int *lo_p, int *hi_p) /* output: range that item belongs among */
{
int i, ocls = objects[otyp].oc_class;
/* randomize object descriptions */
static void
-shuffle_all()
+shuffle_all(void)
{
/* entire classes; obj_shuffle_range() handles their exceptions */
static char shuffle_classes[] = {
/* Return TRUE if the provided string matches the unidentified description of
* the provided object. */
boolean
-objdescr_is(obj, descr)
-struct obj *obj;
-const char *descr;
+objdescr_is(struct obj* obj, const char * descr)
{
const char *objdescr;
/* find the object index for snow boots; used [once] by slippery ice code */
int
-find_skates()
+find_skates(void)
{
register int i;
register const char *s;
/* level dependent initialization */
void
-oinit()
+oinit(void)
{
setgemprobs(&u.uz);
}
void
-savenames(nhfp)
-NHFILE *nhfp;
+savenames(NHFILE* nhfp)
{
int i;
unsigned int len;
}
void
-restnames(nhfp)
-NHFILE *nhfp;
+restnames(NHFILE* nhfp)
{
int i;
unsigned int len = 0;
}
void
-discover_object(oindx, mark_as_known, credit_hero)
-register int oindx;
-boolean mark_as_known;
-boolean credit_hero;
+discover_object(int oindx, boolean mark_as_known, boolean credit_hero)
{
if (!objects[oindx].oc_name_known) {
register int dindx, acls = objects[oindx].oc_class;
/* if a class name has been cleared, we may need to purge it from disco[] */
void
-undiscover_object(oindx)
-register int oindx;
+undiscover_object(int oindx)
{
if (!objects[oindx].oc_name_known) {
register int dindx, acls = objects[oindx].oc_class;
}
static boolean
-interesting_to_discover(i)
-register int i;
+interesting_to_discover(int i)
{
/* Pre-discovered objects are now printed with a '*' */
return (boolean) (objects[i].oc_uname != (char *) 0
/* discoveries qsort comparison function */
static int CFDECLSPEC
-discovered_cmp(v1, v2)
-const genericptr v1;
-const genericptr v2;
+discovered_cmp(const genericptr v1, const genericptr v2)
{
const char *s1 = *(const char **) v1;
const char *s2 = *(const char **) v2;
}
static char *
-sortloot_descr(otyp, outbuf)
-int otyp;
-char *outbuf;
+sortloot_descr(int otyp,char * outbuf)
{
Loot sl_cookie;
struct obj o;
};
int
-choose_disco_sort(mode)
-int mode; /* 0 => 'O' cmd, 1 => full discoveries; 2 => class discoveries */
+choose_disco_sort(
+ int mode) /* 0 => 'O' cmd, 1 => full discoveries; 2 => class discoveries */
{
winid tmpwin;
menu_item *selected;
/* the '\' command - show discovered object types */
int
-dodiscovered() /* free after Robert Viduya */
+dodiscovered(void) /* free after Robert Viduya */
{
winid tmpwin;
char *s, *p, oclass, prev_class,
/* lower case let_to_name() output, which differs from def_oc_syms[].name */
static char *
-oclass_to_name(oclass, buf)
-char oclass;
-char *buf;
+oclass_to_name(char oclass, char *buf)
{
char *s;
/* the '`' command - show discovered object types for one class */
int
-doclassdisco()
+doclassdisco(void)
{
static NEARDATA const char
prompt[] = "View discoveries for which sort of objects?",
/* put up nameable subset of discoveries list as a menu */
void
-rename_disco()
+rename_disco(void)
{
register int i, dis;
int ct = 0, mn = 0, sl;
/* clang-format on */
/* *INDENT-ON* */
-void NDECL(objects_globals_init); /* in hack.h but we're using config.h */
+void objects_globals_init(void); /* in hack.h but we're using config.h */
struct objdescr obj_descr[SIZE(obj_descr_init)];
struct objclass objects[SIZE(obj_init)];
void
-objects_globals_init()
+objects_globals_init(void)
{
memcpy(obj_descr, obj_descr_init, sizeof(obj_descr));
memcpy(objects, obj_init, sizeof(objects));
struct obj *otmp;
};
-static char *FDECL(strprepend, (char *, const char *));
-static char *NDECL(nextobuf);
-static void FDECL(releaseobuf, (char *));
-static char *FDECL(xname_flags, (struct obj *, unsigned));
-static char *FDECL(minimal_xname, (struct obj *));
-static void FDECL(add_erosion_words, (struct obj *, char *));
-static char *FDECL(doname_base, (struct obj *obj, unsigned));
-static boolean FDECL(singplur_lookup, (char *, char *, BOOLEAN_P,
- const char *const *));
-static char *FDECL(singplur_compound, (char *));
-static boolean FDECL(badman, (const char *, BOOLEAN_P));
-static boolean FDECL(wishymatch, (const char *, const char *, BOOLEAN_P));
-static short FDECL(rnd_otyp_by_wpnskill, (SCHAR_P));
-static short FDECL(rnd_otyp_by_namedesc, (const char *, CHAR_P, int));
-static struct obj *FDECL(wizterrainwish, (char *, char *, int, int));
-static void FDECL(readobjnam_init, (char *, struct _readobjnam_data *));
-static int FDECL(readobjnam_preparse, (struct _readobjnam_data *));
-static void FDECL(readobjnam_parse_charges, (struct _readobjnam_data *));
-static int FDECL(readobjnam_postparse1, (struct _readobjnam_data *));
-static int FDECL(readobjnam_postparse2, (struct _readobjnam_data *));
-static int FDECL(readobjnam_postparse3, (struct _readobjnam_data *));
+static char *strprepend(char *, const char *);
+static char *nextobuf(void);
+static void releaseobuf(char *);
+static char *xname_flags(struct obj *, unsigned);
+static char *minimal_xname(struct obj *);
+static void add_erosion_words(struct obj *, char *);
+static char *doname_base(struct obj *obj, unsigned);
+static boolean singplur_lookup(char *, char *, boolean,
+ const char *const *);
+static char *singplur_compound(char *);
+static boolean badman(const char *, boolean);
+static boolean wishymatch(const char *, const char *, boolean);
+static short rnd_otyp_by_wpnskill(schar);
+static short rnd_otyp_by_namedesc(const char *, char, int);
+static struct obj *wizterrainwish(char *, char *, int, int);
+static void readobjnam_init(char *, struct _readobjnam_data *);
+static int readobjnam_preparse(struct _readobjnam_data *);
+static void readobjnam_parse_charges(struct _readobjnam_data *);
+static int readobjnam_postparse1(struct _readobjnam_data *);
+static int readobjnam_postparse2(struct _readobjnam_data *);
+static int readobjnam_postparse3(struct _readobjnam_data *);
struct Jitem {
int item;
{ POT_BOOZE, "sake" },
{ 0, "" } };
-static const char *FDECL(Japanese_item_name, (int i));
+static const char *Japanese_item_name(int i);
static char *
-strprepend(s, pref)
-register char *s;
-register const char *pref;
+strprepend(char *s,const char * pref)
{
register int i = (int) strlen(pref);
static int obufidx = 0;
static char *
-nextobuf()
+nextobuf(void)
{
obufidx = (obufidx + 1) % NUMOBUF;
return obufs[obufidx];
/* put the most recently allocated buffer back if possible */
static void
-releaseobuf(bufp)
-char *bufp;
+releaseobuf(char *bufp)
{
/* caller may not know whether bufp is the most recently allocated
buffer; if it isn't, do nothing; note that because of the somewhat
}
char *
-obj_typename(otyp)
-register int otyp;
+obj_typename(int otyp)
{
char *buf = nextobuf();
struct objclass *ocl = &objects[otyp];
/* less verbose result than obj_typename(); either the actual name
or the description (but not both); user-assigned name is ignored */
char *
-simple_typename(otyp)
-int otyp;
+simple_typename(int otyp)
{
char *bufp, *pp, *save_uname = objects[otyp].oc_uname;
/* typename for debugging feedback where data involved might be suspect */
char *
-safe_typename(otyp)
-int otyp;
+safe_typename(int otyp)
{
unsigned save_nameknown;
char *res = 0;
}
boolean
-obj_is_pname(obj)
-struct obj *obj;
+obj_is_pname(struct obj* obj)
{
if (!obj->oartifact || !has_oname(obj))
return FALSE;
* we don't want to set dknown if it's not set already.
*/
char *
-distant_name(obj, func)
-struct obj *obj;
-char *FDECL((*func), (OBJ_P));
+distant_name(struct obj* obj, char* (*func)(OBJ_P))
{
char *str;
/* convert player specified fruit name into corresponding fruit juice name
("slice of pizza" -> "pizza juice" rather than "slice of pizza juice") */
char *
-fruitname(juice)
-boolean juice; /* whether or not to append " juice" to the name */
+fruitname(
+ boolean juice) /* whether or not to append " juice" to the name */
{
char *buf = nextobuf();
const char *fruit_nam = strstri(g.pl_fruit, " of ");
/* look up a named fruit by index (1..127) */
struct fruit *
-fruit_from_indx(indx)
-int indx;
+fruit_from_indx(int indx)
{
struct fruit *f;
/* look up a named fruit by name */
struct fruit *
-fruit_from_name(fname, exact, highest_fid)
-const char *fname;
-boolean exact; /* False => prefix or exact match, True = exact match only */
-int *highest_fid; /* optional output; only valid if 'fname' isn't found */
+fruit_from_name(
+ const char *fname,
+ boolean exact, /* False => prefix or exact match, True = exact match only */
+ int *highest_fid) /* optional output; only valid if 'fname' isn't found */
{
struct fruit *f, *tentativef;
char *altfname;
/* sort the named-fruit linked list by fruit index number */
void
-reorder_fruit(forward)
-boolean forward;
+reorder_fruit(boolean forward)
{
struct fruit *f, *allfr[1 + 127];
int i, j, k = SIZE(allfr);
}
char *
-xname(obj)
-struct obj *obj;
+xname(struct obj* obj)
{
return xname_flags(obj, CXN_NORMAL);
}
static char *
-xname_flags(obj, cxn_flags)
-register struct obj *obj;
-unsigned cxn_flags; /* bitmask of CXN_xxx values */
+xname_flags(
+ register struct obj *obj,
+ unsigned cxn_flags) /* bitmask of CXN_xxx values */
{
register char *buf;
register int typ = obj->otyp;
potion of object detection -- if discovered
*/
static char *
-minimal_xname(obj)
-struct obj *obj;
+minimal_xname(struct obj* obj)
{
char *bufp;
struct obj bareobj;
/* xname() output augmented for multishot missile feedback */
char *
-mshot_xname(obj)
-struct obj *obj;
+mshot_xname(struct obj* obj)
{
char tmpbuf[BUFSZ];
char *onm = xname(obj);
/* used for naming "the unique_item" instead of "a unique_item" */
boolean
-the_unique_obj(obj)
-struct obj *obj;
+the_unique_obj(struct obj* obj)
{
boolean known = (obj->known || iflags.override_ID);
/* should monster type be prefixed with "the"? (mostly used for corpses) */
boolean
-the_unique_pm(ptr)
-struct permonst *ptr;
+the_unique_pm(struct permonst* ptr)
{
boolean uniq;
}
static void
-add_erosion_words(obj, prefix)
-struct obj *obj;
-char *prefix;
+add_erosion_words(struct obj* obj, char* prefix)
{
boolean iscrys = (obj->otyp == CRYSKNIFE);
boolean rknown;
/* used to prevent rust on items where rust makes no difference */
boolean
-erosion_matters(obj)
-struct obj *obj;
+erosion_matters(struct obj* obj)
{
switch (obj->oclass) {
case TOOL_CLASS:
#define DONAME_VAGUE_QUAN 2
static char *
-doname_base(obj, doname_flags)
-struct obj *obj;
-unsigned doname_flags;
+doname_base(struct obj* obj, unsigned int doname_flags)
{
boolean ispoisoned = FALSE,
with_price = (doname_flags & DONAME_WITH_PRICE) != 0,
}
char *
-doname(obj)
-struct obj *obj;
+doname(struct obj* obj)
{
return doname_base(obj, (unsigned) 0);
}
/* Name of object including price. */
char *
-doname_with_price(obj)
-struct obj *obj;
+doname_with_price(struct obj* obj)
{
return doname_base(obj, DONAME_WITH_PRICE);
}
/* "some" instead of precise quantity if obj->dknown not set */
char *
-doname_vague_quan(obj)
-struct obj *obj;
+doname_vague_quan(struct obj* obj)
{
/* Used by farlook.
* If it hasn't been seen up close and quantity is more than one,
/* used from invent.c */
boolean
-not_fully_identified(otmp)
-struct obj *otmp;
+not_fully_identified(struct obj* otmp)
{
/* gold doesn't have any interesting attributes [yet?] */
if (otmp->oclass == COIN_CLASS)
/* format a corpse name (xname() omits monster type; doname() calls us);
eatcorpse() also uses us for death reason when eating tainted glob */
char *
-corpse_xname(otmp, adjective, cxn_flags)
-struct obj *otmp;
-const char *adjective;
-unsigned cxn_flags; /* bitmask of CXN_xxx values */
+corpse_xname(
+ struct obj *otmp,
+ const char *adjective,
+ unsigned cxn_flags) /* bitmask of CXN_xxx values */
{
/* some callers [aobjnam()] rely on prefix area that xname() sets aside */
char *nambuf = nextobuf() + PREFIX;
/* xname doesn't include monster type for "corpse"; cxname does */
char *
-cxname(obj)
-struct obj *obj;
+cxname(struct obj* obj)
{
if (obj->otyp == CORPSE)
return corpse_xname(obj, (const char *) 0, CXN_NORMAL);
/* like cxname, but ignores quantity */
char *
-cxname_singular(obj)
-struct obj *obj;
+cxname_singular(struct obj* obj)
{
if (obj->otyp == CORPSE)
return corpse_xname(obj, (const char *) 0, CXN_SINGULAR);
/* treat an object as fully ID'd when it might be used as reason for death */
char *
-killer_xname(obj)
-struct obj *obj;
+killer_xname(struct obj* obj)
{
struct obj save_obj;
unsigned save_ocknown;
/* xname,doname,&c with long results reformatted to omit some stuff */
char *
-short_oname(obj, func, altfunc, lenlimit)
-struct obj *obj;
-char *FDECL((*func), (OBJ_P)), /* main formatting routine */
- *FDECL((*altfunc), (OBJ_P)); /* alternate for shortest result */
-unsigned lenlimit;
+short_oname(
+ struct obj *obj,
+ char *(*func)(OBJ_P), /* main formatting routine */
+ char *(*altfunc)(OBJ_P), /* alternate for shortest result */
+ unsigned lenlimit)
{
struct obj save_obj;
char unamebuf[12], onamebuf[12], *save_oname, *save_uname, *outbuf;
* Used if only one of a collection of objects is named (e.g. in eat.c).
*/
const char *
-singular(otmp, func)
-register struct obj *otmp;
-char *FDECL((*func), (OBJ_P));
+singular(struct obj* otmp, char* (*func)(OBJ_P))
{
long savequan;
char *nam;
/* pick "", "a ", or "an " as article for 'str'; used by an() and doname() */
char *
-just_an(outbuf, str)
-char *outbuf;
-const char *str;
+just_an(char *outbuf, const char *str)
{
char c0;
}
char *
-an(str)
-const char *str;
+an(const char* str)
{
char *buf = nextobuf();
}
char *
-An(str)
-const char *str;
+An(const char* str)
{
char *tmp = an(str);
* Use type_is_pname() for monster names, not the(). the() is idempotent.
*/
char *
-the(str)
-const char *str;
+the(const char* str)
{
char *buf = nextobuf();
boolean insert_the = FALSE;
}
char *
-The(str)
-const char *str;
+The(const char* str)
{
char *tmp = the(str);
/* returns "count cxname(otmp)" or just cxname(otmp) if count == 1 */
char *
-aobjnam(otmp, verb)
-struct obj *otmp;
-const char *verb;
+aobjnam(struct obj* otmp, const char* verb)
{
char prefix[PREFIX];
char *bp = cxname(otmp);
/* combine yname and aobjnam eg "your count cxname(otmp)" */
char *
-yobjnam(obj, verb)
-struct obj *obj;
-const char *verb;
+yobjnam(struct obj* obj, const char *verb)
{
char *s = aobjnam(obj, verb);
/* combine Yname2 and aobjnam eg "Your count cxname(otmp)" */
char *
-Yobjnam2(obj, verb)
-struct obj *obj;
-const char *verb;
+Yobjnam2(struct obj* obj, const char *verb)
{
register char *s = yobjnam(obj, verb);
/* like aobjnam, but prepend "The", not count, and use xname */
char *
-Tobjnam(otmp, verb)
-struct obj *otmp;
-const char *verb;
+Tobjnam(struct obj* otmp, const char *verb)
{
char *bp = The(xname(otmp));
/* capitalized variant of doname() */
char *
-Doname2(obj)
-struct obj *obj;
+Doname2(struct obj* obj)
{
char *s = doname(obj);
#if 0 /* stalled-out work in progress */
/* Doname2() for itemized buying of 'obj' from a shop */
char *
-payDoname(obj)
-struct obj *obj;
+payDoname(struct obj* obj)
{
static const char and_contents[] = " and its contents";
char *p = doname(obj);
/* returns "[your ]xname(obj)" or "Foobar's xname(obj)" or "the xname(obj)" */
char *
-yname(obj)
-struct obj *obj;
+yname(struct obj* obj)
{
char *s = cxname(obj);
/* capitalized variant of yname() */
char *
-Yname2(obj)
-struct obj *obj;
+Yname2(struct obj* obj)
{
char *s = yname(obj);
* or "the minimal_xname(obj)"
*/
char *
-ysimple_name(obj)
-struct obj *obj;
+ysimple_name(struct obj* obj)
{
char *outbuf = nextobuf();
char *s = shk_your(outbuf, obj); /* assert( s == outbuf ); */
/* capitalized variant of ysimple_name() */
char *
-Ysimple_name2(obj)
-struct obj *obj;
+Ysimple_name2(struct obj* obj)
{
char *s = ysimple_name(obj);
/* "scroll" or "scrolls" */
char *
-simpleonames(obj)
-struct obj *obj;
+simpleonames(struct obj* obj)
{
char *simpleoname = minimal_xname(obj);
/* "a scroll" or "scrolls"; "a silver bell" or "the Bell of Opening" */
char *
-ansimpleoname(obj)
-struct obj *obj;
+ansimpleoname(struct obj* obj)
{
char *simpleoname = simpleonames(obj);
int otyp = obj->otyp;
/* "the scroll" or "the scrolls" */
char *
-thesimpleoname(obj)
-struct obj *obj;
+thesimpleoname(struct obj* obj)
{
char *simpleoname = simpleonames(obj);
/* artifact's name without any object type or known/dknown/&c feedback */
char *
-bare_artifactname(obj)
-struct obj *obj;
+bare_artifactname(struct obj* obj)
{
char *outbuf;
/* return form of the verb (input plural) if xname(otmp) were the subject */
char *
-otense(otmp, verb)
-struct obj *otmp;
-const char *verb;
+otense(struct obj* otmp,const char * verb)
{
char *buf;
/* return form of the verb (input plural) for present tense 3rd person subj */
char *
-vtense(subj, verb)
-register const char *subj;
-register const char *verb;
+vtense(const char* subj, const char* verb)
{
char *buf = nextobuf(), *bspot;
int len, ltmp;
/* singularize/pluralize decisions common to both makesingular & makeplural */
static boolean
-singplur_lookup(basestr, endstring, to_plural, alt_as_is)
-char *basestr, *endstring; /* base string, pointer to eos(string) */
-boolean to_plural; /* true => makeplural, false => makesingular */
-const char *const *alt_as_is; /* another set like as_is[] */
+singplur_lookup(
+char *basestr, char *endstring, /* base string, pointer to eos(string) */
+boolean to_plural, /* true => makeplural, false => makesingular */
+const char *const *alt_as_is) /* another set like as_is[] */
{
const struct sing_plur *sp;
const char *same, *other, *const *as;
/* searches for common compounds, ex. lump of royal jelly */
static char *
-singplur_compound(str)
-char *str;
+singplur_compound(char *str)
{
/* if new entries are added, be sure to keep compound_start[] in sync */
static const char *const compounds[] =
* 3.6.0: made case-insensitive.
*/
char *
-makeplural(oldstr)
-const char *oldstr;
+makeplural(const char* oldstr)
{
register char *spot;
char lo_c, *str = nextobuf();
* 3.6.0: made case-insensitive.
*/
char *
-makesingular(oldstr)
-const char *oldstr;
+makesingular(const char* oldstr)
{
register char *p, *bp;
const char *excess = 0;
}
static boolean
-badman(basestr, to_plural)
-const char *basestr;
-boolean to_plural; /* true => makeplural, false => makesingular */
+badman(
+ const char *basestr,
+ boolean to_plural) /* true => makeplural, false => makesingular */
{
/* these are all the prefixes for *man that don't have a *men plural */
static const char *no_men[] = {
/* compare user string against object name string using fuzzy matching */
static boolean
-wishymatch(u_str, o_str, retry_inverted)
-const char *u_str; /* from user, so might be variant spelling */
-const char *o_str; /* from objects[], so is in canonical form */
-boolean retry_inverted; /* optional extra "of" handling */
+wishymatch(
+ const char *u_str, /* from user, so might be variant spelling */
+ const char *o_str, /* from objects[], so is in canonical form */
+ boolean retry_inverted) /* optional extra "of" handling */
{
static NEARDATA const char detect_SP[] = "detect ",
SP_detection[] = " detection";
};
static short
-rnd_otyp_by_wpnskill(skill)
-schar skill;
+rnd_otyp_by_wpnskill(schar skill)
{
int i, n = 0;
short otyp = STRANGE_OBJECT;
}
static short
-rnd_otyp_by_namedesc(name, oclass, xtra_prob)
-const char *name;
-char oclass;
-int xtra_prob; /* to force 0% random generation items to also be considered */
+rnd_otyp_by_namedesc(
+ const char *name,
+ char oclass,
+ int xtra_prob) /* to force 0% random generation items to also be considered */
{
int i, n = 0;
short validobjs[NUM_OBJECTS];
}
int
-shiny_obj(oclass)
-char oclass;
+shiny_obj(char oclass)
{
return (int) rnd_otyp_by_namedesc("shiny", oclass, 0);
}
/* in wizard mode, readobjnam() can accept wishes for traps and terrain */
static struct obj *
-wizterrainwish(bp, p, locked, trapped)
-char *bp, *p;
-int locked, trapped;
+wizterrainwish(char* bp, char* p, int locked, int trapped)
{
struct rm *lev;
boolean madeterrain = FALSE, badterrain = FALSE, didblock;
#define SPINACH 2
static void
-readobjnam_init(bp, d)
-char *bp;
-struct _readobjnam_data *d;
+readobjnam_init(char* bp, struct _readobjnam_data* d)
{
d->cnt = d->spe = d->spesgn = d->typ = 0;
d->very = d->rechrg = d->blessed = d->uncursed = d->iscursed
}
static int
-readobjnam_preparse(d)
-struct _readobjnam_data *d;
+readobjnam_preparse(struct _readobjnam_data* d)
{
for (;;) {
register int l;
}
static void
-readobjnam_parse_charges(d)
-struct _readobjnam_data *d;
+readobjnam_parse_charges(struct _readobjnam_data* d)
{
if (strlen(d->bp) > 1 && (d->p = rindex(d->bp, '(')) != 0) {
boolean keeptrailingchars = TRUE;
}
static int
-readobjnam_postparse1(d)
-struct _readobjnam_data *d;
+readobjnam_postparse1(struct _readobjnam_data* d)
{
int i;
}
static int
-readobjnam_postparse2(d)
-struct _readobjnam_data *d;
+readobjnam_postparse2(struct _readobjnam_data* d)
{
int i;
}
static int
-readobjnam_postparse3(d)
-struct _readobjnam_data *d;
+readobjnam_postparse3(struct _readobjnam_data* d)
{
int i;
* return null.
*/
struct obj *
-readobjnam(bp, no_wish)
-register char *bp;
-struct obj *no_wish;
+readobjnam(char* bp, struct obj* no_wish)
{
struct _readobjnam_data d;
}
int
-rnd_class(first, last)
-int first, last;
+rnd_class(int first, int last)
{
int i, x, sum = 0;
}
static const char *
-Japanese_item_name(i)
-int i;
+Japanese_item_name(int i)
{
struct Jitem *j = Japanese_items;
}
const char *
-suit_simple_name(suit)
-struct obj *suit;
+suit_simple_name(struct obj* suit)
{
const char *suitnm, *esuitp;
}
const char *
-cloak_simple_name(cloak)
-struct obj *cloak;
+cloak_simple_name(struct obj* cloak)
{
if (cloak) {
switch (cloak->otyp) {
/* helm vs hat for messages */
const char *
-helm_simple_name(helmet)
-struct obj *helmet;
+helm_simple_name(struct obj* helmet)
{
/*
* There is some wiggle room here; the result has been chosen
/* gloves vs gauntlets; depends upon discovery state */
const char *
-gloves_simple_name(gloves)
-struct obj *gloves;
+gloves_simple_name(struct obj* gloves)
{
static const char gauntlets[] = "gauntlets";
/* boots vs shoes; depends upon discovery state */
const char *
-boots_simple_name(boots)
-struct obj *boots;
+boots_simple_name(struct obj* boots)
{
static const char shoes[] = "shoes";
/* simplified shield for messages */
const char *
-shield_simple_name(shield)
-struct obj *shield;
+shield_simple_name(struct obj* shield)
{
if (shield) {
/* xname() describes unknown (unseen) reflection as smooth */
/* for completness */
const char *
-shirt_simple_name(shirt)
-struct obj *shirt UNUSED;
+shirt_simple_name(struct obj* shirt UNUSED)
{
return "shirt";
}
const char *
-mimic_obj_name(mtmp)
-struct monst *mtmp;
+mimic_obj_name(struct monst* mtmp)
{
if (M_AP_TYPE(mtmp) == M_AP_OBJECT) {
if (mtmp->mappearance == GOLD_PIECE)
* last resort literal which should be very short), and an optional suffix.
*/
char *
-safe_qbuf(qbuf, qprefix, qsuffix, obj, func, altfunc, lastR)
-char *qbuf; /* output buffer */
-const char *qprefix, *qsuffix;
-struct obj *obj;
-char *FDECL((*func), (OBJ_P)), *FDECL((*altfunc), (OBJ_P));
-const char *lastR;
+safe_qbuf(
+ char *qbuf, /* output buffer */
+ const char *qprefix,
+ const char *qsuffix,
+ struct obj *obj,
+ char *(*func)(OBJ_P),
+ char *(*altfunc)(OBJ_P),
+ const char *lastR)
{
char *bufp, *endp;
/* convert size_t (or int for ancient systems) to ordinary unsigned */
#include "optlist.h"
{(const char *) 0, 0, 0, 0, set_in_sysconf, BoolOpt,
No, No, No, No, 0, (boolean *) 0,
- (int FDECL((*), (int, int, BOOLEAN_P, char *, char *))) 0,
+ (int (*)(int, int, boolean, char *, char *)) 0,
(char *) 0, (const char *) 0, (const char *) 0, 0, 0, 0}
};
#undef NHOPT_PARSE
{ "menu_search", MENU_SEARCH, "Search and invert matching items" },
};
-static void FDECL(nmcpy, (char *, const char *, int));
-static void FDECL(escapes, (const char *, char *));
-static void FDECL(rejectoption, (const char *));
-static char *FDECL(string_for_opt, (char *, BOOLEAN_P));
-static char *FDECL(string_for_env_opt, (const char *, char *, BOOLEAN_P));
-static void FDECL(bad_negation, (const char *, BOOLEAN_P));
-static int FDECL(change_inv_order, (char *));
-static boolean FDECL(warning_opts, (char *, const char *));
-static int FDECL(feature_alert_opts, (char *, const char *));
-static boolean FDECL(duplicate_opt_detection, (int));
-static void FDECL(complain_about_duplicate, (int));
-static int FDECL(length_without_val, (const char *, int len));
-static void NDECL(determine_ambiguities);
-static int FDECL(check_misc_menu_command, (char *, char *));
-int FDECL(spcfn_misc_menu_cmd, (int, int, BOOLEAN_P, char *, char *));
-
-static const char *FDECL(attr2attrname, (int));
-static void FDECL(basic_menu_colors, (BOOLEAN_P));
-static const char * FDECL(msgtype2name, (int));
-static int NDECL(query_msgtype);
-static boolean FDECL(msgtype_add, (int, char *));
-static void FDECL(free_one_msgtype, (int));
-static int NDECL(msgtype_count);
-static boolean FDECL(test_regex_pattern, (const char *, const char *));
-static boolean FDECL(add_menu_coloring_parsed, (const char *, int, int));
-static void FDECL(free_one_menu_coloring, (int));
-static int NDECL(count_menucolors);
-static boolean FDECL(parse_role_opts, (int, BOOLEAN_P, const char *,
- char *, char **));
-static void FDECL(doset_add_menu, (winid, const char *, int, int));
-static void FDECL(opts_add_others, (winid, const char *, int, char *, int));
-static int FDECL(handle_add_list_remove, (const char *, int));
-static void FDECL(remove_autopickup_exception,
- (struct autopickup_exception *));
-static int NDECL(count_apes);
-static int NDECL(count_cond);
-
-static int FDECL(handler_align_misc, (int));
-static int NDECL(handler_disclose);
-static int NDECL(handler_menu_headings);
-static int NDECL(handler_menustyle);
-static int NDECL(handler_msg_window);
-static int NDECL(handler_number_pad);
-static int NDECL(handler_paranoid_confirmation);
-static int NDECL(handler_pickup_burden);
-static int NDECL(handler_pickup_types);
-static int NDECL(handler_runmode);
-static int NDECL(handler_sortloot);
-static int FDECL(handler_symset, (int));
-static int NDECL(handler_whatis_coord);
-static int NDECL(handler_whatis_filter);
+static void nmcpy(char *, const char *, int);
+static void escapes(const char *, char *);
+static void rejectoption(const char *);
+static char *string_for_opt(char *, boolean);
+static char *string_for_env_opt(const char *, char *, boolean);
+static void bad_negation(const char *, boolean);
+static int change_inv_order(char *);
+static boolean warning_opts(char *, const char *);
+static int feature_alert_opts(char *, const char *);
+static boolean duplicate_opt_detection(int);
+static void complain_about_duplicate(int);
+static int length_without_val(const char *, int len);
+static void determine_ambiguities(void);
+static int check_misc_menu_command(char *, char *);
+int spcfn_misc_menu_cmd(int, int, boolean, char *, char *);
+
+static const char *attr2attrname(int);
+static void basic_menu_colors(boolean);
+static const char * msgtype2name(int);
+static int query_msgtype(void);
+static boolean msgtype_add(int, char *);
+static void free_one_msgtype(int);
+static int msgtype_count(void);
+static boolean test_regex_pattern(const char *, const char *);
+static boolean add_menu_coloring_parsed(const char *, int, int);
+static void free_one_menu_coloring(int);
+static int count_menucolors(void);
+static boolean parse_role_opts(int, boolean, const char *,
+ char *, char **);
+static void doset_add_menu(winid, const char *, int, int);
+static void opts_add_others(winid, const char *, int, char *, int);
+static int handle_add_list_remove(const char *, int);
+static void remove_autopickup_exception(struct autopickup_exception *);
+static int count_apes(void);
+static int count_cond(void);
+
+static int handler_align_misc(int);
+static int handler_disclose(void);
+static int handler_menu_headings(void);
+static int handler_menustyle(void);
+static int handler_msg_window(void);
+static int handler_number_pad(void);
+static int handler_paranoid_confirmation(void);
+static int handler_pickup_burden(void);
+static int handler_pickup_types(void);
+static int handler_runmode(void);
+static int handler_sortloot(void);
+static int handler_symset(int);
+static int handler_whatis_coord(void);
+static int handler_whatis_filter(void);
/* next few are not allopts[] entries, so will only be called
directly from doset, not from individual optfn's */
-static int NDECL(handler_autopickup_exception);
-static int NDECL(handler_menu_colors);
-static int NDECL(handler_msgtype);
-
-static boolean FDECL(is_wc_option, (const char *));
-static boolean FDECL(wc_supported, (const char *));
-static boolean FDECL(is_wc2_option, (const char *));
-static boolean FDECL(wc2_supported, (const char *));
-static void FDECL(wc_set_font_name, (int, char *));
-static int FDECL(wc_set_window_colors, (char *));
-static boolean FDECL(illegal_menu_cmd_key, (UCHAR_P));
+static int handler_autopickup_exception(void);
+static int handler_menu_colors(void);
+static int handler_msgtype(void);
+
+static boolean is_wc_option(const char *);
+static boolean wc_supported(const char *);
+static boolean is_wc2_option(const char *);
+static boolean wc2_supported(const char *);
+static void wc_set_font_name(int, char *);
+static int wc_set_window_colors(char *);
+static boolean illegal_menu_cmd_key(uchar);
#ifdef CURSES_GRAPHICS
extern int curses_read_attrs(const char *attrs);
extern char *curses_fmt_attrs(char *);
**********************************
*/
boolean
-parseoptions(opts, tinitial, tfrom_file)
-register char *opts;
-boolean tinitial, tfrom_file;
+parseoptions(register char *opts,boolean tinitial, boolean tfrom_file)
{
char *op;
boolean negated, got_match = FALSE;
}
int
-check_misc_menu_command(opts, op)
-char *opts;
-char *op UNUSED;
+check_misc_menu_command(char *opts, char *op UNUSED)
{
int i;
const char *name_to_check;
*/
static int
-optfn_align(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_align(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
static int
-optfn_align_message(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_align_message(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_align_status(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_align_status(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_altkeyhandler(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_altkeyhandler(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_boulder(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_boulder(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
#ifdef BACKWARD_COMPAT
int clash = 0;
}
static int
-optfn_catname(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_catname(int optidx, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
#ifdef CURSES_GRAPHICS
static int
-optfn_cursesgraphics(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op UNUSED;
+optfn_cursesgraphics(int optidx, int req, boolean negated,
+ char *opts, char *op UNUSED)
{
#ifdef BACKWARD_COMPAT
boolean badflag = FALSE;
#endif
static int
-optfn_DECgraphics(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op UNUSED;
+optfn_DECgraphics(int optidx, int req, boolean negated,
+ char *opts, char *op UNUSED)
{
#ifdef BACKWARD_COMPAT
boolean badflag = FALSE;
}
static int
-optfn_disclose(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_disclose(int optidx, int req, boolean negated, char *opts, char *op)
{
int i, idx, prefix_val;
unsigned num;
}
static int
-optfn_dogname(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_dogname(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_dungeon(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_dungeon(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_effects(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_effects(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_font_map(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_map(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_menu(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_menu(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_message(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_message(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_size_map(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_size_map(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_size_menu(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_size_menu(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_size_message(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_size_message(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_size_status(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_size_status(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_size_text(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_size_text(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_status(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_status(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_font_text(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_font_text(int optidx, int req, boolean negated, char *opts, char *op)
{
/* send them over to the prefix handling for font_ */
return pfxfn_font(optidx, req, negated, opts, op);
}
static int
-optfn_fruit(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_fruit(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op)
{
struct fruit *forig = 0;
}
static int
-optfn_gender(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_gender(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_hilite_status(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_hilite_status(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_horsename(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_horsename(int optidx, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_IBMgraphics(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op UNUSED;
+optfn_IBMgraphics(int optidx, int req, boolean negated,
+ char *opts, char *op UNUSED)
{
#ifdef BACKWARD_COMPAT
const char *sym_name = allopt[optidx].name;
#if defined(BACKWARD_COMPAT) && defined(MAC_GRAPHICS_ENV)
static int
-optfn_MACgraphics(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_MACgraphics(int optidx, int req, boolean negated, char *opts, char *op)
{
boolean badflag = FALSE;
#endif /* BACKWARD_COMPAT && MAC_GRAPHICS_ENV */
static int
-optfn_map_mode(optidx, req, negated, opts, op)
-int optidx, req;
-boolean negated;
-char *opts;
-char *op;
+optfn_map_mode(int optidx, int req, boolean negated, char *opts, char *op)
{
int i;
}
static int
-optfn_menu_deselect_all(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_deselect_all(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_deselect_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_deselect_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_first_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_first_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_headings(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_headings(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
int tmpattr;
}
static int
-optfn_menu_invert_all(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_invert_all(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_invert_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_invert_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_last_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_last_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_next_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_next_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_previous_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_previous_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_search(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_search(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_select_all(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_select_all(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menu_select_page(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_menu_select_page(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menuinvertmode(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_menuinvertmode(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_menustyle(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_menustyle(int optidx, int req, boolean negated, char *opts, char *op)
{
int tmp;
boolean val_required; /* no initializer based on opts because this can be
}
static int
-optfn_monsters(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_monsters(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_mouse_support(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_mouse_support(int optidx, int req, boolean negated, char *opts, char *op)
{
boolean compat;
#endif
static int
-optfn_msg_window(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_msg_window(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok;
#if PREV_MSGS
}
static int
-optfn_msghistory(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_msghistory(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_name(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_name(int optidx, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_number_pad(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_number_pad(int optidx, int req, boolean negated, char *opts, char *op)
{
boolean compat;
}
static int
-optfn_objects(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_objects(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_packorder(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_packorder(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
#ifdef CHANGE_COLOR
static int
-optfn_palette(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_palette(int optidx UNUSED, int req, boolean negated UNUSED, char *opts, char *op)
{
#ifndef WIN32
int cnt, tmp, reverse;
#endif /* CHANGE_COLOR */
static int
-optfn_paranoid_confirmation(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_paranoid_confirmation(int optidx, int req, boolean negated, char *opts, char *op)
{
int i;
}
static int
-optfn_petattr(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_petattr(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok;
}
static int
-optfn_pettype(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_pettype(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_pickup_burden(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_pickup_burden(int optidx, int req, boolean negated UNUSED, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_pickup_types(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_pickup_types(int optidx, int req, boolean negated, char *opts, char *op)
{
char ocl[MAXOCLASSES + 1], tbuf[MAXOCLASSES + 1], qbuf[QBUFSZ],
abuf[BUFSZ];
}
static int
-optfn_pile_limit(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_pile_limit(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_player_selection(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_player_selection(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_playmode(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_playmode(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_race(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_race(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_roguesymset(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_roguesymset(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_role(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_role(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_runmode(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_runmode(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_scores(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_scores(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_scroll_amount(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_scroll_amount(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_scroll_margin(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_scroll_margin(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_sortdiscoveries(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_sortdiscoveries(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
flags.discosort = 'o';
}
static int
-optfn_sortloot(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_sortloot(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
int i;
}
static int
-optfn_statushilites(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_statushilites(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_statuslines(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_statuslines(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok, itmp = 0;
#ifdef WIN32
static int
-optfn_subkeyvalue(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_subkeyvalue(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
#endif /* WIN32 */
static int
-optfn_suppress_alert(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_suppress_alert(int optidx, int req, boolean negated,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_symset(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_symset(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_term_cols(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_term_cols(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok;
long ltmp;
}
static int
-optfn_term_rows(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_term_rows(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok;
long ltmp;
}
static int
-optfn_tile_file(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_tile_file(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_tile_height(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_tile_height(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_tile_width(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_tile_width(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_traps(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_traps(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_vary_msgcount(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_vary_msgcount(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
#ifdef VIDEOSHADES
static int
-optfn_videocolors(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_videocolors(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_videoshades(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_videoshades(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
#ifdef MSDOS
static int
-optfn_video_width(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_video_width(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_video_height(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_video_height(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
#ifdef NO_TERMS
static int
-optfn_video(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_video(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
#endif /* MSDOS */
static int
-optfn_warnings(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op UNUSED;
+optfn_warnings(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
int reslt;
}
static int
-optfn_whatis_coord(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_whatis_coord(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_whatis_filter(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_whatis_filter(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_windowborders(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_windowborders(int optidx, int req, boolean negated, char *opts, char *op)
{
int retval = optn_ok;
#ifdef WINCHAIN
static int
-optfn_windowchain(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_windowchain(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
#endif
static int
-optfn_windowcolors(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_windowcolors(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
static int
-optfn_windowtype(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated UNUSED;
-char *opts;
-char *op;
+optfn_windowtype(int optidx, int req, boolean negated UNUSED,
+ char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
*/
int
-pfxfn_cond_(optidx, req, negated, opts, op)
-int optidx UNUSED;
-int req;
-boolean negated;
-char *opts;
-char *op UNUSED;
+pfxfn_cond_(int optidx UNUSED, int req, boolean negated,
+ char *opts, char *op UNUSED)
{
int reslt;
}
int
-pfxfn_font(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+pfxfn_font(int optidx, int req, boolean negated, char *opts, char *op)
{
int opttype = -1;
#if defined(MICRO) && !defined(AMIGA)
int
-pfxfn_IBM_(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+pfxfn_IBM_(int optidx UNUSED, int req, boolean negated UNUSED,
+ char *opts, char *op UNUSED)
{
if (req == do_init) {
return optn_ok;
*/
static int
-optfn_boolean(optidx, req, negated, opts, op)
-int optidx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+optfn_boolean(int optidx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
}
int
-spcfn_misc_menu_cmd(midx, req, negated, opts, op)
-int midx;
-int req;
-boolean negated;
-char *opts;
-char *op;
+spcfn_misc_menu_cmd(int midx, int req, boolean negated, char *opts, char *op)
{
if (req == do_init) {
return optn_ok;
*/
static int
-handler_menustyle()
+handler_menustyle(void)
{
winid tmpwin;
anything any;
}
static int
-handler_align_misc(optidx)
-int optidx;
+handler_align_misc(int optidx)
{
winid tmpwin;
anything any;
}
static int
-handler_disclose(VOID_ARGS)
+handler_disclose(void)
{
winid tmpwin;
anything any;
}
static int
-handler_menu_headings(VOID_ARGS)
+handler_menu_headings(void)
{
int mhattr = query_attr("How to highlight menu headings:");
}
static int
-handler_msg_window(VOID_ARGS)
+handler_msg_window(void)
{
#if defined(TTY_GRAPHICS) || defined(CURSES_GRAPHICS)
winid tmpwin;
}
static int
-handler_number_pad(VOID_ARGS)
+handler_number_pad(void)
{
winid tmpwin;
anything any;
}
static int
-handler_paranoid_confirmation(VOID_ARGS)
+handler_paranoid_confirmation(void)
{
winid tmpwin;
anything any;
}
static int
-handler_pickup_burden(VOID_ARGS)
+handler_pickup_burden(void)
{
winid tmpwin;
anything any;
}
static int
-handler_pickup_types(VOID_ARGS)
+handler_pickup_types(void)
{
char buf[BUFSZ];
}
static int
-handler_runmode(VOID_ARGS)
+handler_runmode(void)
{
winid tmpwin;
anything any;
}
static int
-handler_sortloot(VOID_ARGS)
+handler_sortloot(void)
{
winid tmpwin;
anything any;
}
static int
-handler_whatis_coord(VOID_ARGS)
+handler_whatis_coord(void)
{
winid tmpwin;
anything any;
}
static int
-handler_whatis_filter(VOID_ARGS)
+handler_whatis_filter(void)
{
winid tmpwin;
anything any;
}
static int
-handler_symset(optidx)
-int optidx;
+handler_symset(int optidx)
{
winid tmpwin;
anything any;
}
static int
-handler_autopickup_exception(VOID_ARGS)
+handler_autopickup_exception(void)
{
winid tmpwin;
anything any;
}
static int
-handler_menu_colors(VOID_ARGS)
+handler_menu_colors(void)
{
winid tmpwin;
anything any;
}
static int
-handler_msgtype(VOID_ARGS)
+handler_msgtype(void)
{
winid tmpwin;
anything any;
*/
static char *
-string_for_opt(opts, val_optional)
-char *opts;
-boolean val_optional;
+string_for_opt(char *opts, boolean val_optional)
{
char *colon, *equals;
}
static char *
-string_for_env_opt(optname, opts, val_optional)
-const char *optname;
-char *opts;
-boolean val_optional;
+string_for_env_opt(const char *optname, char *opts, boolean val_optional)
{
if (!g.opt_initial) {
rejectoption(optname);
}
static void
-bad_negation(optname, with_parameter)
-const char *optname;
-boolean with_parameter;
+bad_negation(const char *optname, boolean with_parameter)
{
pline_The("%s option may not %sbe negated.", optname,
with_parameter ? "both have a value and " : "");
based on what is needed for uniqueness of each individual
option. Set a minimum of 3 characters. */
void
-determine_ambiguities()
+determine_ambiguities(void)
{
int i, j, len, tmpneeded, needed[SIZE(allopt)];
const char *p1, *p2;
}
int
-length_without_val(user_string, len)
-const char *user_string;
-int len;
+length_without_val(const char *user_string, int len)
{
const char *p = index(user_string, ':'),
*q = index(user_string, '=');
substring of a particular option name; option string might have
a colon or equals sign and arbitrary value appended to it */
boolean
-match_optname(user_string, optn_name, min_length, val_allowed)
-const char *user_string, *optn_name;
-int min_length;
-boolean val_allowed;
+match_optname(const char *user_string, const char *optn_name,
+ int min_length, boolean val_allowed)
{
int len = (int) strlen(user_string);
}
void
-reset_duplicate_opt_detection(VOID_ARGS)
+reset_duplicate_opt_detection(void)
{
int k;
}
static boolean
-duplicate_opt_detection(optidx)
-int optidx;
+duplicate_opt_detection(int optidx)
{
if (g.opt_initial && g.opt_from_file)
return allopt[optidx].dupdetected++;
}
static void
-complain_about_duplicate(optidx)
-int optidx;
+complain_about_duplicate(int optidx)
{
char buf[BUFSZ];
}
static void
-rejectoption(optname)
-const char *optname;
+rejectoption(const char *optname)
{
#ifdef MICRO
pline("\"%s\" settable only from %s.", optname, configfile);
* bounds-check itself.
*/
char *
-nh_getenv(ev)
-const char *ev;
+nh_getenv(const char *ev)
{
char *getev = getenv(ev);
/* copy up to maxlen-1 characters; 'dest' must be able to hold maxlen;
treat comma as alternate end of 'src' */
static void
-nmcpy(dest, src, maxlen)
-char *dest;
-const char *src;
-int maxlen;
+nmcpy(char *dest, const char *src, int maxlen)
{
int count;
* or 'O', plus stop if the non-digit is end-of-string.
*/
static void
-escapes(cp, tp)
-const char *cp; /* might be 'tp', updating in place */
-char *tp; /* result is never longer than 'cp' */
+escapes(const char *cp, /* might be 'tp', updating in place */
+ char *tp) /* result is never longer than 'cp' */
{
static NEARDATA const char oct[] = "01234567", dec[] = "0123456789",
hex[] = "00112233445566778899aAbBcCdDeEfF";
/* process options, possibly including SYSCF */
void
-initoptions()
+initoptions(void)
{
int i;
}
void
-initoptions_init()
+initoptions_init(void)
{
#if (defined(UNIX) || defined(VMS)) && defined(TTY_GRAPHICS)
char *opts;
}
void
-initoptions_finish()
+initoptions_finish(void)
{
nhsym sym = 0;
#ifndef MAC
*
*/
static int
-change_inv_order(op)
-char *op;
+change_inv_order(char *op)
{
int oc_sym, num;
char *sp, buf[QBUFSZ];
*/
static boolean
-warning_opts(opts, optype)
-register char *opts;
-const char *optype;
+warning_opts(char *opts, const char *optype)
{
uchar translate[WARNCOUNT];
int length, i;
}
void
-assign_warnings(graph_chars)
-register uchar *graph_chars;
+assign_warnings(uchar *graph_chars)
{
int i;
*/
static int
-feature_alert_opts(op, optn)
-char *op;
-const char *optn;
+feature_alert_opts(char *op, const char *optn)
{
char buf[BUFSZ];
unsigned long fnv = get_feature_notice_ver(op); /* version.c */
/* parse key:command */
boolean
-parsebindings(bindings)
-char *bindings;
+parsebindings(char *bindings)
{
char *bind;
uchar key;
};
const char *
-clr2colorname(clr)
-int clr;
+clr2colorname(int clr)
{
int i;
}
int
-match_str2clr(str)
-char *str;
+match_str2clr(char *str)
{
int i, c = CLR_MAX;
}
static const char *
-attr2attrname(attr)
-int attr;
+attr2attrname(int attr)
{
int i;
}
int
-match_str2attr(str, complain)
-const char *str;
-boolean complain;
+match_str2attr(const char *str, boolean complain)
{
int i, a = -1;
suppresses black and white because one of those will likely be invisible
due to matching the background; False: restore user-specified colorings */
static void
-basic_menu_colors(load_colors)
-boolean load_colors;
+basic_menu_colors(boolean load_colors)
{
if (load_colors) {
/* replace normal menu colors with a set specifically for colors */
}
int
-query_color(prompt)
-const char *prompt;
+query_color(const char *prompt)
{
winid tmpwin;
anything any;
for status highlighting, multiple attributes are allowed [overkill;
life would be much simpler if that were restricted to one also...] */
int
-query_attr(prompt)
-const char *prompt;
+query_attr(const char *prompt)
{
winid tmpwin;
anything any;
};
static const char *
-msgtype2name(typ)
-int typ;
+msgtype2name(int typ)
{
int i;
}
static int
-query_msgtype()
+query_msgtype(void)
{
winid tmpwin;
anything any;
}
static boolean
-msgtype_add(typ, pattern)
-int typ;
-char *pattern;
+msgtype_add(int typ, char *pattern)
{
static const char *re_error = "MSGTYPE regex error";
struct plinemsg_type *tmp = (struct plinemsg_type *) alloc(sizeof *tmp);
}
void
-msgtype_free()
+msgtype_free(void)
{
struct plinemsg_type *tmp, *tmp2 = 0;
}
static void
-free_one_msgtype(idx)
-int idx; /* 0 .. */
+free_one_msgtype(int idx) /* 0 .. */
{
struct plinemsg_type *tmp = g.plinemsg_types;
struct plinemsg_type *prev = NULL;
}
int
-msgtype_type(msg, norepeat)
-const char *msg;
-boolean norepeat; /* called from Norep(via pline) */
+msgtype_type(const char *msg,
+ boolean norepeat) /* called from Norep(via pline) */
{
struct plinemsg_type *tmp = g.plinemsg_types;
/* negate one or more types of messages so that their type handling will
be disabled or re-enabled; MSGTYPE_NORMAL (value 0) is not affected */
void
-hide_unhide_msgtypes(hide, hide_mask)
-boolean hide;
-int hide_mask;
+hide_unhide_msgtypes(boolean hide, int hide_mask)
{
struct plinemsg_type *tmp;
int mt;
}
static int
-msgtype_count(VOID_ARGS)
+msgtype_count(void)
{
int c = 0;
struct plinemsg_type *tmp = g.plinemsg_types;
}
boolean
-msgtype_parse_add(str)
-char *str;
+msgtype_parse_add(char *str)
{
char pattern[256];
char msgtype[11];
/* parse 'str' as a regular expression to check whether it's valid;
compiled regexp gets thrown away regardless of the outcome */
static boolean
-test_regex_pattern(str, errmsg)
-const char *str;
-const char *errmsg;
+test_regex_pattern(const char *str, const char *errmsg)
{
static const char def_errmsg[] = "NHregex error";
struct nhregex *match;
}
static boolean
-add_menu_coloring_parsed(str, c, a)
-const char *str;
-int c, a;
+add_menu_coloring_parsed(const char *str, int c, int a)
{
static const char re_error[] = "Menucolor regex error";
struct menucoloring *tmp;
/* parse '"regex_string"=color&attr' and add it to menucoloring */
boolean
-add_menu_coloring(tmpstr)
-char *tmpstr; /* never Null but could be empty */
+add_menu_coloring(char *tmpstr) /* never Null but could be empty */
{
int c = NO_COLOR, a = ATR_NONE;
char *tmps, *cs, *amp;
}
boolean
-get_menu_coloring(str, color, attr)
-const char *str;
-int *color, *attr;
+get_menu_coloring(const char *str, int *color, int *attr)
{
struct menucoloring *tmpmc;
/* release all menu color patterns */
void
-free_menu_coloring()
+free_menu_coloring(void)
{
/* either menu_colorings or color_colorings or both might need to
be freed or already be Null; do-loop will iterate at most twice */
/* release a specific menu color pattern; not used for color_colorings */
static void
-free_one_menu_coloring(idx)
-int idx; /* 0 .. */
+free_one_menu_coloring(int idx) /* 0 .. */
{
struct menucoloring *tmp = g.menu_colorings;
struct menucoloring *prev = NULL;
}
static int
-count_menucolors(VOID_ARGS)
+count_menucolors(void)
{
struct menucoloring *tmp;
int count = 0;
}
static boolean
-parse_role_opts(optidx, negated, fullname, opts, opp)
-int optidx;
-boolean negated;
-const char *fullname;
-char *opts;
-char **opp;
+parse_role_opts(int optidx, boolean negated, const char *fullname,
+ char *opts, char **opp)
{
char *op = *opp;
/* Check if character c is illegal as a menu command key */
boolean
-illegal_menu_cmd_key(c)
-uchar c;
+illegal_menu_cmd_key(uchar c)
{
if (c == 0 || c == '\r' || c == '\n' || c == '\033' || c == ' '
|| digit((char) c) || (letter((char) c) && c != '@')) {
* symbols.
*/
void
-oc_to_str(src, dest)
-char *src, *dest;
+oc_to_str(char *src, char *dest)
{
int i;
* maps valid C strings.
*/
void
-add_menu_cmd_alias(from_ch, to_ch)
-char from_ch, to_ch;
+add_menu_cmd_alias(char from_ch, char to_ch)
{
if (g.n_menu_mapped >= MAX_MENU_MAPPED_CMDS) {
pline("out of menu map space.");
}
char
-get_menu_cmd_key(ch)
-char ch;
+get_menu_cmd_key(char ch)
{
char *found = index(g.mapped_menu_op, ch);
* doesn't match anything, just return the original.
*/
char
-map_menu_cmd(ch)
-char ch;
+map_menu_cmd(char ch)
{
char *found = index(g.mapped_menu_cmds, ch);
* adding a new entry--for user specified fruits only.
*/
int
-fruitadd(str, replace_fruit)
-char *str;
-struct fruit *replace_fruit;
+fruitadd(char *str, struct fruit *replace_fruit)
{
register int i;
register struct fruit *f;
const char *name;
enum optset_restrictions setwhere;
enum opt_other_enums code;
- int NDECL((*othr_count_func));
+ int (*othr_count_func)(void);
} othropt[] = {
{ "autopickup exceptions", set_in_game, OPT_OTHER_APEXC, count_apes },
{ "menu colors", set_in_game, OPT_OTHER_MENUCOLOR, count_menucolors },
/* the 'O' command */
int
-doset() /* changing options via menu by Per Liboriussen */
+doset(void) /* changing options via menu by Per Liboriussen */
{
static boolean made_fmtstr = FALSE;
char buf[BUFSZ];
/* doset('O' command) menu entries for compound options */
static void
-doset_add_menu(win, option, idx, indexoffset)
-winid win; /* window to add to */
-const char *option; /* option name */
-int idx; /* index in allopt[] */
-int indexoffset; /* value to add to index in allopt[], or zero
- if option cannot be changed */
+doset_add_menu(winid win, /* window to add to */
+ const char *option, /* option name */
+ int idx, /* index in allopt[] */
+ int indexoffset) /* value to add to index in allopt[],
+ or zero if option cannot be changed */
{
const char *value = "unknown"; /* current value */
char buf[BUFSZ], buf2[BUFSZ];
}
static void
-opts_add_others(win, name, id, bufx, nset)
-winid win;
-const char *name;
-int id;
-char *bufx;
-int nset;
+opts_add_others(winid win, const char *name, int id, char *bufx, int nset)
{
char buf[BUFSZ], buf2[BUFSZ];
anything any = cg.zeroany;
/* display keys for menu actions; used by cmd.c '?i' and pager.c '?k' */
void
-show_menu_controls(win, dolist)
-winid win;
-boolean dolist;
+show_menu_controls(winid win, boolean dolist)
{
struct xtra_cntrls {
const char *key, *desc;
}
}
static int
-count_cond(VOID_ARGS)
+count_cond(void)
{
int i, cnt = 0;
}
int
-count_apes(VOID_ARGS)
+count_apes(void)
{
int numapes = 0;
struct autopickup_exception *ape = g.apelist;
/* common to msg-types, menu-colors, autopickup-exceptions */
static int
-handle_add_list_remove(optname, numtotal)
-const char *optname;
-int numtotal;
+handle_add_list_remove(const char *optname, int numtotal)
{
winid tmpwin;
anything any;
}
int
-dotogglepickup()
+dotogglepickup(void)
{
char buf[BUFSZ], ocl[MAXOCLASSES + 1];
}
int
-add_autopickup_exception(mapping)
-const char *mapping;
+add_autopickup_exception(const char *mapping)
{
static const char
APE_regex_error[] = "regex error in AUTOPICKUP_EXCEPTION",
}
static void
-remove_autopickup_exception(whichape)
-struct autopickup_exception *whichape;
+remove_autopickup_exception(struct autopickup_exception *whichape)
{
struct autopickup_exception *ape, *freeape, *prev = 0;
}
void
-free_autopickup_exceptions()
+free_autopickup_exceptions(void)
{
struct autopickup_exception *ape;
/* bundle some common usage into one easy-to-use routine */
int
-load_symset(s, which_set)
-const char *s;
-int which_set;
+load_symset(const char *s, int which_set)
{
clear_symsetentry(which_set, TRUE);
}
void
-free_symsets()
+free_symsets(void)
{
clear_symsetentry(PRIMARY, TRUE);
clear_symsetentry(ROGUESET, TRUE);
/* Parse the value of a SYMBOLS line from a config file */
boolean
-parsesymbols(opts, which_set)
-register char *opts;
-int which_set;
+parsesymbols(register char *opts, int which_set)
{
int val;
char *op, *symname, *strval;
}
struct symparse *
-match_sym(buf)
-char *buf;
+match_sym(char *buf)
{
size_t len = strlen(buf);
const char *p = index(buf, ':'), *q = index(buf, '=');
}
int
-sym_val(strval)
-const char *strval; /* up to 4*BUFSZ-1 long; only first few chars matter */
+sym_val(const char *strval) /* up to 4*BUFSZ-1 long; only first few
+ chars matter */
{
char buf[QBUFSZ], tmp[QBUFSZ]; /* to hold trucated copy of 'strval' */
};
void
-option_help()
+option_help(void)
{
char buf[BUFSZ], buf2[BUFSZ];
const char *optname;
* line if not. End with next_opt("").
*/
void
-next_opt(datawin, str)
-winid datawin;
-const char *str;
+next_opt(winid datawin, const char *str)
{
static char *buf = 0;
int i;
* Returns number selected.
*/
int
-choose_classes_menu(prompt, category, way, class_list, class_select)
-const char *prompt;
-int category;
-boolean way;
-char *class_list;
-char *class_select;
+choose_classes_menu(const char *prompt,
+ int category,
+ boolean way,
+ char *class_list,
+ char *class_select)
{
menu_item *pick_list = (menu_item *) 0;
winid win;
* with the appropriate second argument.
*/
void
-set_option_mod_status(optnam, status)
-const char *optnam;
-int status;
+set_option_mod_status(const char *optnam, int status)
{
int k;
* set_in_game);
*/
void
-set_wc_option_mod_status(optmask, status)
-unsigned long optmask;
-int status;
+set_wc_option_mod_status(unsigned long optmask, int status)
{
int k = 0;
}
static boolean
-is_wc_option(optnam)
-const char *optnam;
+is_wc_option(const char *optnam)
{
int k = 0;
}
static boolean
-wc_supported(optnam)
-const char *optnam;
+wc_supported(const char *optnam)
{
int k;
*/
void
-set_wc2_option_mod_status(optmask, status)
-unsigned long optmask;
-int status;
+set_wc2_option_mod_status(unsigned long optmask, int status)
{
int k = 0;
}
static boolean
-is_wc2_option(optnam)
-const char *optnam;
+is_wc2_option(const char *optnam)
{
int k = 0;
}
static boolean
-wc2_supported(optnam)
-const char *optnam;
+wc2_supported(const char *optnam)
{
int k;
}
static void
-wc_set_font_name(opttype, fontname)
-int opttype;
-char *fontname;
+wc_set_font_name(int opttype, char *fontname)
{
char **fn = (char **) 0;
}
static int
-wc_set_window_colors(op)
-char *op;
+wc_set_window_colors(char *op)
{
/* syntax:
* menu white/black message green/yellow status white/blue text
OPTIONS=playmode:debug, or from dorecover()'s restgamestate() if
restoring a game which was saved in wizard mode */
void
-set_playmode()
+set_playmode(void)
{
if (wizard) {
if (authorize_wizard_mode())
#include "hack.h"
#include "dlb.h"
-static boolean FDECL(is_swallow_sym, (int));
-static int FDECL(append_str, (char *, const char *));
-static void FDECL(look_at_object, (char *, int, int, int));
-static void FDECL(look_at_monster, (char *, char *, struct monst *, int, int));
-static struct permonst *FDECL(lookat, (int, int, char *, char *));
-static void FDECL(checkfile, (char *, struct permonst *,
- BOOLEAN_P, BOOLEAN_P, char *));
-static void FDECL(look_all, (BOOLEAN_P,BOOLEAN_P));
-static void FDECL(do_supplemental_info, (char *, struct permonst *,
- BOOLEAN_P));
-static void NDECL(whatdoes_help);
-static void NDECL(docontact);
-static void NDECL(dispfile_help);
-static void NDECL(dispfile_shelp);
-static void NDECL(dispfile_optionfile);
-static void NDECL(dispfile_license);
-static void NDECL(dispfile_debughelp);
-static void NDECL(hmenu_doextversion);
-static void NDECL(hmenu_dohistory);
-static void NDECL(hmenu_dowhatis);
-static void NDECL(hmenu_dowhatdoes);
-static void NDECL(hmenu_doextlist);
-static void NDECL(domenucontrols);
+static boolean is_swallow_sym(int);
+static int append_str(char *, const char *);
+static void look_at_object(char *, int, int, int);
+static void look_at_monster(char *, char *, struct monst *, int, int);
+static struct permonst *lookat(int, int, char *, char *);
+static void checkfile(char *, struct permonst *, boolean, boolean,
+ char *);
+static void look_all(boolean,boolean);
+static void do_supplemental_info(char *, struct permonst *, boolean);
+static void whatdoes_help(void);
+static void docontact(void);
+static void dispfile_help(void);
+static void dispfile_shelp(void);
+static void dispfile_optionfile(void);
+static void dispfile_license(void);
+static void dispfile_debughelp(void);
+static void hmenu_doextversion(void);
+static void hmenu_dohistory(void);
+static void hmenu_dowhatis(void);
+static void hmenu_dowhatdoes(void);
+static void hmenu_doextlist(void);
+static void domenucontrols(void);
#ifdef PORT_HELP
-extern void NDECL(port_help);
+extern void port_help(void);
#endif
static const char invisexplain[] = "remembered, unseen, creature",
/* Returns "true" for characters that could represent a monster's stomach. */
static boolean
-is_swallow_sym(c)
-int c;
+is_swallow_sym(int c)
{
int i;
* It is expected that buf is of size BUFSZ.
*/
static int
-append_str(buf, new_str)
-char *buf;
-const char *new_str;
+append_str(char *buf, const char *new_str)
{
int space_left; /* space remaining in buf */
/* shared by monster probing (via query_objlist!) as well as lookat() */
char *
-self_lookat(outbuf)
-char *outbuf;
+self_lookat(char *outbuf)
{
char race[QBUFSZ], trapbuf[QBUFSZ];
/* format description of 'mon's health for look_at_monster(), done_in_by() */
char *
-monhealthdescr(mon, addspace, outbuf)
-struct monst *mon;
-boolean addspace;
-char *outbuf;
+monhealthdescr(struct monst *mon, boolean addspace, char *outbuf)
{
int mhp_max = max(mon->mhpmax, 1), /* bullet proofing */
pct = (mon->mhp * 100) / mhp_max;
/* describe a hidden monster; used for look_at during extended monster
detection and for probing; also when looking at self */
void
-mhidden_description(mon, altmon, outbuf)
-struct monst *mon;
-boolean altmon; /* for probing: if mimicking a monster, say so */
-char *outbuf;
+mhidden_description(struct monst *mon,
+ boolean altmon, /* for probing: if mimicking a monster,
+ say so */
+ char *outbuf)
{
struct obj *otmp;
boolean fakeobj, isyou = (mon == &g.youmonst);
/* extracted from lookat(); also used by namefloorobj() */
boolean
-object_from_map(glyph, x, y, obj_p)
-int glyph, x, y;
-struct obj **obj_p;
+object_from_map(int glyph, int x, int y, struct obj **obj_p)
{
boolean fakeobj = FALSE, mimic_obj = FALSE;
struct monst *mtmp;
}
static void
-look_at_object(buf, x, y, glyph)
-char *buf; /* output buffer */
-int x, y, glyph;
+look_at_object(char *buf, /* output buffer */
+ int x, int y, int glyph)
{
struct obj *otmp = 0;
boolean fakeobj = object_from_map(glyph, x, y, &otmp);
}
static void
-look_at_monster(buf, monbuf, mtmp, x, y)
-char *buf, *monbuf; /* buf: output, monbuf: optional output */
-struct monst *mtmp;
-int x, y;
+look_at_monster(char *buf,
+ char *monbuf, /* buf: output, monbuf: optional output */
+ struct monst *mtmp,
+ int x, int y)
{
char *name, monnambuf[BUFSZ], healthbuf[BUFSZ];
boolean accurate = !Hallucination;
* If not hallucinating and the glyph is a monster, also monster data.
*/
static struct permonst *
-lookat(x, y, buf, monbuf)
-int x, y;
-char *buf, *monbuf;
+lookat(int x, int y, char *buf, char *monbuf)
{
struct monst *mtmp = (struct monst *) 0;
struct permonst *pm = (struct permonst *) 0;
* Therefore, we create a copy of inp _just_ for data.base lookup.
*/
static void
-checkfile(inp, pm, user_typed_name, without_asking, supplemental_name)
-char *inp;
-struct permonst *pm;
-boolean user_typed_name, without_asking;
-char *supplemental_name;
+checkfile(char *inp, struct permonst *pm, boolean user_typed_name,
+ boolean without_asking, char *supplemental_name)
{
dlb *fp;
char buf[BUFSZ], newstr[BUFSZ], givenname[BUFSZ];
}
int
-do_screen_description(cc, looked, sym, out_str, firstmatch, for_supplement)
-coord cc;
-boolean looked;
-int sym;
-char *out_str;
-const char **firstmatch;
-struct permonst **for_supplement;
+do_screen_description(coord cc, boolean looked, int sym, char *out_str,
+ const char **firstmatch,
+ struct permonst **for_supplement)
{
static const char mon_interior[] = "the interior of a monster",
unreconnoitered[] = "unreconnoitered";
const char what_is_an_unknown_object[] = "an unknown object";
int
-do_look(mode, click_cc)
-int mode;
-coord *click_cc;
+do_look(int mode, coord *click_cc)
{
boolean quick = (mode == 1); /* use cursor; don't search for "more info" */
boolean clicklook = (mode == 2); /* right mouse-click method */
}
static void
-look_all(nearby, do_mons)
-boolean nearby; /* True => within BOLTLIM, False => entire map */
-boolean do_mons; /* True => monsters, False => objects */
+look_all(boolean nearby, /* True => within BOLTLIM, False => entire map */
+ boolean do_mons) /* True => monsters, False => objects */
{
winid win;
int x, y, lo_x, lo_y, hi_x, hi_y, glyph, count = 0;
};
static void
-do_supplemental_info(name, pm, without_asking)
-char *name;
-struct permonst *pm;
-boolean without_asking;
+do_supplemental_info(char *name, struct permonst *pm, boolean without_asking)
{
const char **textp;
winid datawin = WIN_ERR;
/* the '/' command */
int
-dowhatis()
+dowhatis(void)
{
return do_look(0, (coord *) 0);
}
/* the ';' command */
int
-doquickwhatis()
+doquickwhatis(void)
{
return do_look(1, (coord *) 0);
}
/* the '^' command */
int
-doidtrap()
+doidtrap(void)
{
register struct trap *trap;
int x, y, tt, glyph;
*/
static void
-whatdoes_help()
+whatdoes_help(void)
{
dlb *fp;
char *p, buf[BUFSZ];
Bitfield(else_seen, 1);
};
-static boolean FDECL(whatdoes_cond, (char *, struct wd_stack_frame *,
- int *, int));
+static boolean whatdoes_cond(char *, struct wd_stack_frame *, int *, int);
static boolean
-whatdoes_cond(buf, stack, depth, lnum)
-char *buf;
-struct wd_stack_frame *stack;
-int *depth, lnum;
+whatdoes_cond(char *buf, struct wd_stack_frame *stack, int *depth, int lnum)
{
const char badstackfmt[] = "cmdhlp: too many &%c directives at line %d.";
boolean newcond, neg, gotopt;
#endif /* 0 */
char *
-dowhatdoes_core(q, cbuf)
-char q;
-char *cbuf;
+dowhatdoes_core(char q, char *cbuf)
{
char buf[BUFSZ];
#if 0
}
int
-dowhatdoes()
+dowhatdoes(void)
{
static boolean once = FALSE;
char bufr[BUFSZ];
}
static void
-docontact(VOID_ARGS)
+docontact(void)
{
winid cwin = create_nhwindow(NHW_TEXT);
char buf[BUFSZ];
}
static void
-dispfile_help(VOID_ARGS)
+dispfile_help(void)
{
display_file(HELP, TRUE);
}
static void
-dispfile_shelp(VOID_ARGS)
+dispfile_shelp(void)
{
display_file(SHELP, TRUE);
}
static void
-dispfile_optionfile(VOID_ARGS)
+dispfile_optionfile(void)
{
display_file(OPTIONFILE, TRUE);
}
static void
-dispfile_license(VOID_ARGS)
+dispfile_license(void)
{
display_file(LICENSE, TRUE);
}
static void
-dispfile_debughelp(VOID_ARGS)
+dispfile_debughelp(void)
{
display_file(DEBUGHELP, TRUE);
}
static void
-hmenu_doextversion(VOID_ARGS)
+hmenu_doextversion(void)
{
(void) doextversion();
}
static void
-hmenu_dohistory(VOID_ARGS)
+hmenu_dohistory(void)
{
(void) dohistory();
}
static void
-hmenu_dowhatis(VOID_ARGS)
+hmenu_dowhatis(void)
{
(void) dowhatis();
}
static void
-hmenu_dowhatdoes(VOID_ARGS)
+hmenu_dowhatdoes(void)
{
(void) dowhatdoes();
}
static void
-hmenu_doextlist(VOID_ARGS)
+hmenu_doextlist(void)
{
(void) doextlist();
}
static void
-domenucontrols(VOID_ARGS)
+domenucontrols(void)
{
winid cwin = create_nhwindow(NHW_TEXT);
show_menu_controls(cwin, FALSE);
/* data for dohelp() */
static const struct {
- void NDECL((*f));
+ void (*f)(void);
const char *text;
} help_menu_items[] = {
{ hmenu_doextversion, "About NetHack (version information)." },
{ port_help, "%s-specific help and commands." },
#endif
{ dispfile_debughelp, "List of wizard-mode commands." },
- { (void NDECL((*))) 0, (char *) 0 }
+ { (void (*)(void)) 0, (char *) 0 }
};
/* the '?' command */
int
-dohelp()
+dohelp(void)
{
winid tmpwin = create_nhwindow(NHW_MENU);
char helpbuf[QBUFSZ];
/* the 'V' command; also a choice for '?' */
int
-dohistory()
+dohistory(void)
{
display_file(HISTORY, TRUE);
return 0;
#define CONTAINED_SYM '>' /* from invent.c */
-static void FDECL(simple_look, (struct obj *, BOOLEAN_P));
-static boolean FDECL(query_classes, (char *, boolean *, boolean *,
- const char *, struct obj *,
- BOOLEAN_P, int *));
-static boolean FDECL(fatal_corpse_mistake, (struct obj *, BOOLEAN_P));
-static boolean NDECL(describe_decor);
-static void FDECL(check_here, (BOOLEAN_P));
-static boolean FDECL(n_or_more, (struct obj *));
-static boolean FDECL(all_but_uchain, (struct obj *));
+static void simple_look(struct obj *, boolean);
+static boolean query_classes(char *, boolean *, boolean *, const char *,
+ struct obj *, boolean, int *);
+static boolean fatal_corpse_mistake(struct obj *, boolean);
+static boolean describe_decor(void);
+static void check_here(boolean);
+static boolean n_or_more(struct obj *);
+static boolean all_but_uchain(struct obj *);
#if 0 /* not used */
-static boolean FDECL(allow_cat_no_uchain, (struct obj *));
+static boolean allow_cat_no_uchain(struct obj *);
#endif
-static int FDECL(autopick, (struct obj *, int, menu_item **));
-static int FDECL(count_categories, (struct obj *, int));
-static int FDECL(delta_cwt, (struct obj *, struct obj *));
-static long FDECL(carry_count, (struct obj *, struct obj *, long,
- BOOLEAN_P, int *, int *));
-static int FDECL(lift_object, (struct obj *, struct obj *, long *,
- BOOLEAN_P));
-static boolean FDECL(mbag_explodes, (struct obj *, int));
-static boolean NDECL(is_boh_item_gone);
-static void FDECL(do_boh_explosion, (struct obj *, BOOLEAN_P));
-static long FDECL(boh_loss, (struct obj *, int));
-static int FDECL(in_container, (struct obj *));
-static int FDECL(out_container, (struct obj *));
-static long FDECL(mbag_item_gone, (int, struct obj *, BOOLEAN_P));
-static int FDECL(stash_ok, (struct obj *));
-static void FDECL(explain_container_prompt, (BOOLEAN_P));
-static int FDECL(traditional_loot, (BOOLEAN_P));
-static int FDECL(menu_loot, (int, BOOLEAN_P));
-static int FDECL(tip_ok, (struct obj *));
-static char FDECL(in_or_out_menu, (const char *, struct obj *, BOOLEAN_P,
- BOOLEAN_P, BOOLEAN_P, BOOLEAN_P));
-static boolean FDECL(able_to_loot, (int, int, BOOLEAN_P));
-static boolean NDECL(reverse_loot);
-static boolean FDECL(mon_beside, (int, int));
-static int FDECL(do_loot_cont, (struct obj **, int, int));
-static void FDECL(tipcontainer, (struct obj *));
+static int autopick(struct obj *, int, menu_item **);
+static int count_categories(struct obj *, int);
+static int delta_cwt(struct obj *, struct obj *);
+static long carry_count(struct obj *, struct obj *, long, boolean, int *,
+ int *);
+static int lift_object(struct obj *, struct obj *, long *, boolean);
+static boolean mbag_explodes(struct obj *, int);
+static boolean is_boh_item_gone(void);
+static void do_boh_explosion(struct obj *, boolean);
+static long boh_loss(struct obj *, int);
+static int in_container(struct obj *);
+static int out_container(struct obj *);
+static long mbag_item_gone(int, struct obj *, boolean);
+static int stash_ok(struct obj *);
+static void explain_container_prompt(boolean);
+static int traditional_loot(boolean);
+static int menu_loot(int, boolean);
+static int tip_ok(struct obj *);
+static char in_or_out_menu(const char *, struct obj *, boolean, boolean,
+ boolean, boolean);
+static boolean able_to_loot(int, int, boolean);
+static boolean reverse_loot(void);
+static boolean mon_beside(int, int);
+static int do_loot_cont(struct obj **, int, int);
+static void tipcontainer(struct obj *);
/* define for query_objlist() and autopickup() */
#define FOLLOW(curr, flags) \
touching them */
/* much simpler version of the look-here code; used by query_classes() */
static void
-simple_look(otmp, here)
-struct obj *otmp; /* list of objects */
-boolean here; /* flag for type of obj list linkage */
+simple_look(struct obj *otmp, /* list of objects */
+ boolean here) /* flag for type of obj list linkage */
{
/* Neither of the first two cases is expected to happen, since
* we're only called after multiple classes of objects have been
}
int
-collect_obj_classes(ilets, otmp, here, filter, itemcount)
-char ilets[];
-register struct obj *otmp;
-boolean here;
-boolean FDECL((*filter), (OBJ_P));
-int *itemcount;
+collect_obj_classes(char ilets[], struct obj *otmp, boolean here,
+ boolean (*filter)(OBJ_P), int *itemcount)
{
register int iletct = 0;
register char c;
* (ie, treated as if it had just been "?a").
*/
static boolean
-query_classes(oclasses, one_at_a_time, everything, action, objs, here,
- menu_on_demand)
-char oclasses[];
-boolean *one_at_a_time, *everything;
-const char *action;
-struct obj *objs;
-boolean here;
-int *menu_on_demand;
+query_classes(char oclasses[], boolean *one_at_a_time, boolean *everything,
+ const char *action, struct obj *objs, boolean here,
+ int *menu_on_demand)
{
char ilets[36], inbuf[BUFSZ] = DUMMY; /* FIXME: hardcoded ilets[] length */
int iletct, oclassct;
if (menu_on_demand)
*menu_on_demand = 0;
iletct = collect_obj_classes(ilets, objs, here,
- (boolean FDECL((*), (OBJ_P))) 0, &itemcount);
+ (boolean (*)(OBJ_P)) 0, &itemcount);
if (iletct == 0)
return FALSE;
/* check whether hero is bare-handedly touching a cockatrice corpse */
static boolean
-fatal_corpse_mistake(obj, remotely)
-struct obj *obj;
-boolean remotely;
+fatal_corpse_mistake(struct obj *obj, boolean remotely)
{
if (uarmg || remotely || obj->otyp != CORPSE
|| !touch_petrifies(&mons[obj->corpsenm]) || Stone_resistance)
/* attempting to manipulate a Rider's corpse triggers its revival */
boolean
-rider_corpse_revival(obj, remotely)
-struct obj *obj;
-boolean remotely;
+rider_corpse_revival(struct obj *obj, boolean remotely)
{
if (!obj || obj->otyp != CORPSE || !is_rider(&mons[obj->corpsenm]))
return FALSE;
}
void
-deferred_decor(setup)
-boolean setup; /* True: deferring, False: catching up */
+deferred_decor(boolean setup) /* True: deferring, False: catching up */
{
if (setup) {
iflags.defer_decor = TRUE;
/* handle 'mention_decor' (when walking onto a dungeon feature such as
stairs or altar, describe it even if it isn't covered up by an object) */
static boolean
-describe_decor()
+describe_decor(void)
{
char outbuf[BUFSZ], fbuf[QBUFSZ];
boolean doorhere, waterhere, res = TRUE;
/* look at the objects at our location, unless there are too many of them */
static void
-check_here(picked_some)
-boolean picked_some;
+check_here(boolean picked_some)
{
register struct obj *obj;
register int ct = 0;
/* query_objlist callback: return TRUE if obj's count is >= reference value */
static boolean
-n_or_more(obj)
-struct obj *obj;
+n_or_more(struct obj *obj)
{
if (obj == uchain)
return FALSE;
/* check valid_menu_classes[] for an entry; also used by askchain() */
boolean
-menu_class_present(c)
-int c;
+menu_class_present(int c)
{
return (c && index(g.valid_menu_classes, c)) ? TRUE : FALSE;
}
void
-add_valid_menu_class(c)
-int c;
+add_valid_menu_class(int c)
{
static int vmc_count = 0;
/* query_objlist callback: return TRUE if not uchain */
static boolean
-all_but_uchain(obj)
-struct obj *obj;
+all_but_uchain(struct obj *obj)
{
return (boolean) (obj != uchain);
}
/* query_objlist callback: return TRUE */
/*ARGUSED*/
boolean
-allow_all(obj)
-struct obj *obj UNUSED;
+allow_all(struct obj *obj UNUSED)
{
return TRUE;
}
boolean
-allow_category(obj)
-struct obj *obj;
+allow_category(struct obj *obj)
{
/* For coins, if any class filter is specified, accept if coins
* are included regardless of whether either unpaid or BUC-status
#if 0 /* not used */
/* query_objlist callback: return TRUE if valid category (class), no uchain */
static boolean
-allow_cat_no_uchain(obj)
-struct obj *obj;
+allow_cat_no_uchain(struct obj *obj)
{
if (obj != uchain
&& ((index(g.valid_menu_classes, 'u') && obj->unpaid)
/* query_objlist callback: return TRUE if valid class and worn */
boolean
-is_worn_by_type(otmp)
-register struct obj *otmp;
+is_worn_by_type(struct obj *otmp)
{
return (is_worn(otmp) && allow_category(otmp)) ? TRUE : FALSE;
}
* or not it succeeded.
*/
int
-pickup(what)
-int what; /* should be a long */
+pickup(int what) /* should be a long */
{
int i, n, res, count, n_tried = 0, n_picked = 0;
menu_item *pick_list = (menu_item *) 0;
}
struct autopickup_exception *
-check_autopickup_exceptions(obj)
-struct obj *obj;
+check_autopickup_exceptions(struct obj *obj)
{
/*
* Does the text description of this match an exception?
}
boolean
-autopick_testobj(otmp, calc_costly)
-struct obj *otmp;
-boolean calc_costly;
+autopick_testobj(struct obj *otmp, boolean calc_costly)
{
struct autopickup_exception *ape;
static boolean costly = FALSE;
* function must free the pickup list.
*/
static int
-autopick(olist, follow, pick_list)
-struct obj *olist; /* the object list */
-int follow; /* how to follow the object list */
-menu_item **pick_list; /* list of objects and counts to pick up */
+autopick(struct obj *olist, /* the object list */
+ int follow, /* how to follow the object list */
+ menu_item **pick_list) /* list of objects and counts to pick up */
{
menu_item *pi; /* pick item */
struct obj *curr;
* FEEL_COCKATRICE - touch corpse.
*/
int
-query_objlist(qstr, olist_p, qflags, pick_list, how, allow)
-const char *qstr; /* query string */
-struct obj **olist_p; /* the list to pick from */
-int qflags; /* options to control the query */
-menu_item **pick_list; /* return list of items picked */
-int how; /* type of query */
-boolean FDECL((*allow), (OBJ_P)); /* allow function */
+query_objlist(const char *qstr, /* query string */
+ struct obj **olist_p, /* the list to pick from */
+ int qflags, /* options to control the query */
+ menu_item **pick_list, /* return list of items picked */
+ int how, /* type of query */
+ boolean (*allow)(OBJ_P)) /* allow function */
{
int i, n, tmpglyph;
winid win;
*
*/
int
-query_category(qstr, olist, qflags, pick_list, how)
-const char *qstr; /* query string */
-struct obj *olist; /* the list to pick from */
-int qflags; /* behaviour modification flags */
-menu_item **pick_list; /* return list of items picked */
-int how; /* type of query */
+query_category(const char *qstr, /* query string */
+ struct obj *olist, /* the list to pick from */
+ int qflags, /* behaviour modification flags */
+ menu_item **pick_list, /* return list of items picked */
+ int how) /* type of query */
{
int n;
winid win;
boolean collected_type_name;
char invlet;
int ccount;
- boolean FDECL((*ofilter), (OBJ_P)) = (boolean FDECL((*), (OBJ_P))) 0;
+ boolean (*ofilter)(OBJ_P) = (boolean (*)(OBJ_P)) 0;
boolean do_unpaid = FALSE;
boolean do_blessed = FALSE, do_cursed = FALSE, do_uncursed = FALSE,
do_buc_unknown = FALSE;
}
static int
-count_categories(olist, qflags)
-struct obj *olist;
-int qflags;
+count_categories(struct obj *olist, int qflags)
{
char *pack;
boolean counted_category;
* than trying to match the calculation used by weight() in mkobj.c.
*/
static int
-delta_cwt(container, obj)
-struct obj *container, *obj;
+delta_cwt(struct obj *container, struct obj *obj)
{
struct obj **prev;
int owt, nwt;
/* could we carry `obj'? if not, could we carry some of it/them? */
static long
-carry_count(obj, container, count, telekinesis, wt_before, wt_after)
-struct obj *obj, *container; /* object to pick up, bag it's coming out of */
-long count;
-boolean telekinesis;
-int *wt_before, *wt_after;
+carry_count(struct obj *obj, /* object to pick up... */
+ struct obj *container, /* ...bag it is coming out of */
+ long count,
+ boolean telekinesis,
+ int *wt_before, int *wt_after)
{
boolean adjust_wt = container && carried(container),
is_gold = obj->oclass == COIN_CLASS;
/* determine whether character is able and player is willing to carry `obj' */
static
int
-lift_object(obj, container, cnt_p, telekinesis)
-struct obj *obj, *container; /* object to pick up, bag it's coming out of */
-long *cnt_p;
-boolean telekinesis;
+lift_object(struct obj *obj, /* object to pick up... */
+ struct obj *container, /* ...bag it's coming out of */
+ long *cnt_p,
+ boolean telekinesis)
{
int result, old_wt, new_wt, prev_encumbr, next_encumbr;
* up, 1 if otherwise.
*/
int
-pickup_object(obj, count, telekinesis)
-struct obj *obj;
-long count;
-boolean telekinesis; /* not picking it up directly by hand */
+pickup_object(struct obj *obj, long count,
+ boolean telekinesis) /* not picking it up directly by hand */
{
int res, nearload;
* from otmp because of merging.
*/
struct obj *
-pick_obj(otmp)
-struct obj *otmp;
+pick_obj(struct obj *otmp)
{
struct obj *result;
int ox = otmp->ox, oy = otmp->oy;
* returns the new encumbrance value (from near_capacity()).
*/
int
-encumber_msg()
+encumber_msg(void)
{
int newcap = near_capacity();
/* Is there a container at x,y. Optional: return count of containers at x,y */
int
-container_at(x, y, countem)
-int x, y;
-boolean countem;
+container_at(int x, int y, boolean countem)
{
struct obj *cobj, *nobj;
int container_count = 0;
}
static boolean
-able_to_loot(x, y, looting)
-int x, y;
-boolean looting; /* loot vs tip */
+able_to_loot(int x, int y,
+ boolean looting) /* loot vs tip */
{
const char *verb = looting ? "loot" : "tip";
struct trap *t = t_at(x, y);
}
static boolean
-mon_beside(x, y)
-int x, y;
+mon_beside(int x, int y)
{
int i, j, nx, ny;
}
static int
-do_loot_cont(cobjp, cindex, ccount)
-struct obj **cobjp;
-int cindex, ccount; /* index of this container (1..N), number of them (N) */
+do_loot_cont(struct obj **cobjp,
+ int cindex, /* index of this container (1..N)... */
+ int ccount) /* ...number of them (N) */
{
struct obj *cobj = *cobjp;
/* loot a container on the floor or loot saddle from mon. */
int
-doloot()
+doloot(void)
{
struct obj *cobj, *nobj;
register int c = -1;
/* called when attempting to #loot while confused */
static boolean
-reverse_loot()
+reverse_loot(void)
{
struct obj *goldob = 0, *coffers, *otmp, boxdummy;
struct monst *mon;
/* loot_mon() returns amount of time passed.
*/
int
-loot_mon(mtmp, passed_info, prev_loot)
-struct monst *mtmp;
-int *passed_info;
-boolean *prev_loot;
+loot_mon(struct monst *mtmp, int *passed_info, boolean *prev_loot)
{
int c = -1;
int timepassed = 0;
* it to explode. If the object is a bag itself, check recursively.
*/
static boolean
-mbag_explodes(obj, depthin)
-struct obj *obj;
-int depthin;
+mbag_explodes(struct obj *obj, int depthin)
{
/* these won't cause an explosion when they're empty */
if ((obj->otyp == WAN_CANCELLATION || obj->otyp == BAG_OF_TRICKS)
}
static boolean
-is_boh_item_gone()
+is_boh_item_gone(void)
{
return (boolean) (!rn2(13));
}
Some items will be destroyed with the same chance as looting a cursed bag.
*/
static void
-do_boh_explosion(boh, on_floor)
-struct obj *boh;
-boolean on_floor;
+do_boh_explosion(struct obj *boh, boolean on_floor)
{
struct obj *otmp, *nobj;
}
static long
-boh_loss(container, held)
-struct obj *container;
-int held;
+boh_loss(struct obj *container, int held)
{
/* sometimes toss objects if a cursed magic bag */
if (Is_mbag(container) && container->cursed && Has_contents(container)) {
/* Returns: -1 to stop, 1 item was inserted, 0 item was not inserted. */
static int
-in_container(obj)
-register struct obj *obj;
+in_container(struct obj *obj)
{
boolean floor_container = !carried(g.current_container);
boolean was_unpaid = FALSE;
* also used by getobj() when picking a single item to stash
*/
int
-ck_bag(obj)
-struct obj *obj;
+ck_bag(struct obj *obj)
{
return (g.current_container && obj != g.current_container);
}
/* Returns: -1 to stop, 1 item was removed, 0 item was not removed. */
static int
-out_container(obj)
-register struct obj *obj;
+out_container(struct obj *obj)
{
register struct obj *otmp;
boolean is_gold = (obj->oclass == COIN_CLASS);
/* taking a corpse out of an ice box needs a couple of adjustments */
void
-removed_from_icebox(obj)
-struct obj *obj;
+removed_from_icebox(struct obj *obj)
{
if (!age_is_relative(obj)) {
obj->age = g.monstermoves - obj->age; /* actual age */
/* an object inside a cursed bag of holding is being destroyed */
static long
-mbag_item_gone(held, item, silent)
-int held;
-struct obj *item;
-boolean silent;
+mbag_item_gone(int held, struct obj *item, boolean silent)
{
struct monst *shkp;
long loss = 0L;
/* used for #loot/apply, #tip, and final disclosure */
void
-observe_quantum_cat(box, makecat, givemsg)
-struct obj *box;
-boolean makecat, givemsg;
+observe_quantum_cat(struct obj *box, boolean makecat, boolean givemsg)
{
static NEARDATA const char sc[] = "Schroedinger's Cat";
struct obj *deadcat;
/* used by askchain() to check for magic bag explosion */
boolean
-container_gone(fn)
-int FDECL((*fn), (OBJ_P));
+container_gone(int (*fn)(OBJ_P))
{
/* result is only meaningful while use_container() is executing */
return ((fn == in_container || fn == out_container)
}
static void
-explain_container_prompt(more_containers)
-boolean more_containers;
+explain_container_prompt(boolean more_containers)
{
static const char *const explaintext[] = {
"Container actions:",
}
boolean
-u_handsy()
+u_handsy(void)
{
if (nohands(g.youmonst.data)) {
You("have no hands!"); /* not `body_part(HAND)' */
/* getobj callback for object to be stashed into a container */
int
-stash_ok(obj)
-struct obj *obj;
+stash_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
}
int
-use_container(objp, held, more_containers)
-struct obj **objp;
-int held;
-boolean more_containers; /* True iff #loot multiple and this isn't last one */
+use_container(struct obj **objp,
+ int held,
+ boolean more_containers) /* True iff #loot multiple and this
+ isn't last one */
{
struct obj *otmp, *obj = *objp;
boolean quantum_cat, cursed_mbag, loot_out, loot_in, loot_in_first,
/* loot current_container (take things out or put things in), by prompting */
static int
-traditional_loot(put_in)
-boolean put_in;
+traditional_loot(boolean put_in)
{
- int FDECL((*actionfunc), (OBJ_P)), FDECL((*checkfunc), (OBJ_P));
+ int (*actionfunc)(OBJ_P), (*checkfunc)(OBJ_P);
struct obj **objlist;
char selection[MAXOCLASSES + 10]; /* +10: room for B,U,C,X plus slop */
const char *action;
action = "take out";
objlist = &(g.current_container->cobj);
actionfunc = out_container;
- checkfunc = (int FDECL((*), (OBJ_P))) 0;
+ checkfunc = (int (*)(OBJ_P)) 0;
}
if (query_classes(selection, &one_by_one, &allflag, action, *objlist,
/* loot current_container (take things out or put things in), using a menu */
static int
-menu_loot(retry, put_in)
-int retry;
-boolean put_in;
+menu_loot(int retry, boolean put_in)
{
int n, i, n_looted = 0;
boolean all_categories = TRUE, loot_everything = FALSE;
}
static char
-in_or_out_menu(prompt, obj, outokay, inokay, alreadyused, more_containers)
-const char *prompt;
-struct obj *obj;
-boolean outokay, inokay, alreadyused, more_containers;
+in_or_out_menu(const char *prompt, struct obj *obj, boolean outokay,
+ boolean inokay, boolean alreadyused, boolean more_containers)
{
/* underscore is not a choice; it's used to skip element [0] */
static const char lootchars[] = "_:oibrsnq", abc_chars[] = "_:abcdenq";
/* getobj callback for object to tip */
static int
-tip_ok(obj)
-struct obj *obj;
+tip_ok(struct obj *obj)
{
if (!obj || obj->oclass == COIN_CLASS)
return GETOBJ_EXCLUDE;
/* #tip command -- empty container contents onto floor */
int
-dotip()
+dotip(void)
{
struct obj *cobj, *nobj;
coord cc;
}
static void
-tipcontainer(box)
-struct obj *box; /* or bag */
+tipcontainer(struct obj *box) /* or bag */
{
xchar ox = u.ux, oy = u.uy; /* #tip only works at hero's location */
boolean empty_it = FALSE, maybeshopgoods;
/*-Copyright (c) Robert Patrick Rankin, 2018. */
/* NetHack may be freely redistributed. See license for details. */
-#define NEED_VARARGS /* Uses ... */ /* comment line for pre-compiled headers */
#include "hack.h"
#define BIGBUFSZ (5 * BUFSZ) /* big enough to format a 4*BUFSZ string (from
* config file parsing) with modest decoration;
* result will then be truncated to BUFSZ-1 */
-static void FDECL(putmesg, (const char *));
-static char *FDECL(You_buf, (int));
+static void putmesg(const char *);
+static char *You_buf(int);
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
-static void FDECL(execplinehandler, (const char *));
+static void execplinehandler(const char *);
#endif
#ifdef USER_SOUNDS
-extern void FDECL(maybe_play_sound, (const char *));
+extern void maybe_play_sound(const char *);
#endif
#ifdef DUMPLOG
/* keep the most recent DUMPLOG_MSG_COUNT messages */
void
-dumplogmsg(line)
-const char *line;
+dumplogmsg(const char *line)
{
/*
* TODO:
this data isn't saved and restored); end-of-game releases saved_plines[]
while writing its contents to the final dump log */
void
-dumplogfreemessages()
+dumplogfreemessages(void)
{
unsigned i;
/* keeps windowprocs usage out of pline() */
static void
-putmesg(line)
-const char *line;
+putmesg(const char *line)
{
int attr = ATR_NONE;
putstr(WIN_MESSAGE, attr, line);
}
-/* Note that these declarations rely on knowledge of the internals
- * of the variable argument handling stuff in "tradstdc.h"
- */
-
-#if defined(USE_STDARG) || defined(USE_VARARGS)
-static void FDECL(vpline, (const char *, va_list));
+static void vpline(const char *, va_list);
-/*VARARGS1*/
void
-pline
-VA_DECL(const char *, line)
+pline(const char *line, ...)
{
- VA_START(line);
- VA_INIT(line, char *);
- vpline(line, VA_ARGS);
- VA_END();
+ va_list the_args;
+
+ va_start(the_args, line);
+ vpline(line, the_args);
+ va_end(the_args);
}
-# ifdef USE_STDARG
static void
vpline(const char *line, va_list the_args)
-# else
-static void
-vpline(line, the_args)
-const char *line;
-va_list the_args;
-# endif
-
-#else /* USE_STDARG | USE_VARARG */
-
-# define vpline pline
-
-/*VARARGS1*/
-void
-pline
-VA_DECL(const char *, line)
-#endif /* USE_STDARG | USE_VARARG */
-{ /* start of vpline() or of nested block in USE_OLDARG's pline() */
+{
static int in_pline = 0;
char pbuf[BIGBUFSZ]; /* will get chopped down to BUFSZ-1 if longer */
int ln;
int vlen = 0;
#endif
boolean no_repeat;
- /* Do NOT use VA_START and VA_END in here... see above */
if (!line || !*line)
return;
if (index(line, '%')) {
#if !defined(NO_VSNPRINTF)
- vlen = vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS);
+ vlen = vsnprintf(pbuf, sizeof(pbuf), line, the_args);
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
if (vlen >= (int) sizeof pbuf)
panic("%s: truncation of buffer at %zu of %d bytes",
"pline", sizeof pbuf, vlen);
#endif
#else
- Vsprintf(pbuf, line, VA_ARGS);
+ Vsprintf(pbuf, line, the_args);
#endif
line = pbuf;
}
if (msgtyp == MSGTYP_STOP)
display_nhwindow(WIN_MESSAGE, TRUE); /* --more-- */
- pline_done:
+pline_done:
--in_pline;
- return;
-
-#if !(defined(USE_STDARG) || defined(USE_VARARGS))
- /* provide closing brace for the nested block
- which immediately follows USE_OLDARGS's VA_DECL() */
- VA_END();
-#endif
}
/* pline() variant which can override MSGTYPE handling or suppress
message history (tty interface uses pline() to issue prompts and
they shouldn't be blockable via MSGTYPE=hide) */
-/*VARARGS2*/
-void custompline
-VA_DECL2(unsigned, pflags, const char *, line)
+void
+custompline(unsigned pflags, const char * line, ...)
{
- VA_START(line);
- VA_INIT(line, const char *);
+ va_list the_args;
+
+ va_start(the_args, line);
g.pline_flags = pflags;
- vpline(line, VA_ARGS);
+ vpline(line, the_args);
g.pline_flags = 0;
- VA_END();
- return;
+ va_end(the_args);
}
-/*VARARGS1*/
-void Norep
-VA_DECL(const char *, line)
+void
+Norep(const char *line, ...)
{
- VA_START(line);
- VA_INIT(line, const char *);
+ va_list the_args;
+
+ va_start(the_args, line);
g.pline_flags = PLINE_NOREPEAT;
- vpline(line, VA_ARGS);
+ vpline(line, the_args);
g.pline_flags = 0;
- VA_END();
- return;
+ va_end(the_args);
}
static char *
-You_buf(siz)
-int siz;
+You_buf(int siz)
{
if (siz > g.you_buf_siz) {
if (g.you_buf)
}
void
-free_youbuf()
+free_youbuf(void)
{
if (g.you_buf)
free((genericptr_t) g.you_buf), g.you_buf = (char *) 0;
#define YouMessage(pointer, prefix, text) \
strcat((YouPrefix(pointer, prefix, text), pointer), text)
-/*VARARGS1*/
-void You
-VA_DECL(const char *, line)
+void
+You(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
- vpline(YouMessage(tmp, "You ", line), VA_ARGS);
- VA_END();
+ va_start(the_args, line);
+ vpline(YouMessage(tmp, "You ", line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void Your
-VA_DECL(const char *, line)
+void
+Your(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
- vpline(YouMessage(tmp, "Your ", line), VA_ARGS);
- VA_END();
+ va_start(the_args, line);
+ vpline(YouMessage(tmp, "Your ", line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void You_feel
-VA_DECL(const char *, line)
+void
+You_feel(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
+ va_start(the_args, line);
if (Unaware)
YouPrefix(tmp, "You dream that you feel ", line);
else
YouPrefix(tmp, "You feel ", line);
- vpline(strcat(tmp, line), VA_ARGS);
- VA_END();
+ vpline(strcat(tmp, line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void You_cant
-VA_DECL(const char *, line)
+void
+You_cant(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
- vpline(YouMessage(tmp, "You can't ", line), VA_ARGS);
- VA_END();
+ va_start(the_args, line);
+ vpline(YouMessage(tmp, "You can't ", line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void pline_The
-VA_DECL(const char *, line)
+void
+pline_The(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
- vpline(YouMessage(tmp, "The ", line), VA_ARGS);
- VA_END();
+ va_start(the_args, line);
+ vpline(YouMessage(tmp, "The ", line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void There
-VA_DECL(const char *, line)
+void
+There(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
- vpline(YouMessage(tmp, "There ", line), VA_ARGS);
- VA_END();
+ va_start(the_args, line);
+ vpline(YouMessage(tmp, "There ", line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void You_hear
-VA_DECL(const char *, line)
+void
+You_hear(const char *line, ...)
{
+ va_list the_args;
char *tmp;
if (Deaf || !flags.acoustics)
return;
- VA_START(line);
- VA_INIT(line, const char *);
+ va_start(the_args, line);
if (Underwater)
YouPrefix(tmp, "You barely hear ", line);
else if (Unaware)
YouPrefix(tmp, "You dream that you hear ", line);
else
YouPrefix(tmp, "You hear ", line); /* Deaf-aware */
- vpline(strcat(tmp, line), VA_ARGS);
- VA_END();
+ vpline(strcat(tmp, line), the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-void You_see
-VA_DECL(const char *, line)
+void
+You_see(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
+ va_start(the_args, line);
if (Unaware)
YouPrefix(tmp, "You dream that you see ", line);
else if (Blind) /* caller should have caught this... */
YouPrefix(tmp, "You sense ", line);
else
YouPrefix(tmp, "You see ", line);
- vpline(strcat(tmp, line), VA_ARGS);
- VA_END();
+ vpline(strcat(tmp, line), the_args);
+ va_end(the_args);
}
/* Print a message inside double-quotes.
* The caller is responsible for checking deafness.
* Gods can speak directly to you in spite of deafness.
*/
-/*VARARGS1*/
-void verbalize
-VA_DECL(const char *, line)
+void
+verbalize(const char *line, ...)
{
+ va_list the_args;
char *tmp;
- VA_START(line);
- VA_INIT(line, const char *);
+ va_start(the_args, line);
tmp = You_buf((int) strlen(line) + sizeof "\"\"");
Strcpy(tmp, "\"");
Strcat(tmp, line);
Strcat(tmp, "\"");
- vpline(tmp, VA_ARGS);
- VA_END();
+ vpline(tmp, the_args);
+ va_end(the_args);
}
-/*VARARGS1*/
-/* Note that these declarations rely on knowledge of the internals
- * of the variable argument handling stuff in "tradstdc.h"
- */
-
-#if defined(USE_STDARG) || defined(USE_VARARGS)
-static void FDECL(vraw_printf, (const char *, va_list));
+static void vraw_printf(const char *, va_list);
-void raw_printf
-VA_DECL(const char *, line)
+void
+raw_printf(const char *line, ...)
{
- VA_START(line);
- VA_INIT(line, char *);
- vraw_printf(line, VA_ARGS);
- VA_END();
+ va_list the_args;
+
+ va_start(the_args, line);
+ vraw_printf(line, the_args);
+ va_end(the_args);
}
-# ifdef USE_STDARG
static void
vraw_printf(const char *line, va_list the_args)
-# else
-static void
-vraw_printf(line, the_args)
-const char *line;
-va_list the_args;
-# endif
-
-#else /* USE_STDARG | USE_VARARG */
-
-void raw_printf
-VA_DECL(const char *, line)
-#endif
{
char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
- /* Do NOT use VA_START and VA_END in here... see above */
if (index(line, '%')) {
#if !defined(NO_VSNPRINTF)
- (void) vsnprintf(pbuf, sizeof pbuf, line, VA_ARGS);
+ (void) vsnprintf(pbuf, sizeof(pbuf), line, the_args);
#else
- Vsprintf(pbuf, line, VA_ARGS);
+ Vsprintf(pbuf, line, the_args);
#endif
line = pbuf;
}
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
execplinehandler(line);
#endif
-#if !(defined(USE_STDARG) || defined(USE_VARARGS))
- VA_END(); /* (see vpline) */
-#endif
}
-/*VARARGS1*/
-void impossible
-VA_DECL(const char *, s)
+void
+impossible(const char *s, ...)
{
+ va_list the_args;
char pbuf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
- VA_START(s);
- VA_INIT(s, const char *);
+ va_start(the_args, s);
if (g.program_state.in_impossible)
panic("impossible called impossible");
g.program_state.in_impossible = 1;
#if !defined(NO_VSNPRINTF)
- (void) vsnprintf(pbuf, sizeof pbuf, s, VA_ARGS);
+ (void) vsnprintf(pbuf, sizeof(pbuf), s, the_args);
#else
- Vsprintf(pbuf, s, VA_ARGS);
+ Vsprintf(pbuf, s, the_args);
#endif
+ va_end(the_args);
pbuf[BUFSZ - 1] = '\0'; /* sanity */
paniclog("impossible", pbuf);
if (iflags.debug_fuzzer)
panic("%s", pbuf);
- pline("%s", VA_PASS1(pbuf));
+ pline("%s", pbuf);
/* reuse pbuf[] */
Strcpy(pbuf, "Program in disorder!");
if (g.program_state.something_worth_saving)
Strcat(pbuf, " (Saving and reloading may fix this problem.)");
- pline("%s", VA_PASS1(pbuf));
+ pline("%s", pbuf);
pline("Please report these messages to %s.", DEVTEAM_EMAIL);
if (sysopt.support) {
pline("Alternatively, contact local support: %s", sysopt.support);
}
g.program_state.in_impossible = 0;
- VA_END();
}
#if defined(MSGHANDLER) && (defined(POSIX_TYPES) || defined(__GNUC__))
static boolean use_pline_handler = TRUE;
static void
-execplinehandler(line)
-const char *line;
+execplinehandler(const char *line)
{
int f;
const char *args[3];
} else if (f == -1) {
perror((char *) 0);
use_pline_handler = FALSE;
- pline("%s", VA_PASS1("Fork to message handler failed."));
+ pline("%s", "Fork to message handler failed.");
}
}
#endif /* MSGHANDLER && (POSIX_TYPES || __GNUC__) */
/*
* varargs handling for files.c
*/
-#if defined(USE_STDARG) || defined(USE_VARARGS)
-static void FDECL(vconfig_error_add, (const char *, va_list));
+static void vconfig_error_add(const char *, va_list);
-/*VARARGS1*/
void
-config_error_add
-VA_DECL(const char *, str)
+config_error_add(const char *str, ...)
{
- VA_START(str);
- VA_INIT(str, char *);
- vconfig_error_add(str, VA_ARGS);
- VA_END();
+ va_list the_args;
+
+ va_start(the_args, str);
+ vconfig_error_add(str, the_args);
+ va_end(the_args);
}
-# ifdef USE_STDARG
static void
vconfig_error_add(const char *str, va_list the_args)
-# else
-static void
-vconfig_error_add(str, the_args)
-const char *str;
-va_list the_args;
-# endif
-
-#else /* !(USE_STDARG || USE_VARARG) => USE_OLDARGS */
-
-/*VARARGS1*/
-void
-config_error_add
-VA_DECL(const char *, str)
-#endif /* ?(USE_STDARG || USE_VARARG) */
{ /* start of vconf...() or of nested block in USE_OLDARG's conf...() */
#if !defined(NO_VSNPRINTF)
int vlen = 0;
char buf[BIGBUFSZ]; /* will be chopped down to BUFSZ-1 if longer */
#if !defined(NO_VSNPRINTF)
- vlen = vsnprintf(buf, sizeof buf, str, VA_ARGS);
+ vlen = vsnprintf(buf, sizeof(buf), str, the_args);
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED) && defined(DEBUG)
if (vlen >= (int) sizeof buf)
panic("%s: truncation of buffer at %zu of %d bytes",
"config_error_add", sizeof buf, vlen);
#endif
#else
- Vsprintf(buf, str, VA_ARGS);
+ Vsprintf(buf, str, the_args);
#endif
buf[BUFSZ - 1] = '\0';
config_erradd(buf);
-
-#if !(defined(USE_STDARG) || defined(USE_VARARGS))
- VA_END(); /* (see pline/vpline -- ends nested block for USE_OLDARGS) */
-#endif
}
/* nhassert_failed is called when an nhassert's condition is false */
void
-nhassert_failed(expression, filepath, line)
- const char* expression;
- const char * filepath;
- int line;
+nhassert_failed(const char *expression, const char *filepath, int line)
{
const char * filename;
#include "hack.h"
-static void FDECL(check_strangling, (BOOLEAN_P));
-static void FDECL(polyman, (const char *, const char *));
-static void FDECL(dropp, (struct obj *));
-static void NDECL(break_armor);
-static void FDECL(drop_weapon, (int));
-static int FDECL(armor_to_dragon, (int));
-static void NDECL(newman);
-static void NDECL(polysense);
+static void check_strangling(boolean);
+static void polyman(const char *, const char *);
+static void dropp(struct obj *);
+static void break_armor(void);
+static void drop_weapon(int);
+static int armor_to_dragon(int);
+static void newman(void);
+static void polysense(void);
static const char no_longer_petrify_resistant[] =
"No longer petrify-resistant, you";
/* update the g.youmonst.data structure pointer and intrinsics */
void
-set_uasmon()
+set_uasmon(void)
{
struct permonst *mdat = &mons[u.umonnum];
boolean was_vampshifter = valid_vampshiftform(g.youmonst.cham, u.umonnum);
/* Levitation overrides Flying; set or clear BFlying|I_SPECIAL */
void
-float_vs_flight()
+float_vs_flight(void)
{
boolean stuck_in_floor = (u.utrap && u.utraptype != TT_PIT);
/* for changing into form that's immune to strangulation */
static void
-check_strangling(on)
-boolean on;
+check_strangling(boolean on)
{
/* on -- maybe resume strangling */
if (on) {
/* make a (new) human out of the player */
static void
-polyman(fmt, arg)
-const char *fmt, *arg;
+polyman(const char *fmt, const char *arg)
{
boolean sticky = (sticks(g.youmonst.data) && u.ustuck && !u.uswallow),
was_mimicking = (U_AP_TYPE != M_AP_NOTHING);
}
void
-change_sex()
+change_sex(void)
{
/* setting u.umonster for caveman/cavewoman or priest/priestess
swap unintentionally makes `Upolyd' appear to be true */
}
static void
-newman()
+newman(void)
{
int i, oldlvl, newlvl, hpmax, enmax;
}
void
-polyself(psflags)
-int psflags;
+polyself(int psflags)
{
char buf[BUFSZ] = DUMMY;
int old_light, new_light, mntmp, class, tryct, gvariant = NEUTRAL;
/* (try to) make a mntmp monster out of the player;
returns 1 if polymorph successful */
int
-polymon(mntmp)
-int mntmp;
+polymon(int mntmp)
{
char buf[BUFSZ];
boolean sticky = sticks(g.youmonst.data) && u.ustuck && !u.uswallow,
/* dropx() jacket for break_armor() */
static void
-dropp(obj)
-struct obj *obj;
+dropp(struct obj *obj)
{
struct obj *otmp;
}
static void
-break_armor()
+break_armor(void)
{
register struct obj *otmp;
}
static void
-drop_weapon(alone)
-int alone;
+drop_weapon(int alone)
{
struct obj *otmp;
const char *what, *which, *whichtoo;
/* return to original form, usually either due to polymorph timing out
or dying from loss of hit points while being polymorphed */
void
-rehumanize()
+rehumanize(void)
{
boolean was_flying = (Flying != 0);
}
int
-dobreathe()
+dobreathe(void)
{
struct attack *mattk;
}
int
-dospit()
+dospit(void)
{
struct obj *otmp;
struct attack *mattk;
}
int
-doremove()
+doremove(void)
{
if (!Punished) {
if (u.utrap && u.utraptype == TT_BURIEDBALL) {
}
int
-dospinweb()
+dospinweb(void)
{
register struct trap *ttmp = t_at(u.ux, u.uy);
}
int
-dosummon()
+dosummon(void)
{
int placeholder;
if (u.uen < 10) {
}
int
-dogaze()
+dogaze(void)
{
register struct monst *mtmp;
int looked = 0;
}
int
-dohide()
+dohide(void)
{
boolean ismimic = g.youmonst.data->mlet == S_MIMIC,
on_ceiling = is_clinger(g.youmonst.data) || Flying;
}
int
-dopoly()
+dopoly(void)
{
struct permonst *savedat = g.youmonst.data;
/* #monster for hero-as-mind_flayer giving psychic blast */
int
-domindblast()
+domindblast(void)
{
struct monst *mtmp, *nmon;
int dmg;
}
void
-uunstick()
+uunstick(void)
{
struct monst *mtmp = u.ustuck;
}
void
-skinback(silently)
-boolean silently;
+skinback(boolean silently)
{
if (uskin) {
if (!silently)
}
const char *
-mbodypart(mon, part)
-struct monst *mon;
-int part;
+mbodypart(struct monst *mon, int part)
{
static NEARDATA const char
*humanoid_parts[] = { "arm", "eye", "face", "finger",
}
const char *
-body_part(part)
-int part;
+body_part(int part)
{
return mbodypart(&g.youmonst, part);
}
int
-poly_gender()
+poly_gender(void)
{
/* Returns gender of polymorphed player;
* 0/1=same meaning as flags.female, 2=none.
}
void
-ugolemeffects(damtype, dam)
-int damtype, dam;
+ugolemeffects(int damtype, int dam)
{
int heal = 0;
}
static int
-armor_to_dragon(atyp)
-int atyp;
+armor_to_dragon(int atyp)
{
switch (atyp) {
case GRAY_DRAGON_SCALE_MAIL:
/* some species have awareness of other species */
static void
-polysense()
+polysense(void)
{
short warnidx = NON_PM;
/* True iff hero's role or race has been genocided */
boolean
-ugenocided()
+ugenocided(void)
{
return (boolean) ((g.mvitals[g.urole.malenum].mvflags & G_GENOD)
|| (g.urole.femalenum != NON_PM
/* how hero feels "inside" after self-genocide of role or race */
const char *
-udeadinside()
+udeadinside(void)
{
/* self-genocide used to always say "you feel dead inside" but that
seems silly when you're polymorphed into something undead;
#include "hack.h"
-static long FDECL(itimeout, (long));
-static long FDECL(itimeout_incr, (long, int));
-static void NDECL(ghost_from_bottle);
-static int FDECL(drink_ok, (struct obj *));
-static boolean FDECL(H2Opotion_dip, (struct obj *, struct obj *,
- BOOLEAN_P, const char *));
-static short FDECL(mixtype, (struct obj *, struct obj *));
-static int FDECL(dip_ok, (struct obj *));
-static void FDECL(hold_potion, (struct obj *, const char *,
- const char *, const char *));
+static long itimeout(long);
+static long itimeout_incr(long, int);
+static void ghost_from_bottle(void);
+static int drink_ok(struct obj *);
+static boolean H2Opotion_dip(struct obj *, struct obj *, boolean,
+ const char *);
+static short mixtype(struct obj *, struct obj *);
+static int dip_ok(struct obj *);
+static void hold_potion(struct obj *, const char *, const char *,
+ const char *);
/* force `val' to be within valid range for intrinsic timeout value */
static long
-itimeout(val)
-long val;
+itimeout(long val)
{
if (val >= TIMEOUT)
val = TIMEOUT;
/* increment `old' by `incr' and force result to be valid intrinsic timeout */
static long
-itimeout_incr(old, incr)
-long old;
-int incr;
+itimeout_incr(long old, int incr)
{
return itimeout((old & TIMEOUT) + (long) incr);
}
/* set the timeout field of intrinsic `which' */
void
-set_itimeout(which, val)
-long *which, val;
+set_itimeout(long *which, long val)
{
*which &= ~TIMEOUT;
*which |= itimeout(val);
/* increment the timeout field of intrinsic `which' */
void
-incr_itimeout(which, incr)
-long *which;
-int incr;
+incr_itimeout(long *which, int incr)
{
set_itimeout(which, itimeout_incr(*which, incr));
}
void
-make_confused(xtime, talk)
-long xtime;
-boolean talk;
+make_confused(long xtime, boolean talk)
{
long old = HConfusion;
}
void
-make_stunned(xtime, talk)
-long xtime;
-boolean talk;
+make_stunned(long xtime, boolean talk)
{
long old = HStun;
u.usick_type bit mask), but delayed killer can only support one or
the other at a time. They should become separate intrinsics.... */
void
-make_sick(xtime, cause, talk, type)
-long xtime;
-const char *cause; /* sickness cause */
-boolean talk;
-int type;
+make_sick(long xtime,
+ const char *cause, /* sickness cause */
+ boolean talk,
+ int type)
{
struct kinfo *kptr;
long old = Sick;
}
void
-make_slimed(xtime, msg)
-long xtime;
-const char *msg;
+make_slimed(long xtime, const char *msg)
{
long old = Slimed;
/* start or stop petrification */
void
-make_stoned(xtime, msg, killedby, killername)
-long xtime;
-const char *msg;
-int killedby;
-const char *killername;
+make_stoned(long xtime, const char *msg, int killedby, const char *killername)
{
long old = Stoned;
}
void
-make_vomiting(xtime, talk)
-long xtime;
-boolean talk;
+make_vomiting(long xtime, boolean talk)
{
long old = Vomiting;
static const char eyemsg[] = "%s momentarily %s.";
void
-make_blinded(xtime, talk)
-long xtime;
-boolean talk;
+make_blinded(long xtime, boolean talk)
{
long old = Blinded;
boolean u_could_see, can_see_now;
/* blindness has just started or just ended--caller enforces that;
called by Blindf_on(), Blindf_off(), and make_blinded() */
void
-toggle_blindness()
+toggle_blindness(void)
{
boolean Stinging = (uwep && (EWarn_of_mon & W_WEP) != 0L);
}
boolean
-make_hallucinated(xtime, talk, mask)
-long xtime; /* nonzero if this is an attempt to turn on hallucination */
-boolean talk;
-long mask; /* nonzero if resistance status should change by mask */
+make_hallucinated(long xtime, /* nonzero if this is an attempt to turn on
+ hallucination */
+ boolean talk,
+ long mask) /* nonzero if resistance status should change
+ by mask */
{
long old = HHallucination;
boolean changed = 0;
}
void
-make_deaf(xtime, talk)
-long xtime;
-boolean talk;
+make_deaf(long xtime, boolean talk)
{
long old = HDeaf;
/* set or clear "slippery fingers" */
void
-make_glib(xtime)
-int xtime;
+make_glib(int xtime)
{
g.context.botl |= (!Glib ^ !!xtime);
set_itimeout(&Glib, xtime);
}
void
-self_invis_message()
+self_invis_message(void)
{
pline("%s %s.",
Hallucination ? "Far out, man! You"
}
static void
-ghost_from_bottle()
+ghost_from_bottle(void)
{
struct monst *mtmp = makemon(&mons[PM_GHOST], u.ux, u.uy, NO_MM_FLAGS);
/* getobj callback for object to drink from, which also does double duty as the
* callback for dipping into (both just allow potions). */
static int
-drink_ok(obj)
-struct obj *obj;
+drink_ok(struct obj *obj)
{
if (obj && obj->oclass == POTION_CLASS)
return GETOBJ_SUGGEST;
/* "Quaffing is like drinking, except you spill more." - Terry Pratchett */
int
-dodrink()
+dodrink(void)
{
register struct obj *otmp;
}
int
-dopotion(otmp)
-register struct obj *otmp;
+dopotion(struct obj *otmp)
{
int retval;
}
int
-peffects(otmp)
-register struct obj *otmp;
+peffects(struct obj *otmp)
{
register int i, ii, lim;
}
void
-healup(nhp, nxtra, curesick, cureblind)
-int nhp, nxtra;
-register boolean curesick, cureblind;
+healup(int nhp, int nxtra, boolean curesick, boolean cureblind)
{
if (nhp) {
if (Upolyd) {
}
void
-strange_feeling(obj, txt)
-struct obj *obj;
-const char *txt;
+strange_feeling(struct obj *obj, const char *txt)
{
if (flags.beginner || !txt)
You("have a %s feeling for a moment, then it passes.",
};
const char *
-bottlename()
+bottlename(void)
{
if (Hallucination)
return hbottlenames[rn2(SIZE(hbottlenames))];
/* handle item dipped into water potion or steed saddle splashed by same */
static boolean
-H2Opotion_dip(potion, targobj, useeit, objphrase)
-struct obj *potion, *targobj;
-boolean useeit;
-const char *objphrase; /* "Your widget glows" or "Steed's saddle glows" */
+H2Opotion_dip(struct obj *potion, struct obj *targobj,
+ boolean useeit,
+ const char *objphrase) /* "Your widget glows" or "Steed's saddle
+ glows" */
{
- void FDECL((*func), (OBJ_P)) = 0;
+ void (*func)(OBJ_P) = 0;
const char *glowcolor = 0;
#define COST_alter (-2)
#define COST_none (-1)
/* potion obj hits monster mon, which might be g.youmonst; obj always used up */
void
-potionhit(mon, obj, how)
-struct monst *mon;
-struct obj *obj;
-int how;
+potionhit(struct monst *mon, struct obj *obj, int how)
{
const char *botlnam = bottlename();
boolean isyou = (mon == &g.youmonst);
/* vapors are inhaled or get in your eyes */
void
-potionbreathe(obj)
-register struct obj *obj;
+potionbreathe(struct obj *obj)
{
int i, ii, isdone, kn = 0;
boolean cureblind = FALSE;
/* returns the potion type when o1 is dipped in o2 */
static short
-mixtype(o1, o2)
-register struct obj *o1, *o2;
+mixtype(struct obj *o1, struct obj *o2)
{
int o1typ = o1->otyp, o2typ = o2->otyp;
/* getobj callback for object to be dipped (not the thing being dipped into,
* that uses drink_ok) */
static int
-dip_ok(obj)
-struct obj *obj;
+dip_ok(struct obj *obj)
{
/* dipping hands and gold isn't currently implemented */
if (!obj || obj->oclass == COIN_CLASS)
won't have changed but it might require an extra slot that isn't available
or it might merge into some other carried stack */
static void
-hold_potion(potobj, drop_fmt, drop_arg, hold_msg)
-struct obj *potobj;
-const char *drop_fmt, *drop_arg, *hold_msg;
+hold_potion(struct obj *potobj, const char *drop_fmt, const char *drop_arg,
+ const char *hold_msg)
{
int cap = near_capacity(),
save_pickup_burden = flags.pickup_burden;
/* #dip command */
int
-dodip()
+dodip(void)
{
static const char Dip_[] = "Dip ";
register struct obj *potion, *obj;
/* *monp grants a wish and then leaves the game */
void
-mongrantswish(monp)
-struct monst **monp;
+mongrantswish(struct monst **monp)
{
struct monst *mon = *monp;
int mx = mon->mx, my = mon->my, glyph = glyph_at(mx, my);
}
void
-djinni_from_bottle(obj)
-struct obj *obj;
+djinni_from_bottle(struct obj *obj)
{
struct monst *mtmp;
int chance;
/* clone a gremlin or mold (2nd arg non-null implies heat as the trigger);
hit points are cut in half (odd HP stays with original) */
struct monst *
-split_mon(mon, mtmp)
-struct monst *mon, /* monster being split */
- *mtmp; /* optional attacker whose heat triggered it */
+split_mon(struct monst *mon, /* monster being split */
+ struct monst *mtmp) /* optional attacker whose heat triggered it */
{
struct monst *mtmp2;
char reason[BUFSZ];
#include "hack.h"
-static int NDECL(prayer_done);
-static struct obj *NDECL(worst_cursed_item);
-static int NDECL(in_trouble);
-static void FDECL(fix_worst_trouble, (int));
-static void FDECL(angrygods, (ALIGNTYP_P));
-static void FDECL(at_your_feet, (const char *));
-static void NDECL(gcrownu);
-static void FDECL(pleased, (ALIGNTYP_P));
-static void FDECL(godvoice, (ALIGNTYP_P, const char *));
-static void FDECL(god_zaps_you, (ALIGNTYP_P));
-static void FDECL(fry_by_god, (ALIGNTYP_P, BOOLEAN_P));
-static void FDECL(gods_angry, (ALIGNTYP_P));
-static void FDECL(gods_upset, (ALIGNTYP_P));
-static void FDECL(consume_offering, (struct obj *));
-static boolean FDECL(water_prayer, (BOOLEAN_P));
-static boolean FDECL(blocked_boulder, (int, int));
+static int prayer_done(void);
+static struct obj *worst_cursed_item(void);
+static int in_trouble(void);
+static void fix_worst_trouble(int);
+static void angrygods(aligntyp);
+static void at_your_feet(const char *);
+static void gcrownu(void);
+static void pleased(aligntyp);
+static void godvoice(aligntyp, const char *);
+static void god_zaps_you(aligntyp);
+static void fry_by_god(aligntyp, boolean);
+static void gods_angry(aligntyp);
+static void gods_upset(aligntyp);
+static void consume_offering(struct obj *);
+static boolean water_prayer(boolean);
+static boolean blocked_boulder(int, int);
/* simplify a few tests */
#define Cursed_obj(obj, typ) ((obj) && (obj)->otyp == (typ) && (obj)->cursed)
/* critically low hit points if hp <= 5 or hp <= maxhp/N for some N */
boolean
-critically_low_hp(only_if_injured)
-boolean only_if_injured; /* determines whether maxhp <= 5 matters */
+critically_low_hp(boolean only_if_injured) /* determines whether maxhp <= 5
+ matters */
{
int divisor, hplim, curhp = Upolyd ? u.mh : u.uhp,
maxhp = Upolyd ? u.mhmax : u.uhpmax;
/* return True if surrounded by impassible rock, regardless of the state
of your own location (for example, inside a doorless closet) */
boolean
-stuck_in_wall()
+stuck_in_wall(void)
{
int i, j, x, y, count = 0;
* hands; that's a case where the ramifications override this doubt.
*/
static int
-in_trouble()
+in_trouble(void)
{
struct obj *otmp;
int i;
/* select an item for TROUBLE_CURSED_ITEMS */
static struct obj *
-worst_cursed_item()
+worst_cursed_item(void)
{
register struct obj *otmp;
}
static void
-fix_worst_trouble(trouble)
-int trouble;
+fix_worst_trouble(int trouble)
{
int i;
struct obj *otmp = 0;
* Divine wrath, dungeon walls, and armor follow the same principle.
*/
static void
-god_zaps_you(resp_god)
-aligntyp resp_god;
+god_zaps_you(aligntyp resp_god)
{
if (u.uswallow) {
pline(
}
static void
-fry_by_god(resp_god, via_disintegration)
-aligntyp resp_god;
-boolean via_disintegration;
+fry_by_god(aligntyp resp_god, boolean via_disintegration)
{
You("%s!", !via_disintegration ? "fry to a crisp"
: "disintegrate into a pile of dust");
}
static void
-angrygods(resp_god)
-aligntyp resp_god;
+angrygods(aligntyp resp_god)
{
int maxanger;
/* helper to print "str appears at your feet", or appropriate */
static void
-at_your_feet(str)
-const char *str;
+at_your_feet(const char *str)
{
if (Blind)
str = Something;
}
static void
-gcrownu()
+gcrownu(void)
{
struct obj *obj;
boolean already_exists, in_hand;
}
static void
-pleased(g_align)
-aligntyp g_align;
+pleased(aligntyp g_align)
{
/* don't use p_trouble, worst trouble may get fixed while praying */
int trouble = in_trouble(); /* what's your worst difficulty? */
* returns true if it found any water here.
*/
static boolean
-water_prayer(bless_water)
-boolean bless_water;
+water_prayer(boolean bless_water)
{
register struct obj *otmp;
register long changed = 0;
}
static void
-godvoice(g_align, words)
-aligntyp g_align;
-const char *words;
+godvoice(aligntyp g_align, const char *words)
{
const char *quot = "";
}
static void
-gods_angry(g_align)
-aligntyp g_align;
+gods_angry(aligntyp g_align)
{
godvoice(g_align, "Thou hast angered me.");
}
/* The g_align god is upset with you. */
static void
-gods_upset(g_align)
-aligntyp g_align;
+gods_upset(aligntyp g_align)
{
if (g_align == u.ualign.type)
u.ugangr++;
}
static void
-consume_offering(otmp)
-register struct obj *otmp;
+consume_offering(struct obj *otmp)
{
if (Hallucination)
switch (rn2(3)) {
}
int
-dosacrifice()
+dosacrifice(void)
{
static NEARDATA const char
cloud_of_smoke[] = "A cloud of %s smoke surrounds you...";
/* determine prayer results in advance; also used for enlightenment */
boolean
-can_pray(praying)
-boolean praying; /* false means no messages should be given */
+can_pray(boolean praying) /* false means no messages should be given */
{
int alignment;
/* #pray commmand */
int
-dopray()
+dopray(void)
{
/* Confirm accidental slips of Alt-P */
if (ParanoidPray && yn("Are you sure you want to pray?") != 'y')
}
static int
-prayer_done() /* M. Stephenson (1.0.3b) */
+prayer_done(void) /* M. Stephenson (1.0.3b) */
{
aligntyp alignment = g.p_aligntyp;
/* #turn command */
int
-doturn()
+doturn(void)
{
/* Knights & Priest(esse)s only please */
struct monst *mtmp, *mtmp2;
}
int
-altarmask_at(x, y)
-int x, y;
+altarmask_at(int x, int y)
{
int res = 0;
}
const char *
-a_gname()
+a_gname(void)
{
return a_gname_at(u.ux, u.uy);
}
/* returns the name of an altar's deity */
const char *
-a_gname_at(x, y)
-xchar x, y;
+a_gname_at(xchar x, xchar y)
{
if (!IS_ALTAR(levl[x][y].typ))
return (char *) 0;
/* returns the name of the hero's deity */
const char *
-u_gname()
+u_gname(void)
{
return align_gname(u.ualign.type);
}
const char *
-align_gname(alignment)
-aligntyp alignment;
+align_gname(aligntyp alignment)
{
const char *gnam;
/* hallucination handling for priest/minion names: select a random god
iff character is hallucinating */
const char *
-halu_gname(alignment)
-aligntyp alignment;
+halu_gname(aligntyp alignment)
{
const char *gnam = NULL;
int which;
/* deity's title */
const char *
-align_gtitle(alignment)
-aligntyp alignment;
+align_gtitle(aligntyp alignment)
{
const char *gnam, *result = "god";
}
void
-altar_wrath(x, y)
-register int x, y;
+altar_wrath(int x, int y)
{
aligntyp altaralign = a_align(x, y);
/* assumes isok() at one space away, but not necessarily at two */
static boolean
-blocked_boulder(dx, dy)
-int dx, dy;
+blocked_boulder(int dx, int dy)
{
register struct obj *otmp;
int nx, ny;
#define ALGN_SINNED (-4) /* worse than strayed (-1..-3) */
#define ALGN_PIOUS 14 /* better than fervent (9..13) */
-static boolean FDECL(histemple_at, (struct monst *, XCHAR_P, XCHAR_P));
-static boolean FDECL(has_shrine, (struct monst *));
+static boolean histemple_at(struct monst *, xchar, xchar);
+static boolean has_shrine(struct monst *);
void
-newepri(mtmp)
-struct monst *mtmp;
+newepri(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
}
void
-free_epri(mtmp)
-struct monst *mtmp;
+free_epri(struct monst *mtmp)
{
if (mtmp->mextra && EPRI(mtmp)) {
free((genericptr_t) EPRI(mtmp));
* Valid returns are 1: moved 0: didn't -1: let m_move do it -2: died.
*/
int
-move_special(mtmp, in_his_shop, appr, uondoor, avoid, omx, omy, gx, gy)
-register struct monst *mtmp;
-boolean in_his_shop;
-schar appr;
-boolean uondoor, avoid;
-register xchar omx, omy, gx, gy;
+move_special(struct monst *mtmp, boolean in_his_shop, schar appr,
+ boolean uondoor, boolean avoid,
+ xchar omx, xchar omy, xchar gx, xchar gy)
{
register xchar nx, ny, nix, niy;
register schar i;
}
char
-temple_occupied(array)
-register char *array;
+temple_occupied(char *array)
{
register char *ptr;
}
static boolean
-histemple_at(priest, x, y)
-register struct monst *priest;
-register xchar x, y;
+histemple_at(struct monst *priest, xchar x, xchar y)
{
return (boolean) (priest && priest->ispriest
&& (EPRI(priest)->shroom == *in_rooms(x, y, TEMPLE))
}
boolean
-inhistemple(priest)
-struct monst *priest;
+inhistemple(struct monst *priest)
{
/* make sure we have a priest */
if (!priest || !priest->ispriest)
* pri_move: return 1: moved 0: didn't -1: let m_move do it -2: died
*/
int
-pri_move(priest)
-register struct monst *priest;
+pri_move(struct monst *priest)
{
register xchar gx, gy, omx, omy;
schar temple;
/* exclusively for mktemple() */
void
-priestini(lvl, sroom, sx, sy, sanctum)
-d_level *lvl;
-struct mkroom *sroom;
-int sx, sy;
-boolean sanctum; /* is it the seat of the high priest? */
+priestini(d_level *lvl, struct mkroom *sroom, int sx, int sy,
+ boolean sanctum) /* is it the seat of the high priest? */
{
struct monst *priest;
struct obj *otmp;
/* get a monster's alignment type without caller needing EPRI & EMIN */
aligntyp
-mon_aligntyp(mon)
-struct monst *mon;
+mon_aligntyp(struct monst *mon)
{
aligntyp algn = mon->ispriest ? EPRI(mon)->shralign
: mon->isminion ? EMIN(mon)->min_align
* the true name even when under that influence
*/
char *
-priestname(mon, pname)
-register struct monst *mon;
-char *pname; /* caller-supplied output buffer */
+priestname(struct monst *mon,
+ char *pname) /* caller-supplied output buffer */
{
boolean do_hallu = Hallucination,
aligned_priest = mon->data == &mons[PM_ALIGNED_CLERIC],
}
boolean
-p_coaligned(priest)
-struct monst *priest;
+p_coaligned(struct monst *priest)
{
return (boolean) (u.ualign.type == mon_aligntyp(priest));
}
static boolean
-has_shrine(pri)
-struct monst *pri;
+has_shrine(struct monst *pri)
{
struct rm *lev;
struct epri *epri_p;
}
struct monst *
-findpriest(roomno)
-char roomno;
+findpriest(char roomno)
{
register struct monst *mtmp;
/* called from check_special_room() when the player enters the temple room */
void
-intemple(roomno)
-int roomno;
+intemple(int roomno)
{
struct monst *priest, *mtmp;
struct epri *epri_p;
/* reset the move counters used to limit temple entry feedback;
leaving the level and then returning yields a fresh start */
void
-forget_temple_entry(priest)
-struct monst *priest;
+forget_temple_entry(struct monst *priest)
{
struct epri *epri_p = priest->ispriest ? EPRI(priest) : 0;
}
void
-priest_talk(priest)
-register struct monst *priest;
+priest_talk(struct monst *priest)
{
boolean coaligned = p_coaligned(priest);
boolean strayed = (u.ualign.record < 0);
}
struct monst *
-mk_roamer(ptr, alignment, x, y, peaceful)
-register struct permonst *ptr;
-aligntyp alignment;
-xchar x, y;
-boolean peaceful;
+mk_roamer(struct permonst *ptr, aligntyp alignment, xchar x, xchar y,
+ boolean peaceful)
{
register struct monst *roamer;
register boolean coaligned = (u.ualign.type == alignment);
}
void
-reset_hostility(roamer)
-register struct monst *roamer;
+reset_hostility(struct monst *roamer)
{
if (!roamer->isminion)
return;
}
boolean
-in_your_sanctuary(mon, x, y)
-struct monst *mon; /* if non-null, <mx,my> overrides <x,y> */
-xchar x, y;
+in_your_sanctuary(struct monst *mon, /* if non-null, <mx,my> overrides <x,y> */
+ xchar x, xchar y)
{
register char roomno;
register struct monst *priest;
/* when attacking "priest" in his temple */
void
-ghod_hitsu(priest)
-struct monst *priest;
+ghod_hitsu(struct monst *priest)
{
int x, y, ax, ay, roomno = (int) temple_occupied(u.urooms);
struct mkroom *troom;
}
void
-angry_priest()
+angry_priest(void)
{
register struct monst *priest;
struct rm *lev;
* [Perhaps we should convert them into roamers instead?]
*/
void
-clearpriests()
+clearpriests(void)
{
struct monst *mtmp;
/* munge priest-specific structure when restoring -dlc */
void
-restpriest(mtmp, ghostly)
-register struct monst *mtmp;
-boolean ghostly;
+restpriest(struct monst *mtmp, boolean ghostly)
{
if (u.uz.dlevel) {
if (ghostly)
#define Not_firsttime (on_level(&u.uz0, &u.uz))
#define Qstat(x) (g.quest_status.x)
-static void NDECL(on_start);
-static void NDECL(on_locate);
-static void NDECL(on_goal);
-static boolean NDECL(not_capable);
-static int FDECL(is_pure, (BOOLEAN_P));
-static void FDECL(expulsion, (BOOLEAN_P));
-static void NDECL(chat_with_leader);
-static void NDECL(chat_with_nemesis);
-static void NDECL(chat_with_guardian);
-static void FDECL(prisoner_speaks, (struct monst *));
+static void on_start(void);
+static void on_locate(void);
+static void on_goal(void);
+static boolean not_capable(void);
+static int is_pure(boolean);
+static void expulsion(boolean);
+static void chat_with_leader(void);
+static void chat_with_nemesis(void);
+static void chat_with_guardian(void);
+static void prisoner_speaks(struct monst *);
static void
-on_start()
+on_start(void)
{
if (!Qstat(first_start)) {
qt_pager("firsttime");
}
static void
-on_locate()
+on_locate(void)
{
/* the locate messages are phrased in a manner such that they only
make sense when arriving on the level from above */
}
static void
-on_goal()
+on_goal(void)
{
if (Qstat(killed_nemesis)) {
return;
}
void
-onquest()
+onquest(void)
{
if (u.uevent.qcompleted || Not_firsttime)
return;
}
void
-nemdead()
+nemdead(void)
{
if (!Qstat(killed_nemesis)) {
Qstat(killed_nemesis) = TRUE;
}
void
-artitouch(obj)
-struct obj *obj;
+artitouch(struct obj *obj)
{
if (!Qstat(touched_artifact)) {
/* in case we haven't seen the item yet (ie, currently blinded),
/* external hook for do.c (level change check) */
boolean
-ok_to_quest()
+ok_to_quest(void)
{
return (boolean) ((Qstat(got_quest) || Qstat(got_thanks))
&& is_pure(FALSE) > 0);
}
static boolean
-not_capable()
+not_capable(void)
{
return (boolean) (u.ulevel < MIN_QUEST_LEVEL);
}
static int
-is_pure(talk)
-boolean talk;
+is_pure(boolean talk)
{
int purity;
aligntyp original_alignment = u.ualignbase[A_ORIGINAL];
* there is a single branch to and from it.
*/
static void
-expulsion(seal)
-boolean seal;
+expulsion(boolean seal)
{
branch *br;
d_level *dest;
give another message about the character keeping the artifact
and using the magic portal to return to the dungeon. */
void
-finish_quest(obj)
-struct obj *obj; /* quest artifact; possibly null if carrying Amulet */
+finish_quest(struct obj *obj) /* quest artifact; possibly null if carrying
+ Amulet */
{
struct obj *otmp;
}
static void
-chat_with_leader()
+chat_with_leader(void)
{
/* Rule 0: Cheater checks. */
if (u.uhave.questart && !Qstat(met_nemesis))
}
void
-leader_speaks(mtmp)
-struct monst *mtmp;
+leader_speaks(struct monst *mtmp)
{
/* maybe you attacked leader? */
if (!mtmp->mpeaceful) {
}
static void
-chat_with_nemesis()
+chat_with_nemesis(void)
{
/* The nemesis will do most of the talking, but... */
qt_pager("discourage");
}
void
-nemesis_speaks()
+nemesis_speaks(void)
{
if (!Qstat(in_battle)) {
if (u.uhave.questart)
}
static void
-chat_with_guardian()
+chat_with_guardian(void)
{
/* These guys/gals really don't have much to say... */
if (u.uhave.questart && Qstat(killed_nemesis))
}
static void
-prisoner_speaks(mtmp)
-struct monst *mtmp;
+prisoner_speaks(struct monst *mtmp)
{
if (mtmp->data == &mons[PM_PRISONER]
&& (mtmp->mstrategy & STRAT_WAITMASK)) {
}
void
-quest_chat(mtmp)
-register struct monst *mtmp;
+quest_chat(struct monst *mtmp)
{
if (mtmp->m_id == Qstat(leader_m_id)) {
chat_with_leader();
}
void
-quest_talk(mtmp)
-struct monst *mtmp;
+quest_talk(struct monst *mtmp)
{
if (mtmp->m_id == Qstat(leader_m_id)) {
leader_speaks(mtmp);
}
void
-quest_stat_check(mtmp)
-struct monst *mtmp;
+quest_stat_check(struct monst *mtmp)
{
if (mtmp->data->msound == MS_NEMESIS)
Qstat(in_battle) = (mtmp->mcanmove && !mtmp->msleeping
#include "wintty.h"
#endif
-static const char *NDECL(intermed);
-static struct obj *FDECL(find_qarti, (struct obj *));
-static const char *NDECL(neminame);
-static const char *NDECL(guardname);
-static const char *NDECL(homebase);
-static void FDECL(qtext_pronoun, (CHAR_P, CHAR_P));
-static void FDECL(convert_arg, (CHAR_P));
-static void FDECL(convert_line, (char *,char *));
-static void FDECL(deliver_by_pline, (const char *));
-static void FDECL(deliver_by_window, (const char *, int));
-static boolean FDECL(skip_pager, (BOOLEAN_P));
-static boolean FDECL(com_pager_core, (const char *, const char *, BOOLEAN_P));
+static const char *intermed(void);
+static struct obj *find_qarti(struct obj *);
+static const char *neminame(void);
+static const char *guardname(void);
+static const char *homebase(void);
+static void qtext_pronoun(char, char);
+static void convert_arg(char);
+static void convert_line(char *,char *);
+static void deliver_by_pline(const char *);
+static void deliver_by_window(const char *, int);
+static boolean skip_pager(boolean);
+static boolean com_pager_core(const char *, const char *, boolean);
short
-quest_info(typ)
-int typ;
+quest_info(int typ)
{
switch (typ) {
case 0:
/* return your role leader's name */
const char *
-ldrname()
+ldrname(void)
{
int i = g.urole.ldrnum;
/* return your intermediate target string */
static const char *
-intermed()
+intermed(void)
{
return g.urole.intermed;
}
boolean
-is_quest_artifact(otmp)
-struct obj *otmp;
+is_quest_artifact(struct obj *otmp)
{
return (boolean) (otmp->oartifact == g.urole.questarti);
}
static struct obj *
-find_qarti(ochain)
-struct obj *ochain;
+find_qarti(struct obj *ochain)
{
struct obj *otmp, *qarti;
/* check several object chains for the quest artifact to determine
whether it is present on the current level */
struct obj *
-find_quest_artifact(whichchains)
-unsigned whichchains;
+find_quest_artifact(unsigned whichchains)
{
struct monst *mtmp;
struct obj *qarti = 0;
/* return your role nemesis' name */
static const char *
-neminame()
+neminame(void)
{
int i = g.urole.neminum;
}
static const char *
-guardname() /* return your role leader's guard monster name */
+guardname(void) /* return your role leader's guard monster name */
{
int i = g.urole.guardnum;
}
static const char *
-homebase() /* return your role leader's location */
+homebase(void) /* return your role leader's location */
{
return g.urole.homebase;
}
/* replace deity, leader, nemesis, or artifact name with pronoun;
overwrites cvt_buf[] */
static void
-qtext_pronoun(who, which)
-char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis, 'o' => artifact */
- which; /* 'h'|'H'|'i'|'I'|'j'|'J' */
+qtext_pronoun(char who, /* 'd' => deity, 'l' => leader, 'n' => nemesis,
+ 'o' => artifact */
+ char which) /* 'h'|'H'|'i'|'I'|'j'|'J' */
{
const char *pnoun;
int godgend;
}
static void
-convert_arg(c)
-char c;
+convert_arg(char c)
{
register const char *str;
}
static void
-convert_line(in_line, out_line)
-char *in_line, *out_line;
+convert_line(char *in_line, char *out_line)
{
char *c, *cc;
}
static void
-deliver_by_pline(str)
-const char *str;
+deliver_by_pline(const char *str)
{
const char *msgp = str;
const char *msgend = eos((char *)str);
}
static void
-deliver_by_window(msg, how)
-const char *msg;
-int how;
+deliver_by_window(const char *msg, int how)
{
const char *msgp = msg;
const char *msgend = eos((char *)msg);
}
static boolean
-skip_pager(common)
-boolean common UNUSED;
+skip_pager(boolean common UNUSED)
{
/* WIZKIT: suppress plot feedback if starting with quest artifact */
if (g.program_state.wizkit_wishing)
}
static boolean
-com_pager_core(section, msgid, showerror)
-const char *section;
-const char *msgid;
-boolean showerror;
+com_pager_core(const char *section, const char *msgid, boolean showerror)
{
static const char *const howtoput[] = {
"pline", "window", "text", "menu", "default", NULL
}
void
-com_pager(msgid)
-const char *msgid;
+com_pager(const char *msgid)
{
com_pager_core("common", msgid, TRUE);
}
void
-qt_pager(msgid)
-const char *msgid;
+qt_pager(const char *msgid)
{
if (!com_pager_core(g.urole.filecode, msgid, FALSE))
com_pager_core("common", msgid, TRUE);
}
struct permonst *
-qt_montype()
+qt_montype(void)
{
int qpm;
/* special levels can include a custom arrival message; display it */
void
-deliver_splev_message()
+deliver_splev_message(void)
{
char *str, *nl, in_line[BUFSZ], out_line[BUFSZ];
((mndx) == g.urace.malenum \
|| (g.urace.femalenum != NON_PM && (mndx) == g.urace.femalenum))
-static boolean FDECL(learnscrolltyp, (SHORT_P));
-static void FDECL(cap_spe, (struct obj *));
-static char *FDECL(erode_obj_text, (struct obj *, char *));
-static int FDECL(read_ok, (struct obj *));
-static void FDECL(stripspe, (struct obj *));
-static void FDECL(p_glow1, (struct obj *));
-static void FDECL(p_glow2, (struct obj *, const char *));
-static void FDECL(forget, (int));
-static int FDECL(maybe_tame, (struct monst *, struct obj *));
-static boolean FDECL(get_valid_stinking_cloud_pos, (int, int));
-static boolean FDECL(is_valid_stinking_cloud_pos, (int, int, BOOLEAN_P));
-static void FDECL(display_stinking_cloud_positions, (int));
-static void FDECL(set_lit, (int, int, genericptr));
-static void NDECL(do_class_genocide);
-static boolean FDECL(create_particular_parse, (char *, struct _create_particular_data *));
-static boolean FDECL(create_particular_creation, (struct _create_particular_data *));
+static boolean learnscrolltyp(short);
+static void cap_spe(struct obj *);
+static char *erode_obj_text(struct obj *, char *);
+static int read_ok(struct obj *);
+static void stripspe(struct obj *);
+static void p_glow1(struct obj *);
+static void p_glow2(struct obj *, const char *);
+static void forget(int);
+static int maybe_tame(struct monst *, struct obj *);
+static boolean get_valid_stinking_cloud_pos(int, int);
+static boolean is_valid_stinking_cloud_pos(int, int, boolean);
+static void display_stinking_cloud_positions(int);
+static void set_lit(int, int, genericptr);
+static void do_class_genocide(void);
+static boolean create_particular_parse(char *,
+ struct _create_particular_data *);
+static boolean create_particular_creation(struct _create_particular_data *);
static boolean
-learnscrolltyp(scrolltyp)
-short scrolltyp;
+learnscrolltyp(short scrolltyp)
{
if (!objects[scrolltyp].oc_name_known) {
makeknown(scrolltyp);
/* also called from teleport.c for scroll of teleportation */
void
-learnscroll(sobj)
-struct obj *sobj;
+learnscroll(struct obj* sobj)
{
/* it's implied that sobj->dknown is set;
we couldn't be reading this scroll otherwise */
/* max spe is +99, min is -99 */
static void
-cap_spe(obj)
-struct obj *obj;
+cap_spe(struct obj* obj)
{
if (obj) {
if (abs(obj->spe) > SPE_LIM)
}
static char *
-erode_obj_text(otmp, buf)
-struct obj *otmp;
-char *buf;
+erode_obj_text(struct obj* otmp, char* buf)
{
int erosion = greatest_erosion(otmp);
}
char *
-tshirt_text(tshirt, buf)
-struct obj *tshirt;
-char *buf;
+tshirt_text(struct obj* tshirt, char* buf)
{
static const char *shirt_msgs[] = {
/* Scott Bigham */
}
char *
-apron_text(apron, buf)
-struct obj *apron;
-char *buf;
+apron_text(struct obj* apron, char* buf)
{
static const char *apron_msgs[] = {
"Kiss the cook",
/* return the text of a candy bar's wrapper */
const char *
-candy_wrapper_text(obj)
-struct obj *obj;
+candy_wrapper_text(struct obj* obj)
{
/* modulo operation is just bullet proofing; 'spe' is already in range */
return candy_wrappers[obj->spe % SIZE(candy_wrappers)];
/* assign a wrapper to a candy bar stack */
void
-assign_candy_wrapper(obj)
-struct obj *obj;
+assign_candy_wrapper(struct obj* obj)
{
if (obj->otyp == CANDY_BAR) {
/* skips candy_wrappers[0] */
/* getobj callback for object to read */
static int
-read_ok(obj)
-struct obj *obj;
+read_ok(struct obj* obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* the 'r' command; read a scroll or spell book or various other things */
int
-doread()
+doread(void)
{
static const char find_any_braille[] = "feel any Braille writing.";
register struct obj *scroll;
}
static void
-stripspe(obj)
-register struct obj *obj;
+stripspe(register struct obj* obj)
{
if (obj->blessed || obj->spe <= 0) {
pline1(nothing_happens);
}
static void
-p_glow1(otmp)
-register struct obj *otmp;
+p_glow1(register struct obj* otmp)
{
pline("%s briefly.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"));
}
static void
-p_glow2(otmp, color)
-register struct obj *otmp;
-register const char *color;
+p_glow2(register struct obj* otmp, register const char* color)
{
pline("%s%s%s for a moment.", Yobjnam2(otmp, Blind ? "vibrate" : "glow"),
Blind ? "" : " ", Blind ? "" : hcolor(color));
/* getobj callback for object to charge */
int
-charge_ok(obj)
-struct obj *obj;
+charge_ok(struct obj* obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* recharge an object; curse_bless is -1 if the recharging implement
was cursed, +1 if blessed, 0 otherwise. */
void
-recharge(obj, curse_bless)
-struct obj *obj;
-int curse_bless;
+recharge(struct obj* obj, int curse_bless)
{
register int n;
boolean is_cursed, is_blessed;
* howmuch & ALL_SPELLS = forget all spells
*/
static void
-forget(howmuch)
-int howmuch;
+forget(int howmuch)
{
if (Punished)
u.bc_felt = 0; /* forget felt ball&chain */
/* monster is hit by scroll of taming's effect */
static int
-maybe_tame(mtmp, sobj)
-struct monst *mtmp;
-struct obj *sobj;
+maybe_tame(struct monst* mtmp, struct obj* sobj)
{
int was_tame = mtmp->mtame;
unsigned was_peaceful = mtmp->mpeaceful;
}
static boolean
-get_valid_stinking_cloud_pos(x,y)
-int x,y;
+get_valid_stinking_cloud_pos(int x,int y)
{
return (!(!isok(x,y) || !cansee(x, y)
|| !ACCESSIBLE(levl[x][y].typ)
}
static boolean
-is_valid_stinking_cloud_pos(x, y, showmsg)
-int x, y;
-boolean showmsg;
+is_valid_stinking_cloud_pos(int x, int y, boolean showmsg)
{
if (!get_valid_stinking_cloud_pos(x,y)) {
if (showmsg)
}
static void
-display_stinking_cloud_positions(state)
-int state;
+display_stinking_cloud_positions(int state)
{
if (state == 0) {
tmp_at(DISP_BEAM, cmap_to_glyph(S_goodpos));
/* scroll effects; return 1 if we use up the scroll and possibly make it
become discovered, 0 if caller should take care of those side-effects */
int
-seffects(sobj)
-struct obj *sobj; /* scroll, or fake spellbook object for scroll-like spell */
+seffects(struct obj* sobj) /* sobj - scroll, or fake spellbook object for scroll-like spell */
{
int cval, otyp = sobj->otyp;
boolean confused = (Confusion != 0), sblessed = sobj->blessed,
}
void
-drop_boulder_on_player(confused, helmet_protects, byu, skip_uswallow)
-boolean confused, helmet_protects, byu, skip_uswallow;
+drop_boulder_on_player(boolean confused, boolean helmet_protects, boolean byu, boolean skip_uswallow)
{
int dmg;
struct obj *otmp2;
}
boolean
-drop_boulder_on_monster(x, y, confused, byu)
-int x, y;
-boolean confused, byu;
+drop_boulder_on_monster(int x, int y, boolean confused, boolean byu)
{
register struct obj *otmp2;
register struct monst *mtmp;
/* overcharging any wand or zapping/engraving cursed wand */
void
-wand_explode(obj, chg)
-struct obj *obj;
-int chg; /* recharging */
+wand_explode(struct obj* obj, int chg /* recharging */)
{
const char *expl = !chg ? "suddenly" : "vibrates violently and";
int dmg, n, k;
* Low-level lit-field update routine.
*/
static void
-set_lit(x, y, val)
-int x, y;
-genericptr_t val;
+set_lit(int x, int y, genericptr_t val)
{
struct monst *mtmp;
struct litmon *gremlin;
}
void
-litroom(on, obj)
-register boolean on;
-struct obj *obj;
+litroom(register boolean on, struct obj* obj)
{
char is_lit; /* value is irrelevant; we use its address
as a `not null' flag for set_lit() */
}
static void
-do_class_genocide()
+do_class_genocide(void)
{
int i, j, immunecnt, gonecnt, goodcnt, class, feel_dead = 0;
char buf[BUFSZ] = DUMMY;
#define PLAYER 2
#define ONTHRONE 4
void
-do_genocide(how)
-int how;
+do_genocide(int how)
+/* how: */
/* 0 = no genocide; create monsters (cursed scroll) */
/* 1 = normal genocide */
/* 3 = forced genocide of player */
}
void
-punish(sobj)
-struct obj *sobj;
+punish(struct obj* sobj)
{
struct obj *reuse_ball = (sobj && sobj->otyp == HEAVY_IRON_BALL)
? sobj : (struct obj *) 0;
/* remove the ball and chain */
void
-unpunish()
+unpunish(void)
{
struct obj *savechain = uchain;
* revive one, the disoriented creature becomes a zombie
*/
boolean
-cant_revive(mtype, revival, from_obj)
-int *mtype;
-boolean revival;
-struct obj *from_obj;
+cant_revive(int* mtype, boolean revival, struct obj* from_obj)
{
/* SHOPKEEPERS can be revived now */
if (*mtype == PM_GUARD || (*mtype == PM_SHOPKEEPER && !revival)
}
static boolean
-create_particular_parse(str, d)
-char *str;
-struct _create_particular_data *d;
+create_particular_parse(char* str, struct _create_particular_data* d)
{
int gender_name_var = NEUTRAL;
char *bufp = str;
}
static boolean
-create_particular_creation(d)
-struct _create_particular_data *d;
+create_particular_creation(struct _create_particular_data* d)
{
struct permonst *whichpm = NULL;
int i, mx, my, firstchoice = NON_PM;
* this code was also used for the scroll/spell in explore mode.
*/
boolean
-create_particular()
+create_particular(void)
{
#define CP_TRYLIM 5
struct _create_particular_data d;
#include "hack.h"
-int FDECL(get_rect_ind, (NhRect *));
+int get_rect_ind(NhRect *);
-static boolean FDECL(intersect, (NhRect *, NhRect *, NhRect *));
+static boolean intersect(NhRect *, NhRect *, NhRect *);
/*
* In this file, we will handle the various rectangle functions we
*/
void
-init_rect()
+init_rect(void)
{
rect_cnt = 1;
rect[0].lx = rect[0].ly = 0;
*/
int
-get_rect_ind(r)
-NhRect *r;
+get_rect_ind(NhRect* r)
{
register NhRect *rectp;
register int lx, ly, hx, hy;
*/
NhRect *
-get_rect(r)
-NhRect *r;
+get_rect(NhRect* r)
{
register NhRect *rectp;
register int lx, ly, hx, hy;
*/
NhRect *
-rnd_rect()
+rnd_rect(void)
{
return rect_cnt > 0 ? &rect[rn2(rect_cnt)] : 0;
}
*/
static boolean
-intersect(r1, r2, r3)
-NhRect *r1, *r2, *r3;
+intersect(NhRect* r1, NhRect* r2, NhRect* r3)
{
if (r2->lx > r1->hx || r2->ly > r1->hy || r2->hx < r1->lx
|| r2->hy < r1->ly)
*/
void
-remove_rect(r)
-NhRect *r;
+remove_rect(NhRect* r)
{
int ind;
*/
void
-add_rect(r)
-NhRect *r;
+add_rect(NhRect* r)
{
if (rect_cnt >= MAXRECT) {
if (wizard)
*/
void
-split_rects(r1, r2)
-NhRect *r1, *r2;
+split_rects(NhRect* r1, NhRect* r2)
{
NhRect r, old_r;
int i;
#define NO_CALLBACK (-1)
-boolean FDECL(inside_gas_cloud, (genericptr, genericptr));
-boolean FDECL(expire_gas_cloud, (genericptr, genericptr));
-boolean FDECL(inside_rect, (NhRect *, int, int));
-boolean FDECL(inside_region, (NhRegion *, int, int));
-NhRegion *FDECL(create_region, (NhRect *, int));
-void FDECL(add_rect_to_reg, (NhRegion *, NhRect *));
-void FDECL(add_mon_to_reg, (NhRegion *, struct monst *));
-void FDECL(remove_mon_from_reg, (NhRegion *, struct monst *));
-boolean FDECL(mon_in_region, (NhRegion *, struct monst *));
+boolean inside_gas_cloud(genericptr, genericptr);
+boolean expire_gas_cloud(genericptr, genericptr);
+boolean inside_rect(NhRect *, int, int);
+boolean inside_region(NhRegion *, int, int);
+NhRegion *create_region(NhRect *, int);
+void add_rect_to_reg(NhRegion *, NhRect *);
+void add_mon_to_reg(NhRegion *, struct monst *);
+void remove_mon_from_reg(NhRegion *, struct monst *);
+boolean mon_in_region(NhRegion *, struct monst *);
#if 0
-NhRegion *FDECL(clone_region, (NhRegion *));
+NhRegion *clone_region(NhRegion *);
#endif
-void FDECL(free_region, (NhRegion *));
-void FDECL(add_region, (NhRegion *));
-void FDECL(remove_region, (NhRegion *));
+void free_region(NhRegion *);
+void add_region(NhRegion *);
+void remove_region(NhRegion *);
#if 0
-void FDECL(replace_mon_regions, (struct monst *,struct monst *));
-void FDECL(remove_mon_from_regions, (struct monst *));
-NhRegion *FDECL(create_msg_region, (XCHAR_P,XCHAR_P,XCHAR_P,XCHAR_P,
- const char *,const char *));
-boolean FDECL(enter_force_field, (genericptr,genericptr));
-NhRegion *FDECL(create_force_field, (XCHAR_P,XCHAR_P,int,long));
+void replace_mon_regions(struct monst *,struct monst *);
+void remove_mon_from_regions(struct monst *);
+NhRegion *create_msg_region(xchar,xchar,xchar,xchar, const char *,
+ const char *);
+boolean enter_force_field(genericptr,genericptr);
+NhRegion *create_force_field(xchar,xchar,int,long);
#endif
-static void FDECL(reset_region_mids, (NhRegion *));
+static void reset_region_mids(NhRegion *);
static const callback_proc callbacks[] = {
#define INSIDE_GAS_CLOUD 0
/* Should be inlined. */
boolean
-inside_rect(r, x, y)
-NhRect *r;
-int x, y;
+inside_rect(NhRect* r, int x, int y)
{
return (boolean) (x >= r->lx && x <= r->hx && y >= r->ly && y <= r->hy);
}
* Check if a point is inside a region.
*/
boolean
-inside_region(reg, x, y)
-NhRegion *reg;
-int x, y;
+inside_region(NhRegion* reg, int x, int y)
{
int i;
* Create a region. It does not activate it.
*/
NhRegion *
-create_region(rects, nrect)
-NhRect *rects;
-int nrect;
+create_region(NhRect* rects, int nrect)
{
int i;
NhRegion *reg;
* Add rectangle to region.
*/
void
-add_rect_to_reg(reg, rect)
-NhRegion *reg;
-NhRect *rect;
+add_rect_to_reg(NhRegion* reg, NhRect* rect)
{
NhRect *tmp_rect;
* Add a monster to the region
*/
void
-add_mon_to_reg(reg, mon)
-NhRegion *reg;
-struct monst *mon;
+add_mon_to_reg(NhRegion* reg, struct monst* mon)
{
int i;
unsigned *tmp_m;
* Remove a monster from the region list (it left or died...)
*/
void
-remove_mon_from_reg(reg, mon)
-NhRegion *reg;
-struct monst *mon;
+remove_mon_from_reg(NhRegion* reg, struct monst* mon)
{
register int i;
* than to check for coordinates.
*/
boolean
-mon_in_region(reg, mon)
-NhRegion *reg;
-struct monst *mon;
+mon_in_region(NhRegion* reg, struct monst* mon)
{
int i;
* Free mem from region.
*/
void
-free_region(reg)
-NhRegion *reg;
+free_region(NhRegion* reg)
{
if (reg) {
if (reg->rects)
* This actually activates the region.
*/
void
-add_region(reg)
-NhRegion *reg;
+add_region(NhRegion* reg)
{
NhRegion **tmp_reg;
int i, j;
* Remove a region from the list & free it.
*/
void
-remove_region(reg)
-NhRegion *reg;
+remove_region(NhRegion* reg)
{
register int i, x, y;
* when changing level, for instance).
*/
void
-clear_regions()
+clear_regions(void)
{
register int i;
* callbacks when needed.
*/
void
-run_regions()
+run_regions(void)
{
register int i, j, k;
int f_indx;
* check whether player enters/leaves one or more regions.
*/
boolean
-in_out_region(x, y)
-xchar x, y;
+in_out_region(xchar x, xchar y)
{
int i, f_indx = 0;
* check whether a monster enters/leaves one or more regions.
*/
boolean
-m_in_out_region(mon, x, y)
-struct monst *mon;
-xchar x, y;
+m_in_out_region(struct monst* mon, xchar x, xchar y)
{
int i, f_indx = 0;
* Checks player's regions after a teleport for instance.
*/
void
-update_player_regions()
+update_player_regions(void)
{
register int i;
* Ditto for a specified monster.
*/
void
-update_monster_region(mon)
-struct monst *mon;
+update_monster_region(struct monst* mon)
{
register int i;
* Remove monster from all regions it was in (ie monster just died)
*/
void
-remove_mon_from_regions(mon)
-struct monst *mon;
+remove_mon_from_regions(struct monst* mon)
{
register int i;
* Returns NULL if not, otherwise returns region.
*/
NhRegion *
-visible_region_at(x, y)
-xchar x, y;
+visible_region_at(xchar x, xchar y)
{
register int i;
}
void
-show_region(reg, x, y)
-NhRegion *reg;
-xchar x, y;
+show_region(NhRegion* reg, xchar x, xchar y)
{
show_glyph(x, y, reg->glyph);
}
* save_regions :
*/
void
-save_regions(nhfp)
-NHFILE *nhfp;
+save_regions(NHFILE* nhfp)
{
int i, j;
unsigned n;
}
void
-rest_regions(nhfp)
-NHFILE *nhfp;
+rest_regions(NHFILE* nhfp)
{
int i, j;
unsigned n = 0;
/* to support '#stats' wizard-mode command */
void
-region_stats(hdrfmt, hdrbuf, count, size)
-const char *hdrfmt;
-char *hdrbuf;
-long *count, *size;
+region_stats(const char* hdrfmt, char* hdrbuf, long* count, long* size)
{
NhRegion *rg;
int i;
/* update monster IDs for region being loaded from bones; `ghostly' implied */
static void
-reset_region_mids(reg)
-NhRegion *reg;
+reset_region_mids(NhRegion* reg)
{
int i = 0, n = reg->n_monst;
unsigned *mid_list = reg->monsters;
*--------------------------------------------------------------*/
NhRegion *
-create_msg_region(x, y, w, h, msg_enter, msg_leave)
-xchar x, y;
-xchar w, h;
-const char *msg_enter;
-const char *msg_leave;
+create_msg_region(
+ xchar x, xchar y, xchar w, xchar h,
+ const char* msg_enter, const char* msg_leave)
{
NhRect tmprect;
NhRegion *reg = create_region((NhRect *) 0, 0);
*--------------------------------------------------------------*/
boolean
-enter_force_field(p1, p2)
-genericptr_t p1;
-genericptr_t p2;
+enter_force_field(genericptr_t p1, genericptr_t p2)
{
struct monst *mtmp;
}
NhRegion *
-create_force_field(x, y, radius, ttl)
-xchar x, y;
-int radius;
-long ttl;
+create_force_field(xchar x, xchar y, int radius, long ttl)
{
int i;
NhRegion *ff;
*/
/*ARGSUSED*/
boolean
-expire_gas_cloud(p1, p2)
-genericptr_t p1;
-genericptr_t p2 UNUSED;
+expire_gas_cloud(genericptr_t p1, genericptr_t p2 UNUSED)
{
NhRegion *reg;
int damage;
/* returns True if p2 is killed by region p1, False otherwise */
boolean
-inside_gas_cloud(p1, p2)
-genericptr_t p1;
-genericptr_t p2;
+inside_gas_cloud(genericptr_t p1, genericptr_t p2)
{
NhRegion *reg = (NhRegion *) p1;
struct monst *mtmp = (struct monst *) p2;
}
NhRegion *
-create_gas_cloud(x, y, radius, damage)
-xchar x, y;
-int radius;
-int damage;
+create_gas_cloud(xchar x, xchar y, int radius, int damage)
{
NhRegion *cloud;
int i, nrect;
/* for checking troubles during prayer; is hero at risk? */
boolean
-region_danger()
+region_danger(void)
{
int i, f_indx, n = 0;
/* for fixing trouble at end of prayer;
danger detected at start of prayer might have expired by now */
void
-region_safety()
+region_safety(void)
{
NhRegion *r = 0;
int i, f_indx, n = 0;
#endif
#ifdef USE_TILES
-extern void FDECL(substitute_tiles, (d_level *)); /* from tile.c */
+extern void substitute_tiles(d_level *); /* from tile.c */
#endif
#ifdef ZEROCOMP
-static void NDECL(zerocomp_minit);
-static void FDECL(zerocomp_mread, (int, genericptr_t, unsigned int));
-static int NDECL(zerocomp_mgetc);
+static void zerocomp_minit(void);
+static void zerocomp_mread(int, genericptr_t, unsigned int);
+static int zerocomp_mgetc(void);
#endif
-static void NDECL(find_lev_obj);
-static void FDECL(restlevchn, (NHFILE *));
-static void FDECL(restdamage, (NHFILE *));
-static void FDECL(restobj, (NHFILE *, struct obj *));
-static struct obj *FDECL(restobjchn, (NHFILE *, BOOLEAN_P));
-static void FDECL(restmon, (NHFILE *, struct monst *));
-static struct monst *FDECL(restmonchn, (NHFILE *));
-static struct fruit *FDECL(loadfruitchn, (NHFILE *));
-static void FDECL(freefruitchn, (struct fruit *));
-static void FDECL(ghostfruit, (struct obj *));
-static boolean FDECL(restgamestate, (NHFILE *, unsigned int *, unsigned int *));
-static void FDECL(restlevelstate, (unsigned int, unsigned int));
-static int FDECL(restlevelfile, (XCHAR_P));
-static void FDECL(restore_msghistory, (NHFILE *));
-static void FDECL(reset_oattached_mids, (BOOLEAN_P));
-static void FDECL(rest_levl, (NHFILE *, BOOLEAN_P));
-static void FDECL(rest_stairs, (NHFILE *));
+static void find_lev_obj(void);
+static void restlevchn(NHFILE *);
+static void restdamage(NHFILE *);
+static void restobj(NHFILE *, struct obj *);
+static struct obj *restobjchn(NHFILE *, boolean);
+static void restmon(NHFILE *, struct monst *);
+static struct monst *restmonchn(NHFILE *);
+static struct fruit *loadfruitchn(NHFILE *);
+static void freefruitchn(struct fruit *);
+static void ghostfruit(struct obj *);
+static boolean restgamestate(NHFILE *, unsigned int *, unsigned int *);
+static void restlevelstate(unsigned int, unsigned int);
+static int restlevelfile(xchar);
+static void restore_msghistory(NHFILE *);
+static void reset_oattached_mids(boolean);
+static void rest_levl(NHFILE *, boolean);
+static void rest_stairs(NHFILE *);
/*
* Save a mapping of IDs from ghost levels to the current level. This
} map[N_PER_BUCKET];
};
-static void NDECL(clear_id_mapping);
-static void FDECL(add_id_mapping, (unsigned, unsigned));
+static void clear_id_mapping(void);
+static void add_id_mapping(unsigned, unsigned);
#ifdef AMII_GRAPHICS
-void FDECL(amii_setpens, (int)); /* use colors from save file */
+void amii_setpens(int); /* use colors from save file */
extern int amii_numcolors;
#endif
/* Recalculate g.level.objects[x][y], since this info was not saved. */
static void
-find_lev_obj()
+find_lev_obj(void)
{
register struct obj *fobjtmp = (struct obj *) 0;
register struct obj *otmp;
* infamous "HUP" cheat) get used up here.
*/
void
-inven_inuse(quietly)
-boolean quietly;
+inven_inuse(boolean quietly)
{
register struct obj *otmp, *otmp2;
}
static void
-restlevchn(nhfp)
-NHFILE *nhfp;
+restlevchn(NHFILE* nhfp)
{
int cnt = 0;
s_level *tmplev, *x;
}
static void
-restdamage(nhfp)
-NHFILE *nhfp;
+restdamage(NHFILE* nhfp)
{
unsigned int dmgcount = 0;
int counter;
/* restore one object */
static void
-restobj(nhfp, otmp)
-NHFILE *nhfp;
-struct obj *otmp;
+restobj(NHFILE* nhfp, struct obj *otmp)
{
int buflen = 0;
}
static struct obj *
-restobjchn(nhfp, frozen)
-NHFILE *nhfp;
-boolean frozen;
+restobjchn(NHFILE* nhfp, boolean frozen)
{
register struct obj *otmp, *otmp2 = 0;
register struct obj *first = (struct obj *) 0;
/* restore one monster */
static void
-restmon(nhfp, mtmp)
-NHFILE *nhfp;
-struct monst *mtmp;
+restmon(NHFILE* nhfp, struct monst* mtmp)
{
int buflen = 0;
}
static struct monst *
-restmonchn(nhfp)
-NHFILE *nhfp;
+restmonchn(NHFILE* nhfp)
{
register struct monst *mtmp, *mtmp2 = 0;
register struct monst *first = (struct monst *) 0;
}
static struct fruit *
-loadfruitchn(nhfp)
-NHFILE *nhfp;
+loadfruitchn(NHFILE* nhfp)
{
register struct fruit *flist, *fnext;
}
static void
-freefruitchn(flist)
-register struct fruit *flist;
+freefruitchn(register struct fruit* flist)
{
register struct fruit *fnext;
}
static void
-ghostfruit(otmp)
-register struct obj *otmp;
+ghostfruit(register struct obj* otmp)
{
register struct fruit *oldf;
static
boolean
-restgamestate(nhfp, stuckid, steedid)
-NHFILE *nhfp;
-unsigned int *stuckid, *steedid;
+restgamestate(NHFILE* nhfp, unsigned int* stuckid, unsigned int* steedid)
{
struct flag newgameflags;
struct context_info newgamecontext; /* all 0, but has some pointers */
* don't dereference a wild u.ustuck when saving the game state, for instance)
*/
static void
-restlevelstate(stuckid, steedid)
-unsigned int stuckid, steedid;
+restlevelstate(unsigned int stuckid, unsigned int steedid)
{
register struct monst *mtmp;
/*ARGSUSED*/
static int
-restlevelfile(ltmp)
-xchar ltmp;
+restlevelfile(xchar ltmp)
{
char whynot[BUFSZ];
NHFILE *nhfp = (NHFILE *) 0;
}
int
-dorecover(nhfp)
-NHFILE *nhfp;
+dorecover(NHFILE* nhfp)
{
unsigned int stuckid = 0, steedid = 0; /* not a register */
xchar ltmp = 0;
}
static void
-rest_stairs(nhfp)
-NHFILE *nhfp;
+rest_stairs(NHFILE* nhfp)
{
int buflen = 0;
stairway stway = UNDEFINED_VALUES;
}
void
-restcemetery(nhfp, cemeteryaddr)
-NHFILE *nhfp;
-struct cemetery **cemeteryaddr;
+restcemetery(NHFILE* nhfp, struct cemetery** cemeteryaddr)
{
struct cemetery *bonesinfo, **bonesaddr;
int cflag = 0;
/*ARGSUSED*/
static void
-rest_levl(nhfp, rlecomp)
-NHFILE *nhfp;
+rest_levl(
+ NHFILE *nhfp,
#ifdef RLECOMP
-boolean rlecomp;
+ boolean rlecomp
#else
-boolean rlecomp UNUSED;
+ boolean rlecomp UNUSED
#endif
+)
{
#ifdef RLECOMP
short i, j;
}
void
-trickery(reason)
-char *reason;
+trickery(char *reason)
{
pline("Strange, this map is not as I remember it.");
pline("Somebody is trying some trickery here...");
}
void
-getlev(nhfp, pid, lev)
-NHFILE *nhfp;
-int pid;
-xchar lev;
+getlev(NHFILE* nhfp, int pid, xchar lev)
{
register struct trap *trap;
register struct monst *mtmp;
}
void
-get_plname_from_file(nhfp, plbuf)
-NHFILE *nhfp;
-char *plbuf;
+get_plname_from_file(NHFILE* nhfp, char *plbuf)
{
int pltmpsiz = 0;
}
static void
-restore_msghistory(nhfp)
-NHFILE *nhfp;
+restore_msghistory(NHFILE* nhfp)
{
int msgsize = 0, msgcount = 0;
char msg[BUFSZ];
/* Clear all structures for object and monster ID mapping. */
static void
-clear_id_mapping()
+clear_id_mapping(void)
{
struct bucket *curr;
/* Add a mapping to the ID map. */
static void
-add_id_mapping(gid, nid)
-unsigned gid, nid;
+add_id_mapping(unsigned int gid, unsigned int nid)
{
int idx;
* ID.
*/
boolean
-lookup_id_mapping(gid, nidp)
-unsigned gid, *nidp;
+lookup_id_mapping(unsigned int gid, unsigned int *nidp)
{
int i;
struct bucket *curr;
}
static void
-reset_oattached_mids(ghostly)
-boolean ghostly;
+reset_oattached_mids(boolean ghostly)
{
struct obj *otmp;
unsigned oldid, nid;
/* put up a menu listing each character from this player's saved games;
returns 1: use g.plname[], 0: new game, -1: quit */
int
-restore_menu(bannerwin)
-winid bannerwin; /* if not WIN_ERR, clear window and show copyright in menu */
+restore_menu(
+ winid bannerwin) /* if not WIN_ERR, clear window and show copyright in menu */
{
winid tmpwin;
anything any;
#endif /* SELECTSAVED */
int
-validate(nhfp, name)
-NHFILE *nhfp;
-const char *name;
+validate(NHFILE* nhfp, const char *name)
{
int rlen = 0;
struct savefile_info sfi;
#endif
#ifdef TEXT_TOMBSTONE
-static void FDECL(center, (int, char *));
+static void center(int, char *);
#ifndef NH320_DEDICATION
/* A normal tombstone for end of game display. */
#define YEAR_LINE 12 /* *char[] line # for year */
static void
-center(line, text)
-int line;
-char *text;
+center(int line, char *text)
{
register char *ip, *op;
ip = text;
}
void
-genl_outrip(tmpwin, how, when)
-winid tmpwin;
-int how;
-time_t when;
+genl_outrip(winid tmpwin, int how, time_t when)
{
register char **dp;
register char *dpx;
#ifdef USE_ISAAC64
#include "isaac64.h"
-static int FDECL(whichrng, (int FDECL((*fn), (int))));
+static int whichrng(int (*fn)(int));
#if 0
static isaac64_ctx rng_state;
#endif
struct rnglist_t {
- int FDECL((*fn), (int));
+ int (*fn)(int);
boolean init;
isaac64_ctx rng_state;
};
};
int
-whichrng(fn)
-int FDECL((*fn), (int));
+whichrng(int (*fn)(int))
{
int i;
}
void
-init_isaac64(seed, fn)
-unsigned long seed;
-int FDECL((*fn), (int));
+init_isaac64(unsigned long seed, int (*fn)(int))
{
unsigned char new_rng_state[sizeof seed];
unsigned i;
used in cases where the answer doesn't affect gameplay and we don't
want to give users easy control over the main RNG sequence. */
int
-rn2_on_display_rng(x)
-register int x;
+rn2_on_display_rng(register int x)
{
return (isaac64_next_uint64(&rnglist[DISP].rng_state) % x);
}
/* "Rand()"s definition is determined by [OS]conf.h */
#if defined(LINT) && defined(UNIX) /* rand() is long... */
-extern int NDECL(rand);
+extern int rand(void);
#define RND(x) (rand() % x)
#else /* LINT */
#if defined(UNIX) || defined(RANDOM)
#endif
#endif /* LINT */
int
-rn2_on_display_rng(x)
-register int x;
+rn2_on_display_rng(register int x)
{
static unsigned seed = 1;
seed *= 2739110765;
/* 0 <= rn2(x) < x */
int
-rn2(x)
-register int x;
+rn2(register int x)
{
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
if (x <= 0) {
/* 0 <= rnl(x) < x; sometimes subtracting Luck;
good luck approaches 0, bad luck approaches (x-1) */
int
-rnl(x)
-register int x;
+rnl(register int x)
{
register int i, adjustment;
/* 1 <= rnd(x) <= x */
int
-rnd(x)
-register int x;
+rnd(register int x)
{
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
if (x <= 0) {
/* d(N,X) == NdX == dX+dX+...+dX N times; n <= d(n,x) <= (n*x) */
int
-d(n, x)
-register int n, x;
+d(register int n, register int x)
{
register int tmp = n;
/* 1 <= rne(x) <= max(u.ulevel/3,5) */
int
-rne(x)
-register int x;
+rne(register int x)
{
register int tmp, utmp;
/* rnz: everyone's favorite! */
int
-rnz(i)
-int i;
+rnz(int i)
{
#ifdef LINT
int x = i;
{ "evil", "unaligned", "Una", 0, A_NONE }
};
-static int NDECL(randrole_filtered);
-static char *FDECL(promptsep, (char *, int));
-static int FDECL(role_gendercount, (int));
-static int FDECL(race_alignmentcount, (int));
+static int randrole_filtered(void);
+static char *promptsep(char *, int);
+static int role_gendercount(int);
+static int race_alignmentcount(int);
/* used by str2XXX() */
static char NEARDATA randomstr[] = "random";
boolean
-validrole(rolenum)
-int rolenum;
+validrole(int rolenum)
{
return (boolean) (rolenum >= 0 && rolenum < SIZE(roles) - 1);
}
int
-randrole(for_display)
-boolean for_display;
+randrole(boolean for_display)
{
int res = SIZE(roles) - 1;
}
static int
-randrole_filtered()
+randrole_filtered(void)
{
int i, n = 0, set[SIZE(roles)];
}
int
-str2role(str)
-const char *str;
+str2role(const char *str)
{
int i, len;
}
boolean
-validrace(rolenum, racenum)
-int rolenum, racenum;
+validrace(int rolenum, int racenum)
{
/* Assumes validrole */
return (boolean) (racenum >= 0 && racenum < SIZE(races) - 1
}
int
-randrace(rolenum)
-int rolenum;
+randrace(int rolenum)
{
int i, n = 0;
}
int
-str2race(str)
-const char *str;
+str2race(const char *str)
{
int i, len;
}
boolean
-validgend(rolenum, racenum, gendnum)
-int rolenum, racenum, gendnum;
+validgend(int rolenum, int racenum, int gendnum)
{
/* Assumes validrole and validrace */
return (boolean) (gendnum >= 0 && gendnum < ROLE_GENDERS
}
int
-randgend(rolenum, racenum)
-int rolenum, racenum;
+randgend(int rolenum, int racenum)
{
int i, n = 0;
}
int
-str2gend(str)
-const char *str;
+str2gend(const char *str)
{
int i, len;
}
boolean
-validalign(rolenum, racenum, alignnum)
-int rolenum, racenum, alignnum;
+validalign(int rolenum, int racenum, int alignnum)
{
/* Assumes validrole and validrace */
return (boolean) (alignnum >= 0 && alignnum < ROLE_ALIGNS
}
int
-randalign(rolenum, racenum)
-int rolenum, racenum;
+randalign(int rolenum, int racenum)
{
int i, n = 0;
}
int
-str2align(str)
-const char *str;
+str2align(const char *str)
{
int i, len;
/* is rolenum compatible with any racenum/gendnum/alignnum constraints? */
boolean
-ok_role(rolenum, racenum, gendnum, alignnum)
-int rolenum, racenum, gendnum, alignnum;
+ok_role(int rolenum, int racenum, int gendnum, int alignnum)
{
int i;
short allow;
/* If pickhow == PICK_RIGID a role is returned only if there is */
/* a single possibility */
int
-pick_role(racenum, gendnum, alignnum, pickhow)
-int racenum, gendnum, alignnum, pickhow;
+pick_role(int racenum, int gendnum, int alignnum, int pickhow)
{
int i;
int roles_ok = 0, set[SIZE(roles)];
/* is racenum compatible with any rolenum/gendnum/alignnum constraints? */
boolean
-ok_race(rolenum, racenum, gendnum, alignnum)
-int rolenum, racenum, gendnum, alignnum;
+ok_race(int rolenum, int racenum, int gendnum, int alignnum)
{
int i;
short allow;
If pickhow == PICK_RIGID a race is returned only if there is
a single possibility. */
int
-pick_race(rolenum, gendnum, alignnum, pickhow)
-int rolenum, gendnum, alignnum, pickhow;
+pick_race(int rolenum, int gendnum, int alignnum, int pickhow)
{
int i;
int races_ok = 0;
/* is gendnum compatible with any rolenum/racenum/alignnum constraints? */
/* gender and alignment are not comparable (and also not constrainable) */
boolean
-ok_gend(rolenum, racenum, gendnum, alignnum)
-int rolenum, racenum, gendnum;
-int alignnum UNUSED;
+ok_gend(int rolenum, int racenum, int gendnum, int alignnum UNUSED)
{
int i;
short allow;
/* If pickhow == PICK_RIGID a gender is returned only if there is */
/* a single possibility */
int
-pick_gend(rolenum, racenum, alignnum, pickhow)
-int rolenum, racenum, alignnum, pickhow;
+pick_gend(int rolenum, int racenum, int alignnum, int pickhow)
{
int i;
int gends_ok = 0;
/* is alignnum compatible with any rolenum/racenum/gendnum constraints? */
/* alignment and gender are not comparable (and also not constrainable) */
boolean
-ok_align(rolenum, racenum, gendnum, alignnum)
-int rolenum, racenum;
-int gendnum UNUSED;
-int alignnum;
+ok_align(int rolenum, int racenum, int gendnum UNUSED, int alignnum)
{
int i;
short allow;
If pickhow == PICK_RIGID an alignment is returned only if there is
a single possibility. */
int
-pick_align(rolenum, racenum, gendnum, pickhow)
-int rolenum, racenum, gendnum, pickhow;
+pick_align(int rolenum, int racenum, int gendnum, int pickhow)
{
int i;
int aligns_ok = 0;
}
void
-rigid_role_checks()
+rigid_role_checks(void)
{
int tmp;
}
boolean
-setrolefilter(bufp)
-const char *bufp;
+setrolefilter(const char *bufp)
{
int i;
boolean reslt = TRUE;
}
boolean
-gotrolefilter()
+gotrolefilter(void)
{
int i;
}
void
-clearrolefilter()
+clearrolefilter(void)
{
int i;
}
static char *
-promptsep(buf, num_post_attribs)
-char *buf;
-int num_post_attribs;
+promptsep(char *buf, int num_post_attribs)
{
const char *conjuct = "and ";
}
static int
-role_gendercount(rolenum)
-int rolenum;
+role_gendercount(int rolenum)
{
int gendcount = 0;
}
static int
-race_alignmentcount(racenum)
-int racenum;
+race_alignmentcount(int racenum)
{
int aligncount = 0;
}
char *
-root_plselection_prompt(suppliedbuf, buflen, rolenum, racenum, gendnum,
- alignnum)
-char *suppliedbuf;
-int buflen, rolenum, racenum, gendnum, alignnum;
+root_plselection_prompt(
+ char *suppliedbuf, int buflen,
+ int rolenum, int racenum, int gendnum, int alignnum)
{
int k, gendercount = 0, aligncount = 0;
char buf[BUFSZ];
}
char *
-build_plselection_prompt(buf, buflen, rolenum, racenum, gendnum, alignnum)
-char *buf;
-int buflen, rolenum, racenum, gendnum, alignnum;
+build_plselection_prompt(
+ char *buf, int buflen,
+ int rolenum, int racenum, int gendnum, int alignnum)
{
const char *defprompt = "Shall I pick a character for you? [ynaq] ";
int num_post_attribs = 0;
#undef NUM_BP
void
-plnamesuffix()
+plnamesuffix(void)
{
char *sptr, *eptr;
int i;
/* show current settings for name, role, race, gender, and alignment
in the specified window */
void
-role_selection_prolog(which, where)
-int which;
-winid where;
+role_selection_prolog(int which, winid where)
{
static const char NEARDATA choosing[] = " choosing now",
not_yet[] = " not yet specified",
/* add a "pick alignment first"-type entry to the specified menu */
void
-role_menu_extra(which, where, preselect)
-int which;
-winid where;
-boolean preselect;
+role_menu_extra(int which, winid where, boolean preselect)
{
static NEARDATA const char RS_menu_let[] = {
'=', /* name */
* This code also replaces quest_init().
*/
void
-role_init()
+role_init(void)
{
int alignmnt;
struct permonst *pm;
}
const char *
-Hello(mtmp)
-struct monst *mtmp;
+Hello(struct monst* mtmp)
{
switch (Role_switch) {
case PM_KNIGHT:
}
const char *
-Goodbye()
+Goodbye(void)
{
switch (Role_switch) {
case PM_KNIGHT:
* and placed there by 'makedefs'.
*/
-static void FDECL(init_rumors, (dlb *));
-static void FDECL(init_oracles, (dlb *));
-static void FDECL(others_check, (const char *ftype, const char *, winid *));
-static void FDECL(couldnt_open_file, (const char *));
+static void init_rumors(dlb *);
+static void init_oracles(dlb *);
+static void others_check(const char *ftype, const char *, winid *);
+static void couldnt_open_file(const char *);
static void
-init_rumors(fp)
-dlb *fp;
+init_rumors(dlb* fp)
{
static const char rumors_header[] = "%d,%ld,%lx;%d,%ld,%lx;0,0,%lx\n";
int true_count, false_count; /* in file but not used here */
* of them contain such references anyway.
*/
char *
-getrumor(truth, rumor_buf, exclude_cookie)
-int truth; /* 1=true, -1=false, 0=either */
-char *rumor_buf;
-boolean exclude_cookie;
+getrumor(
+ int truth, /* 1=true, -1=false, 0=either */
+ char *rumor_buf,
+ boolean exclude_cookie)
{
dlb *rumors;
long tidbit, beginning;
/* test that the true/false rumor boundaries are valid and show the first
two and very last epitaphs, engravings, and bogus monsters */
void
-rumor_check()
+rumor_check(void)
{
dlb *rumors = 0;
winid tmpwin = WIN_ERR;
/* 3.7: augments rumors_check(); test 'engrave' or 'epitaph' or 'bogusmon' */
static void
-others_check(ftype, fname, winptr)
-const char *ftype, *fname;
-winid *winptr;
+others_check(const char* ftype, const char* fname, winid* winptr)
{
static const char errfmt[] = "others_check(\"%s\"): %s";
dlb *fh;
/* Gets a random line of text from file 'fname', and returns it.
rng is the random number generator to use, and should act like rn2 does. */
char *
-get_rnd_text(fname, buf, rng)
-const char *fname;
-char *buf;
-int FDECL((*rng), (int));
+get_rnd_text(const char* fname, char* buf, int (*rng)(int))
{
dlb *fh;
}
void
-outrumor(truth, mechanism)
-int truth; /* 1=true, -1=false, 0=either */
-int mechanism;
+outrumor(
+ int truth, /* 1=true, -1=false, 0=either */
+ int mechanism)
{
static const char fortune_msg[] =
"This cookie has a scrap of paper inside.";
}
static void
-init_oracles(fp)
-dlb *fp;
+init_oracles(dlb* fp)
{
register int i;
char line[BUFSZ];
}
void
-save_oracles(nhfp)
-NHFILE *nhfp;
+save_oracles(NHFILE* nhfp)
{
if (perform_bwrite(nhfp)) {
if (nhfp->structlevel)
}
void
-restore_oracles(nhfp)
-NHFILE *nhfp;
+restore_oracles(NHFILE* nhfp)
{
if (nhfp->structlevel)
mread(nhfp->fd, (genericptr_t) &g.oracle_cnt, sizeof g.oracle_cnt);
}
void
-outoracle(special, delphi)
-boolean special;
-boolean delphi;
+outoracle(boolean special, boolean delphi)
{
winid tmpwin;
dlb *oracles;
}
int
-doconsult(oracl)
-struct monst *oracl;
+doconsult(struct monst* oracl)
{
long umoney;
int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel;
}
static void
-couldnt_open_file(filename)
-const char *filename;
+couldnt_open_file(const char *filename)
{
int save_something = g.program_state.something_worth_saving;
int dotcnt, dotrow; /* also used in restore */
#endif
-static void FDECL(savelevchn, (NHFILE *));
-static void FDECL(savelevl, (NHFILE *,BOOLEAN_P));
-static void FDECL(savedamage, (NHFILE *));
-static void FDECL(save_stairs, (NHFILE *));
-static void FDECL(saveobj, (NHFILE *,struct obj *));
-static void FDECL(saveobjchn, (NHFILE *,struct obj **));
-static void FDECL(savemon, (NHFILE *,struct monst *));
-static void FDECL(savemonchn, (NHFILE *,struct monst *));
-static void FDECL(savetrapchn, (NHFILE *,struct trap *));
-static void FDECL(savegamestate, (NHFILE *));
-static void FDECL(save_msghistory, (NHFILE *));
+static void savelevchn(NHFILE *);
+static void savelevl(NHFILE *,boolean);
+static void savedamage(NHFILE *);
+static void save_stairs(NHFILE *);
+static void saveobj(NHFILE *,struct obj *);
+static void saveobjchn(NHFILE *,struct obj **);
+static void savemon(NHFILE *,struct monst *);
+static void savemonchn(NHFILE *,struct monst *);
+static void savetrapchn(NHFILE *,struct trap *);
+static void savegamestate(NHFILE *);
+static void save_msghistory(NHFILE *);
#ifdef ZEROCOMP
-static void FDECL(zerocomp_bufon, (int));
-static void FDECL(zerocomp_bufoff, (int));
-static void FDECL(zerocomp_bflush, (int));
-static void FDECL(zerocomp_bwrite, (int, genericptr_t, unsigned int));
-static void FDECL(zerocomp_bputc, (int));
+static void zerocomp_bufon(int);
+static void zerocomp_bufoff(int);
+static void zerocomp_bflush(int);
+static void zerocomp_bwrite(int, genericptr_t, unsigned int);
+static void zerocomp_bputc(int);
#endif
#if defined(UNIX) || defined(VMS) || defined(__EMX__) || defined(WIN32)
#endif
int
-dosave()
+dosave(void)
{
if (iflags.debug_fuzzer)
return 0;
/* returns 1 if save successful */
int
-dosave0()
+dosave0(void)
{
const char *fq_save;
xchar ltmp;
fq_save = fqname(g.SAVEF, SAVEPREFIX, 1); /* level files take 0 */
#ifndef NO_SIGNAL
#if defined(UNIX) || defined(VMS)
- sethanguphandler((void FDECL((*), (int) )) SIG_IGN);
+ sethanguphandler((void (*)(int) ) SIG_IGN);
#endif
(void) signal(SIGINT, SIG_IGN);
#endif
}
static void
-savegamestate(nhfp)
-NHFILE *nhfp;
+savegamestate(NHFILE* nhfp)
{
unsigned long uid;
struct obj *bc_objs = (struct obj *)0;
/* potentially called from goto_level(do.c) as well as savestateinlock() */
boolean
-tricked_fileremoved(nhfp, whynot)
-NHFILE *nhfp;
-char *whynot;
+tricked_fileremoved(NHFILE* nhfp, char* whynot)
{
if (!nhfp) {
pline1(whynot);
#ifdef INSURANCE
void
-savestateinlock()
+savestateinlock(void)
{
int hpid = 0;
char whynot[BUFSZ];
#endif
void
-savelev(nhfp, lev)
-NHFILE *nhfp;
-xchar lev;
+savelev(NHFILE* nhfp, xchar lev)
{
#ifdef TOS
short tlev;
}
static void
-savelevl(nhfp, rlecomp)
-NHFILE *nhfp;
-boolean rlecomp;
+savelevl(NHFILE* nhfp, boolean rlecomp)
{
#ifdef RLECOMP
struct rm *prm, *rgrm;
/* used when saving a level and also when saving dungeon overview data */
void
-savecemetery(nhfp, cemeteryaddr)
-NHFILE *nhfp;
-struct cemetery **cemeteryaddr;
+savecemetery(NHFILE* nhfp, struct cemetery** cemeteryaddr)
{
struct cemetery *thisbones, *nextbones;
int flag;
}
static void
-savedamage(nhfp)
-NHFILE *nhfp;
+savedamage(NHFILE* nhfp)
{
register struct damage *damageptr, *tmp_dam;
unsigned int xl = 0;
}
static void
-save_stairs(nhfp)
-NHFILE *nhfp;
+save_stairs(NHFILE* nhfp)
{
stairway *stway = g.stairs;
int buflen = (int) sizeof *stway;
/* save one object;
caveat: this is only for perform_bwrite(); caller handles release_data() */
static void
-saveobj(nhfp, otmp)
-NHFILE *nhfp;
-struct obj *otmp;
+saveobj(NHFILE* nhfp, struct obj* otmp)
{
int buflen, zerobuf = 0;
/* save an object chain; sets head of list to Null when done;
handles release_data() for each object in the list */
static void
-saveobjchn(nhfp, obj_p)
-NHFILE *nhfp;
-struct obj **obj_p;
+saveobjchn(NHFILE* nhfp, struct obj** obj_p)
{
register struct obj *otmp = *obj_p;
struct obj *otmp2;
}
static void
-savemon(nhfp, mtmp)
-NHFILE *nhfp;
-struct monst *mtmp;
+savemon(NHFILE* nhfp, struct monst* mtmp)
{
int buflen;
}
static void
-savemonchn(nhfp, mtmp)
-NHFILE *nhfp;
-register struct monst *mtmp;
+savemonchn(NHFILE* nhfp, register struct monst* mtmp)
{
register struct monst *mtmp2;
int minusone = -1;
/* save traps; g.ftrap is the only trap chain so the 2nd arg is superfluous */
static void
-savetrapchn(nhfp, trap)
-NHFILE *nhfp;
-register struct trap *trap;
+savetrapchn(NHFILE* nhfp, register struct trap* trap)
{
static struct trap zerotrap;
register struct trap *trap2;
* level routine marks nonexistent fruits by making the fid negative.
*/
void
-savefruitchn(nhfp)
-NHFILE *nhfp;
+savefruitchn(NHFILE* nhfp)
{
static struct fruit zerofruit;
register struct fruit *f2, *f1;
static void
-savelevchn(nhfp)
-NHFILE *nhfp;
+savelevchn(NHFILE* nhfp)
{
s_level *tmplev, *tmplev2;
int cnt = 0;
}
void
-store_plname_in_file(nhfp)
-NHFILE *nhfp;
+store_plname_in_file(NHFILE* nhfp)
{
int plsiztmp = PL_NSIZ;
}
static void
-save_msghistory(nhfp)
-NHFILE *nhfp;
+save_msghistory(NHFILE* nhfp)
{
char *msg;
int msgcount = 0, msglen;
}
void
-store_savefileinfo(nhfp)
-NHFILE *nhfp;
+store_savefileinfo(NHFILE* nhfp)
{
/* sfcap (decl.c) describes the savefile feature capabilities
* that are supported by this port/platform build.
/* also called by prscore(); this probably belongs in dungeon.c... */
void
-free_dungeons()
+free_dungeons(void)
{
#ifdef FREE_ALL_MEMORY
NHFILE tnhfp;
}
void
-freedynamicdata()
+freedynamicdata(void)
{
NHFILE tnhfp;
#ifdef minit
#undef minit
#endif
-void FDECL(newread, (NHFILE *, int, int, genericptr_t, unsigned int));
-void FDECL(bufon, (int));
-void FDECL(bufoff, (int));
-void FDECL(bflush, (int));
-void FDECL(bwrite, (int, genericptr_t, unsigned int));
-void FDECL(mread, (int, genericptr_t, unsigned int));
-void NDECL(minit);
-void FDECL(bclose, (int));
+void newread(NHFILE *, int, int, genericptr_t, unsigned int);
+void bufon(int);
+void bufoff(int);
+void bflush(int);
+void bwrite(int, genericptr_t, unsigned int);
+void mread(int, genericptr_t, unsigned int);
+void minit(void);
+void bclose(int);
#endif /* TRACE_BUFFERING */
-static int FDECL(getidx, (int, int));
+static int getidx(int, int);
#if defined(UNIX) || defined(WIN32)
#define USE_BUFFERING
*/
static int
-getidx(fd, flg)
-int fd, flg;
+getidx(int fd, int flg)
{
int i, retval = -1;
/* Let caller know that bclose() should handle it (TRUE) */
boolean
-close_check(fd)
-int fd;
+close_check(int fd)
{
int idx = getidx(fd, NOSLOT);
boolean retval = FALSE;
}
void
-bufon(fd)
-int fd;
+bufon(int fd)
{
int idx = getidx(fd, NOFLG);
}
void
-bufoff(fd)
-int fd;
+bufoff(int fd)
{
int idx = getidx(fd, NOFLG);
}
void
-bclose(fd)
-int fd;
+bclose(int fd)
{
int idx = getidx(fd, NOSLOT);
}
void
-bflush(fd)
-int fd;
+bflush(int fd)
{
int idx = getidx(fd, NOFLG);
}
void
-bwrite(fd, loc, num)
-register int fd;
-register genericptr_t loc;
-register unsigned num;
+bwrite(register int fd, register genericptr_t loc, register unsigned num)
{
boolean failed;
int idx = getidx(fd, NOFLG);
/* ===================================================== */
void
-minit()
+minit(void)
{
return;
}
void
-mread(fd, buf, len)
-register int fd;
-register genericptr_t buf;
-register unsigned int len;
+mread(register int fd, register genericptr_t buf, register unsigned int len)
{
register int rlen;
#if defined(BSD) || defined(ULTRIX)
fclose(tracefile);
void
-Bufon(fd, fncname, linenum)
-int fd;
-const char *fncname;
-int linenum;
+Bufon(int fd, const char *fncname, int linenum)
{
TRACE(fd);
bufon(fd);
}
void
-Bufoff(fd, fncname, linenum)
-int fd;
-const char *fncname;
-int linenum;
+Bufoff(int fd, const char *fncname, int linenum)
{
TRACE(fd);
bufoff(fd);
}
void
-Bflush(fd, fncname, linenum)
-int fd;
-const char *fncname;
-int linenum;
+Bflush(int fd, const char* fncname, int linenum)
{
TRACE(fd);
bflush(fd);
}
void
-Bwrite(fd, loc, num, fncname, linenum)
-register int fd;
-register genericptr_t loc;
-register unsigned num;
-const char *fncname;
-int linenum;
+Bwrite(
+ register int fd,
+ register genericptr_t loc,
+ register unsigned num,
+ const char *fncname,
+ int linenum)
{
TRACE(fd);
bwrite(fd, loc, num);
}
void
-Bclose(fd, fncname, linenum)
-int fd;
-const char *fncname;
-int linenum;
+Bclose(int fd, const char *fncname, int linenum)
{
TRACE(fd);
bclose(fd);
}
void
-Minit(fncname, linenum)
-const char *fncname;
-int linenum;
+Minit(const char*fncname, int linenum)
{
TRACE(-1);
minit();
}
void
-Mread(fd, buf, len, fncname, linenum)
-register int fd;
-register genericptr_t buf;
-register unsigned int len;
-const char *fncname;
-int linenum;
+Mread(
+ register int fd,
+ register genericptr_t buf,
+ register unsigned int len,
+ const char *fncname,
+ int linenum)
{
TRACE(fd);
mread(fd, buf, len);
#define PAY_SKIP (-1)
#define PAY_BROKE (-2)
-static void FDECL(makekops, (coord *));
-static void FDECL(call_kops, (struct monst *, BOOLEAN_P));
-static void FDECL(kops_gone, (BOOLEAN_P));
+static void makekops(coord *);
+static void call_kops(struct monst *, boolean);
+static void kops_gone(boolean);
#define NOTANGRY(mon) ((mon)->mpeaceful)
#define ANGRY(mon) (!NOTANGRY(mon))
static const char and_its_contents[] = " and its contents";
static const char the_contents_of[] = "the contents of ";
-static void FDECL(append_honorific, (char *));
-static long FDECL(addupbill, (struct monst *));
-static void FDECL(pacify_shk, (struct monst *));
-static struct bill_x *FDECL(onbill, (struct obj *, struct monst *,
- BOOLEAN_P));
-static struct monst *FDECL(next_shkp, (struct monst *, BOOLEAN_P));
-static long FDECL(shop_debt, (struct eshk *));
-static char *FDECL(shk_owns, (char *, struct obj *));
-static char *FDECL(mon_owns, (char *, struct obj *));
-static void FDECL(clear_unpaid_obj, (struct monst *, struct obj *));
-static void FDECL(clear_unpaid, (struct monst *, struct obj *));
-static long FDECL(check_credit, (long, struct monst *));
-static void FDECL(pay, (long, struct monst *));
-static long FDECL(get_cost, (struct obj *, struct monst *));
-static long FDECL(set_cost, (struct obj *, struct monst *));
-static const char *FDECL(shk_embellish, (struct obj *, long));
-static long FDECL(cost_per_charge, (struct monst *, struct obj *,
- BOOLEAN_P));
-static long FDECL(cheapest_item, (struct monst *));
-static int FDECL(dopayobj, (struct monst *, struct bill_x *,
- struct obj **, int, BOOLEAN_P));
-static long FDECL(stolen_container, (struct obj *, struct monst *,
- long, BOOLEAN_P));
-static long FDECL(getprice, (struct obj *, BOOLEAN_P));
-static void FDECL(shk_names_obj, (struct monst *, struct obj *,
- const char *, long, const char *));
-static boolean FDECL(inherits, (struct monst *, int, int, BOOLEAN_P));
-static void FDECL(set_repo_loc, (struct monst *));
-static struct obj *FDECL(bp_to_obj, (struct bill_x *));
-static long FDECL(get_pricing_units, (struct obj *));
-static boolean NDECL(angry_shk_exists);
-static void FDECL(rile_shk, (struct monst *));
-static void FDECL(rouse_shk, (struct monst *, BOOLEAN_P));
-static void FDECL(remove_damage, (struct monst *, BOOLEAN_P));
-static void FDECL(sub_one_frombill, (struct obj *, struct monst *));
-static void FDECL(add_one_tobill, (struct obj *, BOOLEAN_P,
- struct monst *));
-static void FDECL(dropped_container, (struct obj *, struct monst *,
- BOOLEAN_P));
-static void FDECL(add_to_billobjs, (struct obj *));
-static void FDECL(bill_box_content, (struct obj *, BOOLEAN_P, BOOLEAN_P,
- struct monst *));
-static boolean FDECL(rob_shop, (struct monst *));
-static void FDECL(deserted_shop, (char *));
-static boolean FDECL(special_stock, (struct obj *, struct monst *,
- BOOLEAN_P));
-static const char *FDECL(cad, (BOOLEAN_P));
+static void append_honorific(char *);
+static long addupbill(struct monst *);
+static void pacify_shk(struct monst *);
+static struct bill_x *onbill(struct obj *, struct monst *, boolean);
+static struct monst *next_shkp(struct monst *, boolean);
+static long shop_debt(struct eshk *);
+static char *shk_owns(char *, struct obj *);
+static char *mon_owns(char *, struct obj *);
+static void clear_unpaid_obj(struct monst *, struct obj *);
+static void clear_unpaid(struct monst *, struct obj *);
+static long check_credit(long, struct monst *);
+static void pay(long, struct monst *);
+static long get_cost(struct obj *, struct monst *);
+static long set_cost(struct obj *, struct monst *);
+static const char *shk_embellish(struct obj *, long);
+static long cost_per_charge(struct monst *, struct obj *, boolean);
+static long cheapest_item(struct monst *);
+static int dopayobj(struct monst *, struct bill_x *, struct obj **, int,
+ boolean);
+static long stolen_container(struct obj *, struct monst *, long, boolean);
+static long getprice(struct obj *, boolean);
+static void shk_names_obj(struct monst *, struct obj *, const char *, long,
+ const char *);
+static boolean inherits(struct monst *, int, int, boolean);
+static void set_repo_loc(struct monst *);
+static struct obj *bp_to_obj(struct bill_x *);
+static long get_pricing_units(struct obj *);
+static boolean angry_shk_exists(void);
+static void rile_shk(struct monst *);
+static void rouse_shk(struct monst *, boolean);
+static void remove_damage(struct monst *, boolean);
+static void sub_one_frombill(struct obj *, struct monst *);
+static void add_one_tobill(struct obj *, boolean, struct monst *);
+static void dropped_container(struct obj *, struct monst *, boolean);
+static void add_to_billobjs(struct obj *);
+static void bill_box_content(struct obj *, boolean, boolean,
+ struct monst *);
+static boolean rob_shop(struct monst *);
+static void deserted_shop(char *);
+static boolean special_stock(struct obj *, struct monst *, boolean);
+static const char *cad(boolean);
/*
invariants: obj->unpaid iff onbill(obj) [unless bp->useup]
* if the monster kept the change.
*/
long
-money2mon(mon, amount)
-struct monst *mon;
-long amount;
+money2mon(struct monst* mon, long amount)
{
struct obj *ygold = findgold(g.invent);
* the priest gives you money for an ale.
*/
void
-money2u(mon, amount)
-struct monst *mon;
-long amount;
+money2u(struct monst* mon, long amount)
{
struct obj *mongold = findgold(mon->minvent);
}
static struct monst *
-next_shkp(shkp, withbill)
-register struct monst *shkp;
-register boolean withbill;
+next_shkp(register struct monst* shkp, register boolean withbill)
{
for (; shkp; shkp = shkp->nmon) {
if (DEADMONSTER(shkp))
/* called in mon.c */
void
-shkgone(mtmp)
-struct monst *mtmp;
+shkgone(struct monst* mtmp)
{
struct eshk *eshk = ESHK(mtmp);
struct mkroom *sroom = &g.rooms[eshk->shoproom - ROOMOFFSET];
}
void
-set_residency(shkp, zero_out)
-register struct monst *shkp;
-register boolean zero_out;
+set_residency(register struct monst* shkp, register boolean zero_out)
{
if (on_level(&(ESHK(shkp)->shoplevel), &u.uz))
g.rooms[ESHK(shkp)->shoproom - ROOMOFFSET].resident =
}
void
-replshk(mtmp, mtmp2)
-register struct monst *mtmp, *mtmp2;
+replshk(register struct monst* mtmp, register struct monst* mtmp2)
{
g.rooms[ESHK(mtmp2)->shoproom - ROOMOFFSET].resident = mtmp2;
if (inhishop(mtmp) && *u.ushops == ESHK(mtmp)->shoproom) {
/* do shopkeeper specific structure munging -dlc */
void
-restshk(shkp, ghostly)
-struct monst *shkp;
-boolean ghostly;
+restshk(struct monst* shkp, boolean ghostly)
{
if (u.uz.dlevel) {
struct eshk *eshkp = ESHK(shkp);
/* Clear the unpaid bit on a single object and its contents. */
static void
-clear_unpaid_obj(shkp, otmp)
-struct monst *shkp;
-struct obj *otmp;
+clear_unpaid_obj(struct monst* shkp, struct obj* otmp)
{
if (Has_contents(otmp))
clear_unpaid(shkp, otmp->cobj);
/* Clear the unpaid bit on all of the objects in the list. */
static void
-clear_unpaid(shkp, list)
-struct monst *shkp;
-struct obj *list;
+clear_unpaid(struct monst* shkp, struct obj* list)
{
while (list) {
clear_unpaid_obj(shkp, list);
/* either you paid or left the shop or the shopkeeper died */
void
-setpaid(shkp)
-register struct monst *shkp;
+setpaid(register struct monst* shkp)
{
register struct obj *obj;
register struct monst *mtmp;
}
static long
-addupbill(shkp)
-register struct monst *shkp;
+addupbill(register struct monst* shkp)
{
register int ct = ESHK(shkp)->billct;
register struct bill_x *bp = ESHK(shkp)->bill_p;
}
static void
-call_kops(shkp, nearshop)
-register struct monst *shkp;
-register boolean nearshop;
+call_kops(register struct monst* shkp, register boolean nearshop)
{
/* Keystone Kops srt@ucla */
register boolean nokops;
/* x,y is strictly inside shop */
char
-inside_shop(x, y)
-register xchar x, y;
+inside_shop(register xchar x, register xchar y)
{
register char rno;
}
void
-u_left_shop(leavestring, newlev)
-char *leavestring;
-boolean newlev;
+u_left_shop(char* leavestring, boolean newlev)
{
struct monst *shkp;
struct eshk *eshkp;
/* robbery from outside the shop via telekinesis or grappling hook */
void
-remote_burglary(x, y)
-xchar x, y;
+remote_burglary(xchar x, xchar y)
{
struct monst *shkp;
struct eshk *eshkp;
/* shop merchandise has been taken; pay for it with any credit available;
return false if the debt is fully covered by credit, true otherwise */
static boolean
-rob_shop(shkp)
-struct monst *shkp;
+rob_shop(struct monst* shkp)
{
struct eshk *eshkp;
long total;
/* give a message when entering an untended shop (caller has verified that) */
static void
-deserted_shop(enterstring)
-/*const*/ char *enterstring;
+deserted_shop(/*const*/ char* enterstring)
{
struct monst *mtmp;
struct mkroom *r = &g.rooms[(int) *enterstring - ROOMOFFSET];
}
void
-u_entered_shop(enterstring)
-char *enterstring;
+u_entered_shop(char* enterstring)
{
register int rt;
register struct monst *shkp;
/* called when removing a pick-axe or mattock from a container */
void
-pick_pick(obj)
-struct obj *obj;
+pick_pick(struct obj* obj)
{
struct monst *shkp;
quoted by the shopkeeper and also that they both belong to the same shk.
*/
boolean
-same_price(obj1, obj2)
-struct obj *obj1, *obj2;
+same_price(struct obj* obj1, struct obj* obj2)
{
register struct monst *shkp1, *shkp2;
struct bill_x *bp1 = 0, *bp2 = 0;
* level is bones data which has a shk on the warpath.
*/
static long
-shop_debt(eshkp)
-struct eshk *eshkp;
+shop_debt(struct eshk* eshkp)
{
struct bill_x *bp;
int ct;
/* called in response to the `$' command */
void
-shopper_financial_report()
+shopper_financial_report(void)
{
struct monst *shkp, *this_shkp = shop_keeper(inside_shop(u.ux, u.uy));
struct eshk *eshkp;
}
int
-inhishop(mtmp)
-register struct monst *mtmp;
+inhishop(register struct monst* mtmp)
{
struct eshk *eshkp = ESHK(mtmp);
}
struct monst *
-shop_keeper(rmno)
-char rmno;
+shop_keeper(char rmno)
{
struct monst *shkp;
}
boolean
-tended_shop(sroom)
-struct mkroom *sroom;
+tended_shop(struct mkroom* sroom)
{
struct monst *mtmp = sroom->resident;
}
static struct bill_x *
-onbill(obj, shkp, silent)
-struct obj *obj;
-struct monst *shkp;
-boolean silent;
+onbill(struct obj* obj, struct monst* shkp, boolean silent)
{
if (shkp) {
register struct bill_x *bp = ESHK(shkp)->bill_p;
/* check whether an object or any of its contents belongs to a shop */
boolean
-is_unpaid(obj)
-struct obj *obj;
+is_unpaid(struct obj* obj)
{
return (boolean) (obj->unpaid
|| (Has_contents(obj) && count_unpaid(obj->cobj)));
/* Delete the contents of the given object. */
void
-delete_contents(obj)
-register struct obj *obj;
+delete_contents(register struct obj* obj)
{
register struct obj *curr;
/* called with two args on merge */
void
-obfree(obj, merge)
-register struct obj *obj, *merge;
+obfree(register struct obj* obj, register struct obj* merge)
{
register struct bill_x *bp;
register struct bill_x *bpm;
}
static long
-check_credit(tmp, shkp)
-long tmp;
-register struct monst *shkp;
+check_credit(long tmp, register struct monst* shkp)
{
long credit = ESHK(shkp)->credit;
}
static void
-pay(tmp, shkp)
-long tmp;
-register struct monst *shkp;
+pay(long tmp, register struct monst* shkp)
{
long robbed = ESHK(shkp)->robbed;
long balance = ((tmp <= 0L) ? tmp : check_credit(tmp, shkp));
/* return shkp to home position */
void
-home_shk(shkp, killkops)
-register struct monst *shkp;
-register boolean killkops;
+home_shk(register struct monst* shkp, register boolean killkops)
{
register xchar x = ESHK(shkp)->shk.x, y = ESHK(shkp)->shk.y;
}
static boolean
-angry_shk_exists()
+angry_shk_exists(void)
{
register struct monst *shkp;
/* remove previously applied surcharge from all billed items */
static void
-pacify_shk(shkp)
-register struct monst *shkp;
+pacify_shk(register struct monst* shkp)
{
NOTANGRY(shkp) = TRUE; /* make peaceful */
if (ESHK(shkp)->surcharge) {
/* add aggravation surcharge to all billed items */
static void
-rile_shk(shkp)
-register struct monst *shkp;
+rile_shk(register struct monst* shkp)
{
NOTANGRY(shkp) = FALSE; /* make angry */
if (!ESHK(shkp)->surcharge) {
/* wakeup and/or unparalyze shopkeeper */
static void
-rouse_shk(shkp, verbosely)
-struct monst *shkp;
-boolean verbosely;
+rouse_shk(struct monst* shkp, boolean verbosely)
{
if (!shkp->mcanmove || shkp->msleeping) {
/* greed induced recovery... */
}
void
-make_happy_shk(shkp, silentkops)
-register struct monst *shkp;
-register boolean silentkops;
+make_happy_shk(register struct monst* shkp, register boolean silentkops)
{
boolean wasmad = ANGRY(shkp);
struct eshk *eshkp = ESHK(shkp);
/* called by make_happy_shk() and also by losedogs() for migrating shk */
void
-make_happy_shoppers(silentkops)
-boolean silentkops;
+make_happy_shoppers(boolean silentkops)
{
if (!angry_shk_exists()) {
kops_gone(silentkops);
}
void
-hot_pursuit(shkp)
-register struct monst *shkp;
+hot_pursuit(register struct monst* shkp)
{
if (!shkp->isshk)
return;
the shop. These conditions must be checked by the calling function. */
/*ARGSUSED*/
void
-make_angry_shk(shkp, ox, oy)
-struct monst *shkp;
-xchar ox UNUSED; /* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */
-xchar oy UNUSED;
+make_angry_shk(struct monst* shkp, xchar ox UNUSED, xchar oy UNUSED)
+/* <ox,oy> predate 'noit_Monnam()', let alone Shknam() */
{
struct eshk *eshkp = ESHK(shkp);
/* delivers the cheapest item on the list */
static long
-cheapest_item(shkp)
-register struct monst *shkp;
+cheapest_item(register struct monst* shkp)
{
register int ct = ESHK(shkp)->billct;
register struct bill_x *bp = ESHK(shkp)->bill_p;
}
int
-dopay()
+dopay(void)
{
register struct eshk *eshkp;
register struct monst *shkp;
* -2 if no money/credit left
*/
static int
-dopayobj(shkp, bp, obj_p, which, itemize)
-register struct monst *shkp;
-register struct bill_x *bp;
-struct obj **obj_p;
-int which; /* 0 => used-up item, 1 => other (unpaid or lost) */
-boolean itemize;
+dopayobj(
+ register struct monst* shkp,
+ register struct bill_x* bp,
+ struct obj** obj_p,
+ int which /* 0 => used-up item, 1 => other (unpaid or lost) */,
+ boolean itemize)
+
{
register struct obj *obj = *obj_p;
long ltmp, quan, save_quan;
/* routine called after dying (or quitting) */
boolean
-paybill(croaked, silently)
-int croaked; /* -1: escaped dungeon; 0: quit; 1: died */
-boolean silently; /* maybe avoid messages */
+paybill(
+ int croaked, /* -1: escaped dungeon; 0: quit; 1: died */
+ boolean silently) /* maybe avoid messages */
{
struct monst *mtmp, *mtmp2, *firstshk, *resident, *creditor, *hostile,
*localshk;
}
static boolean
-inherits(shkp, numsk, croaked, silently)
-struct monst *shkp;
-int numsk;
-int croaked;
-boolean silently;
+inherits(struct monst* shkp, int numsk, int croaked, boolean silently)
{
long loss = 0L;
long umoney;
}
static void
-set_repo_loc(shkp)
-struct monst *shkp;
+set_repo_loc(struct monst* shkp)
{
register xchar ox, oy;
struct eshk *eshkp = ESHK(shkp);
/* called at game exit, after inventory disclosure but before making bones;
shouldn't issue any messages */
void
-finish_paybill()
+finish_paybill(void)
{
struct monst *shkp = g.repo.shopkeeper;
int ox = g.repo.location.x, oy = g.repo.location.y;
/* find obj on one of the lists */
static struct obj *
-bp_to_obj(bp)
-register struct bill_x *bp;
+bp_to_obj(register struct bill_x* bp)
{
register struct obj *obj;
register unsigned int id = bp->bo_id;
* be any timeouts on the g.billobjs chain.
*/
struct obj *
-find_oid(id)
-unsigned id;
+find_oid(unsigned int id)
{
struct obj *obj;
struct monst *mon, *mmtmp[3];
/* Returns the price of an arbitrary item in the shop,
0 if the item doesn't belong to a shopkeeper or hero is not in the shop. */
long
-get_cost_of_shop_item(obj, nochrg)
-register struct obj *obj;
-int *nochrg; /* alternate return value: 1: no charge, 0: shop owned, */
+get_cost_of_shop_item(register struct obj* obj, int* nochrg)
+ /* alternate return value: 1: no charge, 0: shop owned, */
{ /* -1: not in a shop (so should't be formatted as "no charge") */
struct monst *shkp;
struct obj *top;
}
static long
-get_pricing_units(obj)
-struct obj *obj;
+get_pricing_units(struct obj* obj)
{
long units = obj->quan;
/* decide whether to apply a surcharge (or hypothetically, a discount) to obj
if it had ID number 'oid'; returns 1: increase, 0: normal, -1: decrease */
int
-oid_price_adjustment(obj, oid)
-struct obj *obj;
-unsigned oid;
+oid_price_adjustment(struct obj* obj, unsigned int oid)
{
int res = 0, otyp = obj->otyp;
/* calculate the value that the shk will charge for [one of] an object */
static long
-get_cost(obj, shkp)
-register struct obj *obj;
-register struct monst *shkp; /* if angry, impose a surcharge */
+get_cost(
+ register struct obj* obj,
+ register struct monst* shkp) /* if angry, impose a surcharge */
{
long tmp = getprice(obj, FALSE),
/* used to perform a single calculation even when multiple
* a different price quoted for selling as vs. buying.
*/
long
-contained_cost(obj, shkp, price, usell, unpaid_only)
-struct obj *obj;
-struct monst *shkp;
-long price;
-boolean usell;
-boolean unpaid_only;
+contained_cost(
+ struct obj *obj,
+ struct monst *shkp,
+ long price,
+ boolean usell,
+ boolean unpaid_only)
{
register struct obj *otmp, *top;
xchar x, y;
/* count amount of gold inside container 'obj' and any nested containers */
long
-contained_gold(obj, even_if_unknown)
-struct obj *obj;
-boolean even_if_unknown; /* True: all gold; False: limit to known contents */
+contained_gold(
+ struct obj *obj,
+ boolean even_if_unknown) /* True: all gold; False: limit to known contents */
{
register struct obj *otmp;
register long value = 0L;
}
static void
-dropped_container(obj, shkp, sale)
-register struct obj *obj;
-register struct monst *shkp;
-register boolean sale;
+dropped_container(
+ register struct obj *obj,
+ register struct monst *shkp,
+ register boolean sale)
{
register struct obj *otmp;
}
void
-picked_container(obj)
-register struct obj *obj;
+picked_container(register struct obj* obj)
{
register struct obj *otmp;
}
static boolean
-special_stock(obj, shkp, quietly)
-struct obj *obj;
-struct monst *shkp;
-boolean quietly;
+special_stock(
+ struct obj *obj,
+ struct monst *shkp,
+ boolean quietly)
{
/* for unique situations */
if (ESHK(shkp)->shoptype == CANDLESHOP
/* calculate how much the shk will pay when buying [all of] an object */
static long
-set_cost(obj, shkp)
-register struct obj *obj;
-register struct monst *shkp;
+set_cost(register struct obj* obj, register struct monst* shkp)
{
long tmp, unit_price = getprice(obj, TRUE), multiplier = 1L, divisor = 1L;
/* unlike alter_cost() which operates on a specific item, identifying or
forgetting a gem causes all unpaid gems of its type to change value */
void
-gem_learned(oindx)
-int oindx;
+gem_learned(int oindx)
{
struct obj *obj;
struct monst *shkp;
on any shop bill, update that bill to reflect the new higher price
[if the new price drops for some reason, keep the old one in place] */
void
-alter_cost(obj, amt)
-struct obj *obj;
-long amt; /* if 0, use regular shop pricing, otherwise force amount;
- if negative, use abs(amt) even if it's less than old cost */
+alter_cost(
+ struct obj* obj,
+ long amt) /* if 0, use regular shop pricing, otherwise force amount;
+ if negative, use abs(amt) even if it's less than old cost */
{
struct bill_x *bp = 0;
struct monst *shkp;
/* called from doinv(invent.c) for inventory of unpaid objects */
long
-unpaid_cost(unp_obj, include_contents)
-struct obj *unp_obj; /* known to be unpaid or contain unpaid */
-boolean include_contents;
+unpaid_cost(
+ struct obj *unp_obj, /* known to be unpaid or contain unpaid */
+ boolean include_contents)
{
struct bill_x *bp = (struct bill_x *) 0;
struct monst *shkp;
}
static void
-add_one_tobill(obj, dummy, shkp)
-struct obj *obj;
-boolean dummy;
-struct monst *shkp;
+add_one_tobill(struct obj* obj, boolean dummy, struct monst* shkp)
{
struct eshk *eshkp;
struct bill_x *bp;
}
static void
-add_to_billobjs(obj)
-struct obj *obj;
+add_to_billobjs(struct obj* obj)
{
if (obj->where != OBJ_FREE)
panic("add_to_billobjs: obj not free");
/* recursive billing of objects within containers. */
static void
-bill_box_content(obj, ininv, dummy, shkp)
-register struct obj *obj;
-register boolean ininv, dummy;
-register struct monst *shkp;
+bill_box_content(
+ register struct obj *obj,
+ register boolean ininv,
+ register boolean dummy,
+ register struct monst *shkp)
{
register struct obj *otmp;
/* shopkeeper tells you what you bought or sold, sometimes partly IDing it */
static void
-shk_names_obj(shkp, obj, fmt, amt, arg)
-struct monst *shkp;
-struct obj *obj;
-const char *fmt; /* "%s %ld %s %s", doname(obj), amt, plur(amt), arg */
-long amt;
-const char *arg;
+shk_names_obj(
+ struct monst *shkp,
+ struct obj *obj,
+ const char *fmt, /* "%s %ld %s %s", doname(obj), amt, plur(amt), arg */
+ long amt,
+ const char *arg)
{
char *obj_name, fmtbuf[BUFSZ];
boolean was_unknown = !obj->dknown;
/* decide whether a shopkeeper thinks an item belongs to her */
boolean
-billable(shkpp, obj, roomno, reset_nocharge)
-struct monst **shkpp; /* in: non-null if shk has been validated; out: shk */
-struct obj *obj;
-char roomno;
-boolean reset_nocharge;
+billable(
+ struct monst **shkpp, /* in: non-null if shk has been validated; out: shk */
+ struct obj *obj,
+ char roomno,
+ boolean reset_nocharge)
{
struct monst *shkp = *shkpp;
}
void
-addtobill(obj, ininv, dummy, silent)
-struct obj *obj;
-boolean ininv, dummy, silent;
+addtobill(
+ struct obj *obj,
+ boolean ininv,
+ boolean dummy,
+ boolean silent)
{
struct monst *shkp = 0;
long ltmp, cltmp, gltmp;
}
static void
-append_honorific(buf)
-char *buf;
+append_honorific(char *buf)
{
/* (chooses among [0]..[3] normally; [1]..[4] after the
Wizard has been killed or invocation ritual performed) */
}
void
-splitbill(obj, otmp)
-register struct obj *obj, *otmp;
+splitbill(register struct obj* obj, register struct obj* otmp)
{
/* otmp has been split off from obj */
register struct bill_x *bp;
}
static void
-sub_one_frombill(obj, shkp)
-register struct obj *obj;
-register struct monst *shkp;
+sub_one_frombill(register struct obj* obj, register struct monst* shkp)
{
register struct bill_x *bp;
/* recursive check of unpaid objects within nested containers. */
void
-subfrombill(obj, shkp)
-register struct obj *obj;
-register struct monst *shkp;
+subfrombill(register struct obj* obj, register struct monst* shkp)
{
register struct obj *otmp;
}
static long
-stolen_container(obj, shkp, price, ininv)
-struct obj *obj;
-struct monst *shkp;
-long price;
-boolean ininv;
+stolen_container(
+ struct obj *obj,
+ struct monst *shkp,
+ long price,
+ boolean ininv)
{
struct obj *otmp;
struct bill_x *bp;
}
long
-stolen_value(obj, x, y, peaceful, silent)
-struct obj *obj;
-xchar x, y;
-boolean peaceful, silent;
+stolen_value(
+ struct obj *obj,
+ xchar x,
+ xchar y,
+ boolean peaceful,
+ boolean silent)
{
long value = 0L, gvalue = 0L, billamt = 0L;
char roomno = *in_rooms(x, y, SHOPBASE);
/* opposite of costly_gold(); hero has dropped gold in a shop;
called from sellobj(); ought to be called from subfrombill() too */
void
-donate_gold(gltmp, shkp, selling)
-long gltmp;
-struct monst *shkp;
-boolean selling; /* True: dropped in shop; False: kicked and landed in shop */
+donate_gold(
+ long gltmp,
+ struct monst *shkp,
+ boolean selling) /* True: dropped in shop; False: kicked and landed in shop */
{
struct eshk *eshkp = ESHK(shkp);
}
void
-sellobj_state(deliberate)
-int deliberate;
+sellobj_state(int deliberate)
{
/* If we're deliberately dropping something, there's no automatic
response to the shopkeeper's "want to sell" query; however, if we
}
void
-sellobj(obj, x, y)
-register struct obj *obj;
-xchar x, y;
+sellobj(register struct obj* obj, xchar x, xchar y)
{
register struct monst *shkp;
register struct eshk *eshkp;
}
int
-doinvbill(mode)
-int mode; /* 0: deliver count 1: paged */
+doinvbill(
+ int mode) /* 0: deliver count 1: paged */
{
#ifdef __SASC
void sasc_bug(struct obj *, unsigned);
}
static long
-getprice(obj, shk_buying)
-register struct obj *obj;
-boolean shk_buying;
+getprice(register struct obj* obj, boolean shk_buying)
{
register long tmp = (long) objects[obj->otyp].oc_cost;
/* shk catches thrown pick-axe */
struct monst *
-shkcatch(obj, x, y)
-register struct obj *obj;
-register xchar x, y;
+shkcatch(register struct obj* obj, register xchar x, register xchar y)
{
register struct monst *shkp;
}
void
-add_damage(x, y, cost)
-register xchar x, y;
-long cost;
+add_damage(
+ register xchar x,
+ register xchar y,
+ long cost)
{
struct damage *tmp_dam;
char *shops;
*/
static
void
-remove_damage(shkp, croaked)
-struct monst *shkp;
-boolean croaked;
+remove_damage(struct monst* shkp, boolean croaked)
{
struct damage *tmp_dam, *tmp2_dam;
struct obj *shk_inv = shkp->minvent;
* 3: untrap
*/
int
-repair_damage(shkp, tmp_dam, once, catchup)
-struct monst *shkp;
-struct damage *tmp_dam;
-int *once;
-boolean catchup; /* restoring a level */
+repair_damage(
+ struct monst *shkp,
+ struct damage *tmp_dam,
+ int *once,
+ boolean catchup) /* restoring a level */
{
xchar x, y;
xchar litter[9];
* shk_move: return 1: moved 0: didn't -1: let m_move do it -2: died
*/
int
-shk_move(shkp)
-struct monst *shkp;
+shk_move(struct monst* shkp)
{
xchar gx, gy, omx, omy;
int udist;
/* called after shopkeeper moves, in case themove causes re-entry into shop */
void
-after_shk_move(shkp)
-struct monst *shkp;
+after_shk_move(struct monst* shkp)
{
struct eshk *eshkp = ESHK(shkp);
/* for use in levl_follower (mondata.c) */
boolean
-is_fshk(mtmp)
-register struct monst *mtmp;
+is_fshk(register struct monst* mtmp)
{
return (boolean) (mtmp->isshk && ESHK(mtmp)->following);
}
/* You are digging in the shop. */
void
-shopdig(fall)
-register int fall;
+shopdig(register int fall)
{
register struct monst *shkp = shop_keeper(*u.ushops);
int lang;
}
static void
-makekops(mm)
-coord *mm;
+makekops(coord* mm)
{
static const short k_mndx[4] = { PM_KEYSTONE_KOP, PM_KOP_SERGEANT,
PM_KOP_LIEUTENANT, PM_KOP_KAPTAIN };
}
void
-pay_for_damage(dmgstr, cant_mollify)
-const char *dmgstr;
-boolean cant_mollify;
+pay_for_damage(const char* dmgstr, boolean cant_mollify)
{
register struct monst *shkp = (struct monst *) 0;
char shops_affected[5];
/* called in dokick.c when we kick an object that might be in a store */
boolean
-costly_spot(x, y)
-register xchar x, y;
+costly_spot(register xchar x, register xchar y)
{
struct monst *shkp;
struct eshk *eshkp;
/* called by dotalk(sounds.c) when #chatting; returns obj if location
contains shop goods and shopkeeper is willing & able to speak */
struct obj *
-shop_object(x, y)
-register xchar x, y;
+shop_object(register xchar x, register xchar y)
{
register struct obj *otmp;
register struct monst *shkp;
/* give price quotes for all objects linked to this one (ie, on this spot) */
void
-price_quote(first_obj)
-register struct obj *first_obj;
+price_quote(register struct obj* first_obj)
{
register struct obj *otmp;
char buf[BUFSZ], price[40];
}
static const char *
-shk_embellish(itm, cost)
-register struct obj *itm;
-long cost;
+shk_embellish(register struct obj* itm, long cost)
{
if (!rn2(3)) {
register int o, choice = rn2(5);
};
void
-shk_chat(shkp)
-struct monst *shkp;
+shk_chat(struct monst* shkp)
{
struct eshk *eshk;
long shkmoney;
}
static void
-kops_gone(silent)
-boolean silent;
+kops_gone(boolean silent)
{
int cnt = 0;
struct monst *mtmp, *mtmp2;
}
static long
-cost_per_charge(shkp, otmp, altusage)
-struct monst *shkp;
-struct obj *otmp;
-boolean altusage; /* some items have an "alternate" use with different cost */
+cost_per_charge(
+ struct monst *shkp,
+ struct obj *otmp,
+ boolean altusage) /* some items have an "alternate" use with different cost */
{
long tmp = 0L;
* when an object is completely used.
*/
void
-check_unpaid_usage(otmp, altusage)
-struct obj *otmp;
-boolean altusage;
+check_unpaid_usage(struct obj* otmp, boolean altusage)
{
struct monst *shkp;
const char *fmt, *arg1, *arg2;
/* for using charges of unpaid objects "used in the normal manner" */
void
-check_unpaid(otmp)
-struct obj *otmp;
+check_unpaid(struct obj* otmp)
{
check_unpaid_usage(otmp, FALSE); /* normal item use */
}
void
-costly_gold(x, y, amount)
-register xchar x, y;
-register long amount;
+costly_gold(register xchar x, register xchar y, register long amount)
{
register long delta;
register struct monst *shkp;
/* used in domove to block diagonal shop-exit */
/* x,y should always be a door */
boolean
-block_door(x, y)
-register xchar x, y;
+block_door(register xchar x, register xchar y)
{
register int roomno = *in_rooms(x, y, SHOPBASE);
register struct monst *shkp;
/* used in domove to block diagonal shop-entry;
u.ux, u.uy should always be a door */
boolean
-block_entry(x, y)
-register xchar x, y;
+block_entry(register xchar x, register xchar y)
{
register xchar sx, sy;
register int roomno;
/* "your " or "Foobar's " (note the trailing space) */
char *
-shk_your(buf, obj)
-char *buf;
-struct obj *obj;
+shk_your(char *buf, struct obj* obj)
{
if (!shk_owns(buf, obj) && !mon_owns(buf, obj))
Strcpy(buf, the_your[carried(obj) ? 1 : 0]);
}
char *
-Shk_Your(buf, obj)
-char *buf;
-struct obj *obj;
+Shk_Your(char* buf, struct obj* obj)
{
(void) shk_your(buf, obj);
*buf = highc(*buf);
}
static char *
-shk_owns(buf, obj)
-char *buf;
-struct obj *obj;
+shk_owns(char* buf, struct obj* obj)
{
struct monst *shkp;
xchar x, y;
}
static char *
-mon_owns(buf, obj)
-char *buf;
-struct obj *obj;
+mon_owns(char* buf, struct obj* obj)
{
if (obj->where == OBJ_MINVENT)
return strcpy(buf, s_suffix(y_monnam(obj->ocarry)));
}
static const char *
-cad(altusage)
-boolean altusage; /* used as a verbalized exclamation: \"Cad! ...\" */
+cad(
+ boolean altusage) /* used as a verbalized exclamation: \"Cad! ...\" */
{
const char *res = 0;
* 4. player_owned glob merging into player_owned glob
*/
void
-globby_bill_fixup(obj_absorber, obj_absorbed)
-struct obj *obj_absorber, *obj_absorbed;
+globby_bill_fixup(struct obj* obj_absorber, struct obj* obj_absorbed)
{
int x = 0, y = 0;
struct bill_x *bp, *bp_absorber = (struct bill_x *) 0;
#include "hack.h"
-static boolean FDECL(stock_room_goodpos, (struct mkroom *, int, int, int, int));
-static boolean FDECL(veggy_item, (struct obj * obj, int));
-static int NDECL(shkveg);
-static void FDECL(mkveggy_at, (int, int));
-static void FDECL(mkshobj_at, (const struct shclass *, int, int,
- BOOLEAN_P));
-static void FDECL(nameshk, (struct monst *, const char *const *));
-static int FDECL(shkinit, (const struct shclass *, struct mkroom *));
+static boolean stock_room_goodpos(struct mkroom *, int, int, int, int);
+static boolean veggy_item(struct obj * obj, int);
+static int shkveg(void);
+static void mkveggy_at(int, int);
+static void mkshobj_at(const struct shclass *, int, int, boolean);
+static void nameshk(struct monst *, const char *const *);
+static int shkinit(const struct shclass *, struct mkroom *);
#define VEGETARIAN_CLASS (MAXOCLASSES + 1)
/* decide whether an object or object type is considered vegetarian;
for types, items which might go either way are assumed to be veggy */
static boolean
-veggy_item(obj, otyp)
-struct obj *obj;
-int otyp; /* used iff obj is null */
+veggy_item(struct obj* obj, int otyp /* used iff obj is null */)
{
int corpsenm;
char oclass;
}
static int
-shkveg()
+shkveg(void)
{
int i, j, maxprob, prob;
char oclass = FOOD_CLASS;
/* make a random item for health food store */
static void
-mkveggy_at(sx, sy)
-int sx, sy;
+mkveggy_at(int sx, int sy)
{
struct obj *obj = mksobj_at(shkveg(), sx, sy, TRUE, TRUE);
/* make an object of the appropriate type for a shop square */
static void
-mkshobj_at(shp, sx, sy, mkspecl)
-const struct shclass *shp;
-int sx, sy;
-boolean mkspecl;
+mkshobj_at(const struct shclass* shp, int sx, int sy, boolean mkspecl)
{
struct monst *mtmp;
struct permonst *ptr;
/* extract a shopkeeper name for the given shop type */
static void
-nameshk(shk, nlp)
-struct monst *shk;
-const char *const *nlp;
+nameshk(struct monst* shk, const char* const* nlp)
{
int i, trycnt, names_avail;
const char *shname = 0;
}
void
-neweshk(mtmp)
-struct monst *mtmp;
+neweshk(struct monst* mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
}
void
-free_eshk(mtmp)
-struct monst *mtmp;
+free_eshk(struct monst* mtmp)
{
if (mtmp->mextra && ESHK(mtmp)) {
free((genericptr_t) ESHK(mtmp));
/* create a new shopkeeper in the given room */
static int
-shkinit(shp, sroom)
-const struct shclass *shp;
-struct mkroom *sroom;
+shkinit(const struct shclass* shp, struct mkroom* sroom)
{
register int sh, sx, sy;
struct monst *shk;
}
static boolean
-stock_room_goodpos(sroom, rmno, sh, sx, sy)
-struct mkroom *sroom;
-int rmno, sh, sx,sy;
+stock_room_goodpos(struct mkroom* sroom, int rmno, int sh, int sx, int sy)
{
if (sroom->irregular) {
if (levl[sx][sy].edge
/* stock a newly-created room with objects */
void
-stock_room(shp_indx, sroom)
-int shp_indx;
-register struct mkroom *sroom;
+stock_room(int shp_indx, register struct mkroom* sroom)
{
/*
* Someday soon we'll dispatch on the shdist field of shclass to do
/* does shkp's shop stock this item type? */
boolean
-saleable(shkp, obj)
-struct monst *shkp;
-struct obj *obj;
+saleable(struct monst* shkp, struct obj* obj)
{
int i, shp_indx = ESHK(shkp)->shoptype - SHOPBASE;
const struct shclass *shp = &shtypes[shp_indx];
/* positive value: class; negative value: specific object type.
can also return non-existing object class (eg. VEGETARIAN_CLASS) */
int
-get_shop_item(type)
-int type;
+get_shop_item(int type)
{
const struct shclass *shp = shtypes + type;
register int i, j;
/* version of shkname() for beginning of sentence */
char *
-Shknam(mtmp)
-struct monst *mtmp;
+Shknam(struct monst* mtmp)
{
char *nam = shkname(mtmp);
will yield some other shopkeeper's name (not necessarily one residing
in the current game's dungeon, or who keeps same type of shop) */
char *
-shkname(mtmp)
-struct monst *mtmp;
+shkname(struct monst* mtmp)
{
char *nam;
unsigned save_isshk = mtmp->isshk;
}
boolean
-shkname_is_pname(mtmp)
-struct monst *mtmp;
+shkname_is_pname(struct monst* mtmp)
{
const char *shknm = ESHK(mtmp)->shknam;
}
boolean
-is_izchak(shkp, override_hallucination)
-struct monst *shkp;
-boolean override_hallucination;
+is_izchak(struct monst* shkp, boolean override_hallucination)
{
const char *shknm;
/* take away the hero's money */
void
-take_gold()
+take_gold(void)
{
struct obj *otmp, *nobj;
int lost_money = 0;
/* #sit command */
int
-dosit()
+dosit(void)
{
static const char sit_message[] = "sit on the %s.";
register struct trap *trap = t_at(u.ux, u.uy);
/* curse a few inventory items at random! */
void
-rndcurse()
+rndcurse(void)
{
int nobj = 0;
int cnt, onum;
/* remove a random INTRINSIC ability */
void
-attrcurse()
+attrcurse(void)
{
switch (rnd(11)) {
case 1:
#include "hack.h"
-static boolean FDECL(mon_is_gecko, (struct monst *));
-static int FDECL(domonnoise, (struct monst *));
-static int NDECL(dochat);
-static struct monst *FDECL(responsive_mon_at, (int, int));
-static int FDECL(mon_in_room, (struct monst *, int));
+static boolean mon_is_gecko(struct monst *);
+static int domonnoise(struct monst *);
+static int dochat(void);
+static struct monst *responsive_mon_at(int, int);
+static int mon_in_room(struct monst *, int);
/* this easily could be a macro, but it might overtax dumb compilers */
static int
-mon_in_room(mon, rmtyp)
-struct monst *mon;
-int rmtyp;
+mon_in_room(struct monst* mon, int rmtyp)
{
int rno = levl[mon->mx][mon->my].roomno;
if (rno >= ROOMOFFSET)
}
void
-dosounds()
+dosounds(void)
{
register struct mkroom *sroom;
register int hallu, vx, vy;
};
const char *
-growl_sound(mtmp)
-register struct monst *mtmp;
+growl_sound(register struct monst* mtmp)
{
const char *ret;
/* the sounds of a seriously abused pet, including player attacking it */
void
-growl(mtmp)
-register struct monst *mtmp;
+growl(register struct monst* mtmp)
{
register const char *growl_verb = 0;
/* the sounds of mistreated pets */
void
-yelp(mtmp)
-register struct monst *mtmp;
+yelp(register struct monst* mtmp)
{
register const char *yelp_verb = 0;
/* the sounds of distressed pets */
void
-whimper(mtmp)
-register struct monst *mtmp;
+whimper(register struct monst* mtmp)
{
register const char *whimper_verb = 0;
/* pet makes "I'm hungry" noises */
void
-beg(mtmp)
-register struct monst *mtmp;
+beg(register struct monst* mtmp)
{
if (mtmp->msleeping || !mtmp->mcanmove
|| !(carnivorous(mtmp->data) || herbivorous(mtmp->data)))
/* hero has attacked a peaceful monster within 'mon's view */
const char *
-maybe_gasp(mon)
-struct monst *mon;
+maybe_gasp(struct monst* mon)
{
static const char *const Exclam[] = {
"Gasp!", "Uh-oh.", "Oh my!", "What?", "Why?",
/* return True if mon is a gecko or seems to look like one (hallucination) */
static boolean
-mon_is_gecko(mon)
-struct monst *mon;
+mon_is_gecko(struct monst* mon)
{
int glyph;
}
static int
-domonnoise(mtmp)
-register struct monst *mtmp;
+domonnoise(register struct monst* mtmp)
{
char verbuf[BUFSZ];
register const char *pline_msg = 0, /* Monnam(mtmp) will be prepended */
/* #chat command */
int
-dotalk()
+dotalk(void)
{
int result;
}
static int
-dochat()
+dochat(void)
{
struct monst *mtmp;
int tx, ty;
/* is there a monster at <x,y> that can see the hero and react? */
static struct monst *
-responsive_mon_at(x, y)
-int x, y;
+responsive_mon_at(int x, int y)
{
struct monst *mtmp = isok(x, y) ? m_at(x, y) : 0;
/* player chose 'uarmh' for #tip (pickup.c); visual #chat, sort of... */
int
-tiphat()
+tiphat(void)
{
struct monst *mtmp;
struct obj *otmp;
#ifdef USER_SOUNDS
#if defined(WIN32) || defined(QT_GRAPHICS)
-extern void FDECL(play_usersound, (const char *, int));
+extern void play_usersound(const char *, int);
#endif
#if defined(TTY_SOUND_ESCCODES)
-extern void FDECL(play_usersound_via_idx, (int, int));
+extern void play_usersound_via_idx(int, int);
#endif
typedef struct audio_mapping_rec {
} audio_mapping;
static audio_mapping *soundmap = 0;
-static audio_mapping *FDECL(sound_matches_message, (const char *));
+static audio_mapping *sound_matches_message(const char *);
char *sounddir = 0; /* set in files.c */
/* adds a sound file mapping, returns 0 on failure, 1 on success */
int
-add_sound_mapping(mapping)
-const char *mapping;
+add_sound_mapping(const char* mapping)
{
char text[256];
char filename[256];
}
static audio_mapping *
-sound_matches_message(msg)
-const char *msg;
+sound_matches_message(const char* msg)
{
audio_mapping *snd = soundmap;
}
void
-play_sound_for_message(msg)
-const char *msg;
+play_sound_for_message(const char* msg)
{
audio_mapping *snd = sound_matches_message(msg);
}
void
-maybe_play_sound(msg)
-const char *msg;
+maybe_play_sound(const char* msg)
{
#if defined(WIN32) || defined(QT_GRAPHICS) || defined(TTY_SOUND_ESCCODES)
audio_mapping *snd = sound_matches_message(msg);
}
void
-release_sound_mappings()
+release_sound_mappings(void)
{
audio_mapping *nextsound = 0;
#pragma warning(disable : 4244)
#endif
-typedef void FDECL((*select_iter_func), (int, int, genericptr));
-
-extern void FDECL(mkmap, (lev_init *));
-
-static boolean FDECL(match_maptyps, (XCHAR_P, XCHAR_P));
-static void NDECL(solidify_map);
-static void FDECL(lvlfill_maze_grid, (int, int, int, int, SCHAR_P));
-static void FDECL(lvlfill_solid, (SCHAR_P, SCHAR_P));
-static void FDECL(lvlfill_swamp, (SCHAR_P, SCHAR_P, SCHAR_P));
-static void FDECL(flip_drawbridge_horizontal, (struct rm *));
-static void FDECL(flip_drawbridge_vertical, (struct rm *));
-static void FDECL(flip_visuals, (int, int, int, int, int));
-static int FDECL(flip_encoded_direction_bits, (int, int));
-static void FDECL(sel_set_wall_property, (int, int, genericptr_t));
-static void FDECL(set_wall_property, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P,
- int));
-static void NDECL(count_features);
-static void NDECL(remove_boundary_syms);
-static void FDECL(set_door_orientation, (int, int));
-static void FDECL(maybe_add_door, (int, int, struct mkroom *));
-static void NDECL(link_doors_rooms);
-static int NDECL(rnddoor);
-static int NDECL(rndtrap);
-static void FDECL(get_location, (xchar *, xchar *, int, struct mkroom *));
-static boolean FDECL(is_ok_location, (XCHAR_P, XCHAR_P, int));
-static unpacked_coord FDECL(get_unpacked_coord, (long, int));
-static void FDECL(get_room_loc, (xchar *, xchar *, struct mkroom *));
-static void FDECL(get_free_room_loc, (xchar *, xchar *,
- struct mkroom *, packed_coord));
-static boolean FDECL(create_subroom, (struct mkroom *, XCHAR_P, XCHAR_P,
- XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P));
-static void FDECL(create_door, (room_door *, struct mkroom *));
-static void FDECL(create_trap, (spltrap *, struct mkroom *));
-static int FDECL(noncoalignment, (ALIGNTYP_P));
-static boolean FDECL(m_bad_boulder_spot, (int, int));
-static int FDECL(pm_to_humidity, (struct permonst *));
-static void FDECL(create_monster, (monster *, struct mkroom *));
-static void FDECL(create_object, (object *, struct mkroom *));
-static void FDECL(create_altar, (altar *, struct mkroom *));
-static boolean FDECL(search_door, (struct mkroom *,
- xchar *, xchar *, XCHAR_P, int));
-static void FDECL(create_corridor, (corridor *));
-static struct mkroom *FDECL(build_room, (room *, struct mkroom *));
-static void FDECL(light_region, (region *));
-static void FDECL(maze1xy, (coord *, int));
-static void NDECL(fill_empty_maze);
-static void FDECL(splev_initlev, (lev_init *));
+typedef void (*select_iter_func)(int, int, genericptr);
+
+extern void mkmap(lev_init *);
+
+static boolean match_maptyps(xchar, xchar);
+static void solidify_map(void);
+static void lvlfill_maze_grid(int, int, int, int, schar);
+static void lvlfill_solid(schar, schar);
+static void lvlfill_swamp(schar, schar, schar);
+static void flip_drawbridge_horizontal(struct rm *);
+static void flip_drawbridge_vertical(struct rm *);
+static void flip_visuals(int, int, int, int, int);
+static int flip_encoded_direction_bits(int, int);
+static void sel_set_wall_property(int, int, genericptr_t);
+static void set_wall_property(xchar, xchar, xchar, xchar, int);
+static void count_features(void);
+static void remove_boundary_syms(void);
+static void set_door_orientation(int, int);
+static void maybe_add_door(int, int, struct mkroom *);
+static void link_doors_rooms(void);
+static int rnddoor(void);
+static int rndtrap(void);
+static void get_location(xchar *, xchar *, int, struct mkroom *);
+static boolean is_ok_location(xchar, xchar, int);
+static unpacked_coord get_unpacked_coord(long, int);
+static void get_room_loc(xchar *, xchar *, struct mkroom *);
+static void get_free_room_loc(xchar *, xchar *, struct mkroom *,
+ packed_coord);
+static boolean create_subroom(struct mkroom *, xchar, xchar, xchar,
+ xchar, xchar, xchar);
+static void create_door(room_door *, struct mkroom *);
+static void create_trap(spltrap *, struct mkroom *);
+static int noncoalignment(aligntyp);
+static boolean m_bad_boulder_spot(int, int);
+static int pm_to_humidity(struct permonst *);
+static void create_monster(monster *, struct mkroom *);
+static void create_object(object *, struct mkroom *);
+static void create_altar(altar *, struct mkroom *);
+static boolean search_door(struct mkroom *, xchar *, xchar *, xchar, int);
+static void create_corridor(corridor *);
+static struct mkroom *build_room(room *, struct mkroom *);
+static void light_region(region *);
+static void maze1xy(coord *, int);
+static void fill_empty_maze(void);
+static void splev_initlev(lev_init *);
#if 0
/* macosx complains that these are unused */
-static long FDECL(sp_code_jmpaddr, (long, long));
-static void FDECL(spo_room, (struct sp_coder *));
-static void FDECL(spo_trap, (struct sp_coder *));
-static void FDECL(spo_gold, (struct sp_coder *));
-static void FDECL(spo_corridor, (struct sp_coder *));
-static void FDECL(spo_feature, (struct sp_coder *));
-static void FDECL(spo_terrain, (struct sp_coder *));
-static void FDECL(spo_replace_terrain, (struct sp_coder *));
-static void FDECL(spo_levregion, (struct sp_coder *));
-static void FDECL(spo_region, (struct sp_coder *));
-static void FDECL(spo_drawbridge, (struct sp_coder *));
-static void FDECL(spo_mazewalk, (struct sp_coder *));
-static void FDECL(spo_wall_property, (struct sp_coder *));
-static void FDECL(spo_room_door, (struct sp_coder *));
-static void FDECL(spo_wallify, (struct sp_coder *));
-static void FDECL(sel_set_wallify, (int, int, genericptr_t));
+static long sp_code_jmpaddr(long, long);
+static void spo_room(struct sp_coder *);
+static void spo_trap(struct sp_coder *);
+static void spo_gold(struct sp_coder *);
+static void spo_corridor(struct sp_coder *);
+static void spo_feature(struct sp_coder *);
+static void spo_terrain(struct sp_coder *);
+static void spo_replace_terrain(struct sp_coder *);
+static void spo_levregion(struct sp_coder *);
+static void spo_region(struct sp_coder *);
+static void spo_drawbridge(struct sp_coder *);
+static void spo_mazewalk(struct sp_coder *);
+static void spo_wall_property(struct sp_coder *);
+static void spo_room_door(struct sp_coder *);
+static void spo_wallify(struct sp_coder *);
+static void sel_set_wallify(int, int, genericptr_t);
#endif
-static void NDECL(spo_end_moninvent);
-static void NDECL(spo_pop_container);
-static int FDECL(l_create_stairway, (lua_State *, BOOLEAN_P));
-static void FDECL(spo_endroom, (struct sp_coder *));
-static void FDECL(l_table_getset_feature_flag, (lua_State *, int, int,
- const char *, int));
-static void FDECL(sel_set_lit, (int, int, genericptr_t));
-static void FDECL(selection_iterate, (struct selectionvar *, select_iter_func,
- genericptr_t));
-static void FDECL(sel_set_ter, (int, int, genericptr_t));
-static void FDECL(sel_set_door, (int, int, genericptr_t));
-static void FDECL(sel_set_feature, (int, int, genericptr_t));
-static int FDECL(get_coord, (lua_State *, int, int *, int *));
-static void FDECL(levregion_add, (lev_region *));
-static void FDECL(get_table_xy_or_coord, (lua_State *, int *, int *));
-static int FDECL(get_table_region, (lua_State *, const char *,
- int *, int *, int *, int *, BOOLEAN_P));
-static void FDECL(set_wallprop_in_selection, (lua_State *, int));
-static int FDECL(floodfillchk_match_under, (int, int));
-static int FDECL(floodfillchk_match_accessible, (int, int));
-static boolean FDECL(sel_flood_havepoint, (int, int, xchar *, xchar *, int));
-static long FDECL(line_dist_coord, (long, long, long, long, long, long));
-static void FDECL(l_push_wid_hei_table, (lua_State *, int, int));
-static int FDECL(get_table_align, (lua_State *));
-static int FDECL(get_table_monclass, (lua_State *));
-static int FDECL(find_montype, (lua_State *, const char *, int *));
-static int FDECL(get_table_montype, (lua_State *, int *));
-static int FDECL(get_table_int_or_random, (lua_State *, const char *, int));
-static int FDECL(get_table_buc, (lua_State *));
-static int FDECL(get_table_objclass, (lua_State *));
-static int FDECL(find_objtype, (lua_State *, const char *));
-static int FDECL(get_table_objtype, (lua_State *));
-static int FDECL(get_table_roomtype_opt, (lua_State *, const char *, int));
-static int FDECL(get_table_traptype_opt, (lua_State *, const char *, int));
-static int FDECL(get_traptype_byname, (const char *));
-static int FDECL(get_table_intarray_entry, (lua_State *, int, int));
-static struct sp_coder *NDECL(sp_level_coder_init);
+static void spo_end_moninvent(void);
+static void spo_pop_container(void);
+static int l_create_stairway(lua_State *, boolean);
+static void spo_endroom(struct sp_coder *);
+static void l_table_getset_feature_flag(lua_State *, int, int, const char *,
+ int);
+static void sel_set_lit(int, int, genericptr_t);
+static void selection_iterate(struct selectionvar *, select_iter_func,
+ genericptr_t);
+static void sel_set_ter(int, int, genericptr_t);
+static void sel_set_door(int, int, genericptr_t);
+static void sel_set_feature(int, int, genericptr_t);
+static int get_coord(lua_State *, int, int *, int *);
+static void levregion_add(lev_region *);
+static void get_table_xy_or_coord(lua_State *, int *, int *);
+static int get_table_region(lua_State *, const char *, int *, int *, int *,
+ int *, boolean);
+static void set_wallprop_in_selection(lua_State *, int);
+static int floodfillchk_match_under(int, int);
+static int floodfillchk_match_accessible(int, int);
+static boolean sel_flood_havepoint(int, int, xchar *, xchar *, int);
+static long line_dist_coord(long, long, long, long, long, long);
+static void l_push_wid_hei_table(lua_State *, int, int);
+static int get_table_align(lua_State *);
+static int get_table_monclass(lua_State *);
+static int find_montype(lua_State *, const char *, int *);
+static int get_table_montype(lua_State *, int *);
+static int get_table_int_or_random(lua_State *, const char *, int);
+static int get_table_buc(lua_State *);
+static int get_table_objclass(lua_State *);
+static int find_objtype(lua_State *, const char *);
+static int get_table_objtype(lua_State *);
+static int get_table_roomtype_opt(lua_State *, const char *, int);
+static int get_table_traptype_opt(lua_State *, const char *, int);
+static int get_traptype_byname(const char *);
+static int get_table_intarray_entry(lua_State *, int, int);
+static struct sp_coder *sp_level_coder_init(void);
/* lua_CFunction prototypes */
-int FDECL(lspo_altar, (lua_State *));
-int FDECL(lspo_branch, (lua_State *));
-int FDECL(lspo_corridor, (lua_State *));
-int FDECL(lspo_door, (lua_State *));
-int FDECL(lspo_drawbridge, (lua_State *));
-int FDECL(lspo_engraving, (lua_State *));
-int FDECL(lspo_feature, (lua_State *));
-int FDECL(lspo_gold, (lua_State *));
-int FDECL(lspo_grave, (lua_State *));
-int FDECL(lspo_ladder, (lua_State *));
-int FDECL(lspo_level_flags, (lua_State *));
-int FDECL(lspo_level_init, (lua_State *));
-int FDECL(lspo_levregion, (lua_State *));
-int FDECL(lspo_map, (lua_State *));
-int FDECL(lspo_mazewalk, (lua_State *));
-int FDECL(lspo_message, (lua_State *));
-int FDECL(lspo_mineralize, (lua_State *));
-int FDECL(lspo_monster, (lua_State *));
-int FDECL(lspo_non_diggable, (lua_State *));
-int FDECL(lspo_non_passwall, (lua_State *));
-int FDECL(lspo_object, (lua_State *));
-int FDECL(lspo_portal, (lua_State *));
-int FDECL(lspo_random_corridors, (lua_State *));
-int FDECL(lspo_region, (lua_State *));
-int FDECL(lspo_replace_terrain, (lua_State *));
-int FDECL(lspo_reset_level, (lua_State *));
-int FDECL(lspo_room, (lua_State *));
-int FDECL(lspo_stair, (lua_State *));
-int FDECL(lspo_teleport_region, (lua_State *));
-int FDECL(lspo_terrain, (lua_State *));
-int FDECL(lspo_trap, (lua_State *));
-int FDECL(lspo_wall_property, (lua_State *));
-int FDECL(lspo_wallify, (lua_State *));
+int lspo_altar(lua_State *);
+int lspo_branch(lua_State *);
+int lspo_corridor(lua_State *);
+int lspo_door(lua_State *);
+int lspo_drawbridge(lua_State *);
+int lspo_engraving(lua_State *);
+int lspo_feature(lua_State *);
+int lspo_gold(lua_State *);
+int lspo_grave(lua_State *);
+int lspo_ladder(lua_State *);
+int lspo_level_flags(lua_State *);
+int lspo_level_init(lua_State *);
+int lspo_levregion(lua_State *);
+int lspo_map(lua_State *);
+int lspo_mazewalk(lua_State *);
+int lspo_message(lua_State *);
+int lspo_mineralize(lua_State *);
+int lspo_monster(lua_State *);
+int lspo_non_diggable(lua_State *);
+int lspo_non_passwall(lua_State *);
+int lspo_object(lua_State *);
+int lspo_portal(lua_State *);
+int lspo_random_corridors(lua_State *);
+int lspo_region(lua_State *);
+int lspo_replace_terrain(lua_State *);
+int lspo_reset_level(lua_State *);
+int lspo_room(lua_State *);
+int lspo_stair(lua_State *);
+int lspo_teleport_region(lua_State *);
+int lspo_terrain(lua_State *);
+int lspo_trap(lua_State *);
+int lspo_wall_property(lua_State *);
+int lspo_wallify(lua_State *);
#define LEFT 1
#define H_LEFT 2
/* Does typ match with levl[][].typ, considering special types
MATCH_WALL and MAX_TYPE (aka transparency)? */
static boolean
-match_maptyps(typ, levltyp)
-xchar typ, levltyp;
+match_maptyps(xchar typ, xchar levltyp)
{
if ((typ == MATCH_WALL) && !IS_STWALL(levltyp))
return FALSE;
}
struct mapfragment *
-mapfrag_fromstr(str)
-char *str;
+mapfrag_fromstr(char* str)
{
struct mapfragment *mf = (struct mapfragment *) alloc(sizeof(struct mapfragment));
}
void
-mapfrag_free(mf)
-struct mapfragment **mf;
+mapfrag_free(struct mapfragment** mf)
{
if (mf && *mf) {
free((*mf)->data);
}
schar
-mapfrag_get(mf, x,y)
-struct mapfragment *mf;
-int x,y;
+mapfrag_get(struct mapfragment* mf, int x, int y)
{
if (y < 0 || x < 0 || y > mf->hei-1 || x > mf->wid-1)
panic("outside mapfrag (%i,%i), wanted (%i,%i)", mf->wid, mf->hei, x,y);
}
boolean
-mapfrag_canmatch(mf)
-struct mapfragment *mf;
+mapfrag_canmatch(struct mapfragment* mf)
{
return ((mf->wid % 2) && (mf->hei % 2));
}
const char *
-mapfrag_error(mf)
-struct mapfragment *mf;
+mapfrag_error(struct mapfragment* mf)
{
if (!mf)
return "mapfragment error";
}
boolean
-mapfrag_match(mf, x,y)
-struct mapfragment *mf;
-int x,y;
+mapfrag_match(struct mapfragment* mf, int x, int y)
{
int rx, ry;
}
static void
-solidify_map()
+solidify_map(void)
{
xchar x, y;
}
static void
-lvlfill_maze_grid(x1, y1, x2, y2, filling)
-int x1, y1, x2, y2;
-schar filling;
+lvlfill_maze_grid(int x1, int y1, int x2, int y2, schar filling)
{
int x, y;
}
static void
-lvlfill_solid(filling, lit)
-schar filling;
-schar lit;
+lvlfill_solid(schar filling, schar lit)
{
int x, y;
}
static void
-lvlfill_swamp(fg, bg, lit)
-schar fg, bg, lit;
+lvlfill_swamp(schar fg, schar bg, schar lit)
{
int x,y;
}
static void
-flip_drawbridge_horizontal(lev)
-struct rm *lev;
+flip_drawbridge_horizontal(struct rm* lev)
{
if (IS_DRAWBRIDGE(lev->typ)) {
if ((lev->drawbridgemask & DB_DIR) == DB_WEST) {
}
static void
-flip_drawbridge_vertical(lev)
-struct rm *lev;
+flip_drawbridge_vertical(struct rm* lev)
{
if (IS_DRAWBRIDGE(lev->typ)) {
if ((lev->drawbridgemask & DB_DIR) == DB_NORTH) {
/* for #wizfliplevel; not needed when flipping during level creation;
update seen vector for whole flip area and glyph for known walls */
static void
-flip_visuals(flp, minx, miny, maxx, maxy)
-int flp;
-int minx, miny, maxx, maxy;
+flip_visuals(int flp, int minx, int miny, int maxx, int maxy)
{
struct rm *lev;
int x, y, seenv;
/* transpose top with bottom or left with right or both; sometimes called
for new special levels, or for any level via the #wizfliplevel command */
void
-flip_level(flp, extras)
-int flp;
-boolean extras;
+flip_level(int flp, boolean extras)
{
int x, y, i, itmp;
int minx, miny, maxx, maxy;
/* randomly transpose top with bottom or left with right or both;
caller controls which transpositions are allowed */
void
-flip_level_rnd(flp, extras)
-int flp;
-boolean extras;
+flip_level_rnd(int flp, boolean extras)
{
int c = 0;
static void
-sel_set_wall_property(x, y, arg)
-int x, y;
-genericptr_t arg;
+sel_set_wall_property(int x, int y, genericptr_t arg)
{
int prop = *(int *)arg;
* Make walls of the area (x1, y1, x2, y2) non diggable/non passwall-able
*/
static void
-set_wall_property(x1, y1, x2, y2, prop)
-xchar x1, y1, x2, y2;
-int prop;
+set_wall_property(xchar x1, xchar y1, xchar x2, xchar y2, int prop)
{
register xchar x, y;
* Count the different features (sinks, fountains) in the level.
*/
static void
-count_features()
+count_features(void)
{
xchar x, y;
}
static void
-remove_boundary_syms()
+remove_boundary_syms(void)
{
/*
* If any CROSSWALLs are found, must change to ROOM after REGION's
/* used by sel_set_door() and link_doors_rooms() */
static void
-set_door_orientation(x, y)
-int x, y;
+set_door_orientation(int x, int y)
{
boolean wleft, wright, wup, wdown;
}
static void
-maybe_add_door(x, y, droom)
-int x, y;
-struct mkroom *droom;
+maybe_add_door(int x, int y, struct mkroom* droom)
{
if (droom->hx >= 0 && g.doorindex < DOORMAX && inside_room(droom, x, y))
add_door(x, y, droom);
}
static void
-link_doors_rooms()
+link_doors_rooms(void)
{
int x, y;
int tmpi, m;
* Choose randomly the state (nodoor, open, closed or locked) for a door
*/
static int
-rnddoor()
+rnddoor(void)
{
static int state[] = { D_NODOOR, D_BROKEN, D_ISOPEN, D_CLOSED, D_LOCKED };
* Select a random trap
*/
static int
-rndtrap()
+rndtrap(void)
{
int rtrap;
* created underwater, or eels on dry land.
*/
static void
-get_location(x, y, humidity, croom)
-xchar *x, *y;
-int humidity;
-struct mkroom *croom;
+get_location(xchar *x, xchar *y, int humidity, struct mkroom* croom)
{
int cpt = 0;
int mx, my, sx, sy;
}
static boolean
-is_ok_location(x, y, humidity)
-register xchar x, y;
-register int humidity;
+is_ok_location(xchar x, xchar y, int humidity)
{
register int typ;
}
boolean
-pm_good_location(x, y, pm)
-int x, y;
-struct permonst *pm;
+pm_good_location(int x, int y, struct permonst* pm)
{
return is_ok_location(x, y, pm_to_humidity(pm));
}
static unpacked_coord
-get_unpacked_coord(loc, defhumidity)
-long loc;
-int defhumidity;
+get_unpacked_coord(long loc, int defhumidity)
{
static unpacked_coord c;
}
void
-get_location_coord(x, y, humidity, croom, crd)
-xchar *x, *y;
-int humidity;
-struct mkroom *croom;
-long crd;
+get_location_coord(
+ xchar *x, xchar *y,
+ int humidity,
+ struct mkroom* croom,
+ long crd)
{
unpacked_coord c;
*/
static void
-get_room_loc(x, y, croom)
-xchar *x, *y;
-struct mkroom *croom;
+get_room_loc(xchar* x, xchar* y, struct mkroom* croom)
{
coord c;
* negative values for x or y means RANDOM!
*/
static void
-get_free_room_loc(x, y, croom, pos)
-xchar *x, *y;
-struct mkroom *croom;
-packed_coord pos;
+get_free_room_loc(xchar* x, xchar* y, struct mkroom* croom, packed_coord pos)
{
xchar try_x, try_y;
register int trycnt = 0;
}
boolean
-check_room(lowx, ddx, lowy, ddy, vault)
-xchar *lowx, *ddx, *lowy, *ddy;
-boolean vault;
+check_room(xchar* lowx, xchar* ddx, xchar* lowy, xchar* ddy, boolean vault)
{
register int x, y, hix = *lowx + *ddx, hiy = *lowy + *ddy;
register struct rm *lev;
* This is still very incomplete...
*/
boolean
-create_room(x, y, w, h, xal, yal, rtype, rlit)
-xchar x, y;
-xchar w, h;
-xchar xal, yal;
-xchar rtype, rlit;
+create_room(
+ xchar x, xchar y,
+ xchar w, xchar h,
+ xchar xal, xchar yal,
+ xchar rtype, xchar rlit)
{
xchar xabs = 0, yabs = 0;
int wtmp, htmp, xaltmp, yaltmp, xtmp, ytmp;
* x & y are relative to the parent room.
*/
static boolean
-create_subroom(proom, x, y, w, h, rtype, rlit)
-struct mkroom *proom;
-xchar x, y;
-xchar w, h;
-xchar rtype, rlit;
+create_subroom(
+ struct mkroom *proom,
+ xchar x, xchar y,
+ xchar w, xchar h,
+ xchar rtype, xchar rlit)
{
xchar width, height;
* It's placed on a wall (north, south, east or west).
*/
static void
-create_door(dd, broom)
-room_door *dd;
-struct mkroom *broom;
+create_door(room_door* dd, struct mkroom* broom)
{
int x = 0, y = 0;
int trycnt = 0, wtry = 0;
* Create a secret door in croom on any one of the specified walls.
*/
void
-create_secret_door(croom, walls)
-struct mkroom *croom;
-xchar walls; /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */
+create_secret_door(
+ struct mkroom *croom,
+ xchar walls) /* any of W_NORTH | W_SOUTH | W_EAST | W_WEST (or W_ANY) */
{
xchar sx, sy; /* location of the secret door */
int count;
* Create a trap in a room.
*/
static void
-create_trap(t, croom)
-spltrap *t;
-struct mkroom *croom;
+create_trap(spltrap* t, struct mkroom* croom)
{
xchar x = -1, y = -1;
coord tm;
* Create a monster in a room.
*/
static int
-noncoalignment(alignment)
-aligntyp alignment;
+noncoalignment(aligntyp alignment)
{
int k;
/* attempt to screen out locations where a mimic-as-boulder shouldn't occur */
static boolean
-m_bad_boulder_spot(x, y)
-int x, y;
+m_bad_boulder_spot(int x, int y)
{
struct rm *lev;
}
static int
-pm_to_humidity(pm)
-struct permonst *pm;
+pm_to_humidity(struct permonst* pm)
{
int loc = DRY;
}
static void
-create_monster(m, croom)
-monster *m;
-struct mkroom *croom;
+create_monster(monster* m, struct mkroom* croom)
{
struct monst *mtmp;
xchar x, y;
* Create an object in a room.
*/
static void
-create_object(o, croom)
-object *o;
-struct mkroom *croom;
+create_object(object* o, struct mkroom* croom)
{
struct obj *otmp;
xchar x, y;
* Create an altar in a room.
*/
static void
-create_altar(a, croom)
-altar *a;
-struct mkroom *croom;
+create_altar(altar* a, struct mkroom* croom)
{
schar sproom;
xchar x = -1, y = -1;
* Search for a door in a room on a specified wall.
*/
static boolean
-search_door(croom, x, y, wall, cnt)
-struct mkroom *croom;
-xchar *x, *y;
-xchar wall;
-int cnt;
+search_door(
+ struct mkroom* croom,
+ xchar *x, xchar * y,
+ xchar wall, int cnt)
{
int dx, dy;
int xx, yy;
* Dig a corridor between two points.
*/
boolean
-dig_corridor(org, dest, nxcor, ftyp, btyp)
-coord *org, *dest;
-boolean nxcor;
-schar ftyp, btyp;
+dig_corridor(
+ coord *org,
+ coord *dest,
+ boolean nxcor,
+ schar ftyp,
+ schar btyp)
{
int dx = 0, dy = 0, dix, diy, cct;
struct rm *crm;
* (from a distance).
*/
static void
-create_corridor(c)
-corridor *c;
+create_corridor(corridor *c)
{
coord org, dest;
* Fill a room (shop, zoo, etc...) with appropriate stuff.
*/
void
-fill_special_room(croom)
-struct mkroom *croom;
+fill_special_room(struct mkroom* croom)
{
int i;
}
static struct mkroom *
-build_room(r, mkr)
-room *r;
-struct mkroom *mkr;
+build_room(room *r, struct mkroom* mkr)
{
boolean okroom;
struct mkroom *aroom;
* set lighting in a region that will not become a room.
*/
static void
-light_region(tmpregion)
-region *tmpregion;
+light_region(region* tmpregion)
{
register boolean litstate = tmpregion->rlit ? 1 : 0;
register int hiy = tmpregion->y2;
}
void
-wallify_map(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+wallify_map(int x1, int y1, int x2, int y2)
{
int x, y, xx, yy, lo_xx, lo_yy, hi_xx, hi_yy;
* the maze outside every part of the special level.
*/
static void
-maze1xy(m, humidity)
-coord *m;
-int humidity;
+maze1xy(coord *m, int humidity)
{
register int x, y, tryct = 2000;
/* tryct: normally it won't take more than ten or so tries due
* to the size of the maze.
*/
static void
-fill_empty_maze()
+fill_empty_maze(void)
{
int mapcountmax, mapcount, mapfact;
xchar x, y;
}
static void
-splev_initlev(linit)
-lev_init *linit;
+splev_initlev(lev_init* linit)
{
switch (linit->init_style) {
default:
#if 0
static long
-sp_code_jmpaddr(curpos, jmpaddr)
-long curpos, jmpaddr;
+sp_code_jmpaddr(long curpos, long jmpaddr)
{
return (curpos + jmpaddr);
}
/*ARGUSED*/
static void
-spo_end_moninvent()
+spo_end_moninvent(void)
{
if (invent_carrying_monster)
m_dowear(invent_carrying_monster, TRUE);
/*ARGUSED*/
static void
-spo_pop_container()
+spo_pop_container(void)
{
if (container_idx > 0) {
container_idx--;
/* push a table on lua stack: {width=wid, height=hei} */
static void
-l_push_wid_hei_table(L, wid, hei)
-lua_State *L;
-int wid, hei;
+l_push_wid_hei_table(lua_State* L, int wid, int hei)
{
lua_newtable(L);
/* message("What a strange feeling!"); */
int
-lspo_message(L)
-lua_State *L;
+lspo_message(lua_State* L)
{
char *levmsg;
int old_n, n;
}
static int
-get_table_align(L)
-lua_State *L;
+get_table_align(lua_State* L)
{
static const char *const gtaligns[] = {
"noalign", "law", "neutral", "chaos",
}
static int
-get_table_monclass(L)
-lua_State *L;
+get_table_monclass(lua_State* L)
{
char *s = get_table_str_opt(L, "class", NULL);
int ret = -1;
}
static int
-find_montype(L, s, mgender)
-lua_State *L UNUSED;
-const char *s;
-int *mgender;
+find_montype(
+ lua_State *L UNUSED,
+ const char *s,
+ int *mgender)
{
int i, mgend = NEUTRAL;
}
static int
-get_table_montype(L, mgender)
-lua_State *L;
-int *mgender;
+get_table_montype(lua_State* L, int *mgender)
{
char *s = get_table_str_opt(L, "id", NULL);
int ret = NON_PM;
}
static void
-get_table_xy_or_coord(L, x,y)
-lua_State *L;
-int *x, *y;
+get_table_xy_or_coord(lua_State* L, int *x, int *y)
{
int mx = get_table_int_opt(L, "x", -1);
int my = get_table_int_opt(L, "y", -1);
/* monster({ id = "giant mimic", appear_as = "obj:boulder" }); */
/* monster({ class = "H", peaceful = 0 }); */
int
-lspo_monster(L)
-lua_State *L;
+lspo_monster(lua_State* L)
{
int argc = lua_gettop(L);
monster tmpmons;
or if not existent, also return rndval.
*/
static int
-get_table_int_or_random(L, name, rndval)
-lua_State *L;
-const char *name;
-int rndval;
+get_table_int_or_random(lua_State* L, const char* name, int rndval)
{
int ret;
char buf[BUFSZ];
}
static int
-get_table_buc(L)
-lua_State *L;
+get_table_buc(lua_State* L)
{
static const char *const bucs[] = {
"random", "blessed", "uncursed", "cursed",
}
static int
-get_table_objclass(L)
-lua_State *L;
+get_table_objclass(lua_State* L)
{
char *s = get_table_str_opt(L, "class", NULL);
int ret = -1;
}
static int
-find_objtype(L, s)
-lua_State *L;
-const char *s;
+find_objtype(lua_State* L, const char *s)
{
if (s) {
int i;
}
static int
-get_table_objtype(L)
-lua_State *L;
+get_table_objtype(lua_State* L)
{
char *s = get_table_str_opt(L, "id", NULL);
int ret = find_objtype(L, s);
/* object({ id = "boulder", x = 03, y = 12}); */
/* object({ id = "boulder", coord = {03,12} }); */
int
-lspo_object(L)
-lua_State *L;
+lspo_object(lua_State* L)
{
static object zeroobject = { DUMMY };
#if 0
/* level_flags("noteleport", "mazelevel", ... ); */
int
-lspo_level_flags(L)
-lua_State *L;
+lspo_level_flags(lua_State* L)
{
int argc = lua_gettop(L);
int i;
/* level_init({ style = "solidfill", fg = " " }); */
/* level_init({ style = "mines", fg = ".", bg = "}", smoothed=1, joined=1, lit=0 }) */
int
-lspo_level_init(L)
-lua_State *L;
+lspo_level_init(lua_State* L)
{
static const char *const initstyles[] = {
"solidfill", "mazegrid", "maze", "rogue", "mines", "swamp", NULL
/* engraving({ coord={1, 1}, type="burn", text="Foo" }); */
/* engraving({x,y}, "engrave", "Foo"); */
int
-lspo_engraving(L)
-lua_State *L;
+lspo_engraving(lua_State* L)
{
static const char *const engrtypes[] = {
"dust", "engrave", "burn", "mark", "blood", NULL
}
int
-lspo_mineralize(L)
-lua_State *L;
+lspo_mineralize(lua_State* L)
{
int gem_prob, gold_prob, kelp_moat, kelp_pool;
};
static int
-get_table_roomtype_opt(L, name, defval)
-lua_State *L;
-const char *name;
-int defval;
+get_table_roomtype_opt(lua_State* L, const char *name, int defval)
{
char *roomstr = get_table_str_opt(L, name, emptystr);
int i, res = defval;
/* room({ lit=1, coord={3,3}, xalign="center",yalign="center", w=11,h=9 }); */
/* room({ coord={3,3}, xalign="center",yalign="center", w=11,h=9, contents=function(room) ... end }); */
int
-lspo_room(L)
-lua_State *L;
+lspo_room(lua_State* L)
{
create_des_coder();
}
static void
-spo_endroom(coder)
-struct sp_coder *coder UNUSED;
+spo_endroom(struct sp_coder* coder UNUSED)
{
if (g.coder->n_subroom > 1) {
g.coder->n_subroom--;
}
static int
-l_create_stairway(L, using_ladder)
-lua_State *L;
-boolean using_ladder;
+l_create_stairway(lua_State* L, boolean using_ladder)
{
static const char *const stairdirs[] = { "down", "up", NULL };
static const int stairdirs2i[] = { 0, 1 };
/* TODO: stair(selection, "down"); */
/* TODO: stair("up", {x,y}); */
int
-lspo_stair(L)
-lua_State *L;
+lspo_stair(lua_State* L)
{
return l_create_stairway(L, FALSE);
}
/* ladder("up", 6,10); */
/* ladder({ x=11, y=05, dir="down" }); */
int
-lspo_ladder(L)
-lua_State *L;
+lspo_ladder(lua_State* L)
{
return l_create_stairway(L, TRUE);
}
/* grave({ x = 1, y = 1, text = "Foo" }); */
/* grave({ coord = {1, 1}, text = "Foo" }); */
int
-lspo_grave(L)
-lua_State *L;
+lspo_grave(lua_State* L)
{
int argc = lua_gettop(L);
xchar x, y;
/* altar({ x=NN, y=NN, align=ALIGNMENT, type=SHRINE }); */
/* des.altar({ coord = {5, 10}, align="noalign", type="altar" }); */
int
-lspo_altar(L)
-lua_State *L;
+lspo_altar(lua_State* L)
{
static const char *const shrines[] = {
"altar", "shrine", "sanctum", NULL
{ 0, NO_TRAP } };
static int
-get_table_traptype_opt(L, name, defval)
-lua_State *L;
-const char *name;
-int defval;
+get_table_traptype_opt(lua_State* L, const char *name, int defval)
{
char *trapstr = get_table_str_opt(L, name, emptystr);
int i, res = defval;
}
const char *
-get_trapname_bytype(ttyp)
-int ttyp;
+get_trapname_bytype(int ttyp)
{
int i;
}
static int
-get_traptype_byname(trapname)
-const char *trapname;
+get_traptype_byname(const char *trapname)
{
int i;
/* trap("rust") */
/* trap(); */
int
-lspo_trap(L)
-lua_State *L;
+lspo_trap(lua_State* L)
{
spltrap tmptrap;
int x, y;
/* gold({ amount = 500, coord = {2, 5} });*/
/* gold(); */
int
-lspo_gold(L)
-lua_State *L;
+lspo_gold(lua_State* L)
{
int argc = lua_gettop(L);
xchar x, y;
/* corridor({ srcroom=1, srcdoor=2, srcwall="north", destroom=2, destdoor=1, destwall="west" });*/
int
-lspo_corridor(L)
-lua_State *L;
+lspo_corridor(lua_State* L)
{
static const char *const walldirs[] = {
"all", "random", "north", "west", "east", "south", NULL
/* random_corridors(); */
int
-lspo_random_corridors(L)
-lua_State *L UNUSED;
+lspo_random_corridors(lua_State* L UNUSED)
{
corridor tc;
/* selection */
struct selectionvar *
-selection_new()
+selection_new(void)
{
struct selectionvar *tmps = (struct selectionvar *) alloc(sizeof(struct selectionvar));
}
void
-selection_free(sel, freesel)
-struct selectionvar *sel;
-boolean freesel;
+selection_free(struct selectionvar* sel, boolean freesel)
{
if (sel) {
Free(sel->map);
}
struct selectionvar *
-selection_clone(sel)
-struct selectionvar *sel;
+selection_clone(struct selectionvar* sel)
{
struct selectionvar *
tmps = (struct selectionvar *) alloc(sizeof (struct selectionvar));
}
xchar
-selection_getpoint(x, y, sel)
-int x, y;
-struct selectionvar *sel;
+selection_getpoint(int x, int y, struct selectionvar* sel)
{
if (!sel || !sel->map)
return 0;
}
void
-selection_setpoint(x, y, sel, c)
-int x, y;
-struct selectionvar *sel;
-xchar c;
+selection_setpoint(int x, int y, struct selectionvar* sel, xchar c)
{
if (!sel || !sel->map)
return;
}
struct selectionvar *
-selection_not(s)
-struct selectionvar *s;
+selection_not(struct selectionvar* s)
{
int x, y;
}
struct selectionvar *
-selection_filter_mapchar(ov, typ, lit)
-struct selectionvar *ov;
-xchar typ;
-int lit;
+selection_filter_mapchar(struct selectionvar* ov, xchar typ, int lit)
{
int x, y;
struct selectionvar *ret = selection_new();
}
void
-selection_filter_percent(ov, percent)
-struct selectionvar *ov;
-int percent;
+selection_filter_percent(struct selectionvar* ov, int percent)
{
int x, y;
}
int
-selection_rndcoord(ov, x, y, removeit)
-struct selectionvar *ov;
-xchar *x, *y;
-boolean removeit;
+selection_rndcoord(struct selectionvar* ov, xchar *x, xchar *y, boolean removeit)
{
int idx = 0;
int c;
}
void
-selection_do_grow(ov, dir)
-struct selectionvar *ov;
-int dir;
+selection_do_grow(struct selectionvar* ov, int dir)
{
int x, y;
struct selectionvar *tmp = selection_new();
selection_free(tmp, TRUE);
}
-static int FDECL((*selection_flood_check_func), (int, int));
+static int (*selection_flood_check_func)(int, int);
static schar floodfillchk_match_under_typ;
void
-set_selection_floodfillchk(f)
-int FDECL((*f), (int, int));
+set_selection_floodfillchk(int (*f)(int, int))
{
selection_flood_check_func = f;
}
static int
-floodfillchk_match_under(x,y)
-int x,y;
+floodfillchk_match_under(int x, int y)
{
return (floodfillchk_match_under_typ == levl[x][y].typ);
}
void
-set_floodfillchk_match_under(typ)
-xchar typ;
+set_floodfillchk_match_under(xchar typ)
{
floodfillchk_match_under_typ = typ;
set_selection_floodfillchk(floodfillchk_match_under);
}
static int
-floodfillchk_match_accessible(x, y)
-int x, y;
+floodfillchk_match_accessible(int x, int y)
{
return (ACCESSIBLE(levl[x][y].typ)
|| levl[x][y].typ == SDOOR
/* check whethere <x,y> is already in xs[],ys[] */
static boolean
-sel_flood_havepoint(x, y, xs, ys, n)
-int x, y;
-xchar xs[], ys[];
-int n;
+sel_flood_havepoint(int x, int y, xchar xs[], xchar ys[], int n)
{
xchar xx = (xchar) x, yy = (xchar) y;
}
void
-selection_floodfill(ov, x, y, diagonals)
-struct selectionvar *ov;
-int x, y;
-boolean diagonals;
+selection_floodfill(struct selectionvar* ov, int x, int y, boolean diagonals)
{
struct selectionvar *tmp = selection_new();
#define SEL_FLOOD_STACK (COLNO * ROWNO)
xchar dx[SEL_FLOOD_STACK];
xchar dy[SEL_FLOOD_STACK];
- if (selection_flood_check_func == (int FDECL((*), (int, int))) 0) {
+ if (selection_flood_check_func == (int (*)(int, int)) 0) {
selection_free(tmp, TRUE);
return;
}
/* McIlroy's Ellipse Algorithm */
void
-selection_do_ellipse(ov, xc, yc, a, b, filled)
-struct selectionvar *ov;
-int xc, yc, a, b, filled;
+selection_do_ellipse(
+ struct selectionvar *ov,
+ int xc, int yc,
+ int a, int b,
+ int filled)
{ /* e(x,y) = b^2*x^2 + a^2*y^2 - a^2*b^2 */
int x = 0, y = b;
long a2 = (long) a * a, b2 = (long) b * b;
/* distance from line segment (x1,y1, x2,y2) to point (x3,y3) */
static long
-line_dist_coord(x1, y1, x2, y2, x3, y3)
-long x1, y1, x2, y2, x3, y3;
+line_dist_coord(long x1, long y1, long x2, long y2, long x3, long y3)
{
long px = x2 - x1;
long py = y2 - y1;
}
void
-selection_do_gradient(ov, x, y, x2, y2, gtyp, mind, maxd, limit)
-struct selectionvar *ov;
-long x, y, x2, y2, gtyp, mind, maxd, limit;
+selection_do_gradient(
+ struct selectionvar *ov,
+ long x, long y,
+ long x2,long y2,
+ long gtyp,
+ long mind, long maxd, long limit)
{
long dx, dy, dofs;
/* bresenham line algo */
void
-selection_do_line(x1, y1, x2, y2, ov)
-xchar x1, y1, x2, y2;
-struct selectionvar *ov;
+selection_do_line(
+xchar x1, xchar y1,
+xchar x2, xchar y2,
+struct selectionvar *ov)
{
int d0, dx, dy, ai, bi, xi, yi;
}
void
-selection_do_randline(x1, y1, x2, y2, rough, rec, ov)
-xchar x1, y1, x2, y2;
-schar rough, rec;
-struct selectionvar *ov;
+selection_do_randline(
+xchar x1, xchar y1,
+xchar x2, xchar y2,
+schar rough,
+schar rec,
+struct selectionvar *ov)
{
int mx, my;
int dx, dy;
}
static void
-selection_iterate(ov, func, arg)
-struct selectionvar *ov;
-select_iter_func func;
-genericptr_t arg;
+selection_iterate(
+struct selectionvar *ov,
+select_iter_func func,
+genericptr_t arg)
{
int x, y;
}
static void
-sel_set_ter(x, y, arg)
-int x, y;
-genericptr_t arg;
+sel_set_ter(int x, int y, genericptr_t arg)
{
terrain terr;
}
static void
-sel_set_feature(x, y, arg)
-int x, y;
-genericptr_t arg;
+sel_set_feature(int x, int y, genericptr_t arg)
{
if (IS_FURNITURE(levl[x][y].typ))
return;
}
static void
-sel_set_door(dx, dy, arg)
-int dx, dy;
-genericptr_t arg;
+sel_set_door(int dx, int dy, genericptr_t arg)
{
xchar typ = *(xchar *) arg;
xchar x = dx, y = dy;
/* door({ wall = "north", pos = 3, state="secret" }); */
/* door("nodoor", 1, 2); */
int
-lspo_door(L)
-lua_State *L;
+lspo_door(lua_State* L)
{
static const char *const doorstates[] = {
"random", "open", "closed", "locked", "nodoor", "broken",
}
static void
-l_table_getset_feature_flag(L, x,y, name, flag)
-lua_State *L;
-int x, y;
-const char *name;
-int flag;
+l_table_getset_feature_flag(
+ lua_State *L,
+ int x, int y,
+ const char *name,
+ int flag)
{
int val = get_table_boolean_opt(L, name, -2);
/* feature({ type="fountain", coord={NN, NN} }); */
/* feature({ type="tree", coord={NN, NN}, swarm=true, looted=false }); */
int
-lspo_feature(L)
-lua_State *L;
+lspo_feature(lua_State* L)
{
static const char *const features[] = { "fountain", "sink", "pool",
"throne", "tree", NULL };
* terrain(x,y, MAPCHAR);
*/
int
-lspo_terrain(L)
-lua_State *L;
+lspo_terrain(lua_State* L)
{
terrain tmpterrain;
xchar x = 0, y = 0;
* toterrain=MAPCHAR });
*/
int
-lspo_replace_terrain(L)
-lua_State *L;
+lspo_replace_terrain(lua_State* L)
{
xchar totyp, fromtyp;
struct mapfragment *mf = NULL;
}
static boolean
-generate_way_out_method(nx,ny, ov)
-int nx,ny;
-struct selectionvar *ov;
+generate_way_out_method(
+ int nx, int ny,
+ struct selectionvar *ov)
{
static const int escapeitems[] = {
PICK_AXE, DWARVISH_MATTOCK, WAN_DIGGING,
}
static void
-ensure_way_out()
+ensure_way_out(void)
{
struct selectionvar *ov = selection_new();
struct trap *ttmp = g.ftrap;
}
static int
-get_table_intarray_entry(L, tableidx, entrynum)
-lua_State *L;
-int tableidx, entrynum;
+get_table_intarray_entry(lua_State* L, int tableidx, int entrynum)
{
int ret = 0;
if (tableidx < 0)
}
static int
-get_table_region(L, name, x1,y1, x2,y2, optional)
-lua_State *L;
-const char *name;
-int *x1, *y1, *x2, *y2;
-boolean optional;
+get_table_region(
+ lua_State *L,
+ const char *name,
+ int *x1, int *y1,
+ int *x2, int *y2,
+ boolean optional)
{
int arrlen;
}
static int
-get_coord(L, index, x, y)
-lua_State *L;
-int index;
-int *x, *y;
+get_coord(lua_State* L, int i, int *x, int *y)
{
- if (lua_type(L, index) == LUA_TTABLE) {
+ if (lua_type(L, i) == LUA_TTABLE) {
int arrlen;
- lua_len(L, index);
+ lua_len(L, i);
arrlen = lua_tointeger(L, -1);
lua_pop(L, 1);
if (arrlen != 2) {
return 0;
}
- *x = get_table_intarray_entry(L, index, 1);
- *y = get_table_intarray_entry(L, index, 2);
+ *x = get_table_intarray_entry(L, i, 1);
+ *y = get_table_intarray_entry(L, i, 2);
return 1;
}
}
static void
-levregion_add(lregion)
-lev_region *lregion;
+levregion_add(lev_region* lregion)
{
if (!lregion->in_islev) {
get_location(&lregion->inarea.x1, &lregion->inarea.y1, ANY_LOC,
/* teleport_region({ region = { x1,y1, x2,y2}, [ region_islev = 1, ] exclude = { x1,y1, x2,y2}, [ exclude_islen = 1, ] [ dir = "up" ] }); */
/* TODO: maybe allow using selection, with a new selection method "getextents()"? */
int
-lspo_teleport_region(L)
-lua_State *L;
+lspo_teleport_region(lua_State* L)
{
static const char *const teledirs[] = { "both", "down", "up", NULL };
static const int teledirs2i[] = { LR_TELE, LR_DOWNTELE, LR_UPTELE, -1 };
/* levregion({ region = { x1,y1, x2,y2 }, exclude = { x1,y1, x2,y2 }, type = "portal", name="air" }); */
/* TODO: allow region to be optional, defaulting to whole level */
int
-lspo_levregion(L)
-lua_State *L;
+lspo_levregion(lua_State* L)
{
static const char *const regiontypes[] = {
"stair-down", "stair-up", "portal", "branch",
}
static void
-sel_set_lit(x, y, arg)
-int x, y;
-genericptr_t arg;
+sel_set_lit(int x, int y, genericptr_t arg)
{
int lit = *(int *)arg;
/* region({ x1=NN, y1=NN, x2=NN, y2=NN, lit=BOOL, type=ROOMTYPE, joined=BOOL, irregular=BOOL, filled=NN [ , contents = FUNCTION ] }); */
/* region({ region={x1,y1, x2,y2}, type="ordinary" }); */
int
-lspo_region(L)
-lua_State *L;
+lspo_region(lua_State* L)
{
xchar dx1, dy1, dx2, dy2;
register struct mkroom *troom;
/* drawbridge({ dir="east", state="closed", x=05,y=08 }); */
/* drawbridge({ dir="east", state="closed", coord={05,08} }); */
int
-lspo_drawbridge(L)
-lua_State *L;
+lspo_drawbridge(lua_State* L)
{
static const char *const mwdirs[] = {
"north", "south", "west", "east", "random", NULL
/* mazewalk({ coord = {XX, YY}, typ = ".", dir = "north", stocked = 0 }); */
/* mazewalk(x,y,dir); */
int
-lspo_mazewalk(L)
-lua_State *L;
+lspo_mazewalk(lua_State* L)
{
static const char *const mwdirs[] = {
"north", "south", "east", "west", "random", NULL
/* wall_property({ x1=0, y1=0, x2=78, y2=20, property="nondiggable" }); */
/* wall_property({ region = {1,0, 78,20}, property="nonpasswall" }); */
int
-lspo_wall_property(L)
-lua_State *L;
+lspo_wall_property(lua_State* L)
{
static const char *const wprops[] = { "nondiggable", "nonpasswall", NULL };
static const int wprop2i[] = { W_NONDIGGABLE, W_NONPASSWALL, -1 };
}
static void
-set_wallprop_in_selection(L, prop)
-lua_State *L;
-int prop;
+set_wallprop_in_selection(lua_State* L, int prop)
{
int argc = lua_gettop(L);
boolean freesel = FALSE;
/* non_diggable(selection); */
/* non_diggable(); */
int
-lspo_non_diggable(L)
-lua_State *L;
+lspo_non_diggable(lua_State* L)
{
set_wallprop_in_selection(L, W_NONDIGGABLE);
return 0;
/* non_passwall(selection); */
/* non_passwall(); */
int
-lspo_non_passwall(L)
-lua_State *L;
+lspo_non_passwall(lua_State* L)
{
set_wallprop_in_selection(L, W_NONPASSWALL);
return 0;
#if 0
/*ARGSUSED*/
static void
-sel_set_wallify(x, y, arg)
-int x, y;
-genericptr_t arg UNUSED;
+sel_set_wallify(int x, int y, genericptr_t arg UNUSED)
{
wallify_map(x, y, x, y);
}
/* wallify({ x1=NN,y1=NN, x2=NN,y2=NN }); */
/* wallify(); */
int
-lspo_wallify(L)
-lua_State *L;
+lspo_wallify(lua_State* L)
{
int dx1 = -1, dy1 = -1, dx2 = -1, dy2 = -1;
/* reset_level is only needed for testing purposes */
int
-lspo_reset_level(L)
-lua_State *L UNUSED;
+lspo_reset_level(lua_State* L UNUSED)
{
boolean wtower = In_W_tower(u.ux, u.uy, &u.uz);
/* map({ map = [[...]], contents = function(map) ... end }); */
/* map([[...]]) */
int
-lspo_map(L)
-lua_State *L;
+lspo_map(lua_State* L)
{
/*
TODO: allow passing an array of strings as map data
}
void
-update_croom()
+update_croom(void)
{
if (!g.coder)
return;
}
static struct sp_coder *
-sp_level_coder_init()
+sp_level_coder_init(void)
{
int tmpi;
struct sp_coder *coder =
*/
void
-l_register_des(L)
-lua_State *L;
+l_register_des(lua_State* L)
{
/* register des -table, and functions for it */
lua_newtable(L);
}
void
-create_des_coder()
+create_des_coder(void)
{
if (!g.coder)
g.coder = sp_level_coder_init();
* General loader
*/
boolean
-load_special(name)
-const char *name;
+load_special(const char *name)
{
boolean result = FALSE;
#define spellet(spell) \
((char) ((spell < 26) ? ('a' + spell) : ('A' + spell - 26)))
-static int FDECL(spell_let_to_idx, (CHAR_P));
-static boolean FDECL(cursed_book, (struct obj * bp));
-static boolean FDECL(confused_book, (struct obj *));
-static void FDECL(deadbook, (struct obj *));
-static int NDECL(learn);
-static boolean NDECL(rejectcasting);
-static boolean FDECL(getspell, (int *));
-static int FDECL(CFDECLSPEC spell_cmp, (const genericptr,
- const genericptr));
-static void NDECL(sortspells);
-static boolean NDECL(spellsortmenu);
-static boolean FDECL(dospellmenu, (const char *, int, int *));
-static int FDECL(percent_success, (int));
-static char *FDECL(spellretention, (int, char *));
-static int NDECL(throwspell);
-static void NDECL(cast_protection);
-static void FDECL(spell_backfire, (int));
-static const char *FDECL(spelltypemnemonic, (int));
-static boolean FDECL(spell_aim_step, (genericptr_t, int, int));
+static int spell_let_to_idx(char);
+static boolean cursed_book(struct obj * bp);
+static boolean confused_book(struct obj *);
+static void deadbook(struct obj *);
+static int learn(void);
+static boolean rejectcasting(void);
+static boolean getspell(int *);
+static int CFDECLSPEC spell_cmp(const genericptr, const genericptr);
+static void sortspells(void);
+static boolean spellsortmenu(void);
+static boolean dospellmenu(const char *, int, int *);
+static int percent_success(int);
+static char *spellretention(int, char *);
+static int throwspell(void);
+static void cast_protection(void);
+static void spell_backfire(int);
+static const char *spelltypemnemonic(int);
+static boolean spell_aim_step(genericptr_t, int, int);
/* The roles[] table lists the role-specific values for tuning
* percent_success().
/* convert a letter into a number in the range 0..51, or -1 if not a letter */
static int
-spell_let_to_idx(ilet)
-char ilet;
+spell_let_to_idx(char ilet)
{
int indx;
/* TRUE: book should be destroyed by caller */
static boolean
-cursed_book(bp)
-struct obj *bp;
+cursed_book(struct obj* bp)
{
boolean was_in_use;
int lev = objects[bp->otyp].oc_level;
/* study while confused: returns TRUE if the book is destroyed */
static boolean
-confused_book(spellbook)
-struct obj *spellbook;
+confused_book(struct obj* spellbook)
{
boolean gone = FALSE;
/* special effects for The Book of the Dead; reading it while blind is
allowed so that needs to be taken into account too */
static void
-deadbook(book2)
-struct obj *book2;
+deadbook(struct obj* book2)
{
struct monst *mtmp, *mtmp2;
coord mm;
/* 'book' has just become cursed; if we're reading it and realize it is
now cursed, interrupt */
void
-book_cursed(book)
-struct obj *book;
+book_cursed(struct obj* book)
{
if (g.occupation == learn && g.context.spbook.book == book
&& book->cursed && book->bknown && g.multi >= 0)
}
int
-study_book(spellbook)
-register struct obj *spellbook;
+study_book(register struct obj* spellbook)
{
int booktype = spellbook->otyp, i;
boolean confused = (Confusion != 0);
/* a spellbook has been destroyed or the character has changed levels;
the stored address for the current book is no longer valid */
void
-book_disappears(obj)
-struct obj *obj;
+book_disappears(struct obj* obj)
{
if (obj == g.context.spbook.book) {
g.context.spbook.book = (struct obj *) 0;
so the sequence start reading, get interrupted, name the book, resume
reading would read the "new" book from scratch */
void
-book_substitution(old_obj, new_obj)
-struct obj *old_obj, *new_obj;
+book_substitution(struct obj* old_obj, struct obj* new_obj)
{
if (old_obj == g.context.spbook.book) {
g.context.spbook.book = new_obj;
/* called from moveloop() */
void
-age_spells()
+age_spells(void)
{
int i;
/*
/* return True if spellcasting is inhibited;
only covers a small subset of reasons why casting won't work */
static boolean
-rejectcasting()
+rejectcasting(void)
{
/* rejections which take place before selecting a particular spell */
if (Stunned) {
* parameter. Otherwise return FALSE.
*/
static boolean
-getspell(spell_no)
-int *spell_no;
+getspell(int* spell_no)
{
int nspells, idx;
char ilet, lets[BUFSZ], qbuf[QBUFSZ];
/* the 'Z' command -- cast a spell */
int
-docast()
+docast(void)
{
int spell_no;
}
static const char *
-spelltypemnemonic(skill)
-int skill;
+spelltypemnemonic(int skill)
{
switch (skill) {
case P_ATTACK_SPELL:
}
int
-spell_skilltype(booktype)
-int booktype;
+spell_skilltype(int booktype)
{
return objects[booktype].oc_skill;
}
static void
-cast_protection()
+cast_protection(void)
{
int l = u.ulevel, loglev = 0,
gain, natac = u.uac + u.uspellprot;
/* attempting to cast a forgotten spell will cause disorientation */
static void
-spell_backfire(spell)
-int spell;
+spell_backfire(int spell)
{
long duration = (long) ((spellev(spell) + 1) * 3), /* 6..24 */
old_stun = (HStun & TIMEOUT), old_conf = (HConfusion & TIMEOUT);
}
int
-spelleffects(spell, atme)
-int spell;
-boolean atme;
+spelleffects(int spell, boolean atme)
{
int energy, damage, chance, n, intell;
int otyp, skill, role_skill, res = 0;
/*ARGSUSED*/
static boolean
-spell_aim_step(arg, x, y)
-genericptr_t arg UNUSED;
-int x, y;
+spell_aim_step(genericptr_t arg UNUSED, int x, int y)
{
if (!isok(x,y))
return FALSE;
/* Choose location where spell takes effect. */
static int
-throwspell()
+throwspell(void)
{
coord cc, uc;
struct monst *mtmp;
/* add/hide/remove/unhide teleport-away on behalf of dotelecmd() to give
more control to behavior of ^T when used in wizard mode */
int
-tport_spell(what)
-int what;
+tport_spell(int what)
{
static struct tport_hideaway {
struct spell savespell;
they used to be lost entirely, as if never learned, but now we
just set the memory retention to zero so that they can't be cast */
void
-losespells()
+losespells(void)
{
int n, nzap, i;
/* qsort callback routine */
static int CFDECLSPEC
-spell_cmp(vptr1, vptr2)
-const genericptr vptr1;
-const genericptr vptr2;
+spell_cmp(const genericptr vptr1, const genericptr vptr2)
{
/*
* gather up all of the possible parameters except spell name
list (sortmode == SORTBY_xxx), or sort the spellbook itself to make
the current display order stick (sortmode == SORTRETAINORDER) */
static void
-sortspells()
+sortspells(void)
{
int i;
#if defined(SYSV) || defined(DGUX)
/* called if the [sort spells] entry in the view spells menu gets chosen */
static boolean
-spellsortmenu()
+spellsortmenu(void)
{
winid tmpwin;
menu_item *selected;
/* the '+' command -- view known spells */
int
-dovspell()
+dovspell(void)
{
char qbuf[QBUFSZ];
int splnum, othnum;
}
static boolean
-dospellmenu(prompt, splaction, spell_no)
-const char *prompt;
-int splaction; /* SPELLMENU_CAST, SPELLMENU_VIEW, or g.spl_book[] index */
-int *spell_no;
+dospellmenu(
+ const char *prompt,
+ int splaction, /* SPELLMENU_CAST, SPELLMENU_VIEW, or g.spl_book[] index */
+ int *spell_no)
{
winid tmpwin;
int i, n, how, splnum;
}
static int
-percent_success(spell)
-int spell;
+percent_success(int spell)
{
/* Intrinsic and learned ability are combined to calculate
* the probability of player's success at cast a given spell.
}
static char *
-spellretention(idx, outbuf)
-int idx;
-char *outbuf;
+spellretention(int idx, char * outbuf)
{
long turnsleft, percent, accuracy;
int skill;
/* Learn a spell during creation of the initial inventory */
void
-initialspell(obj)
-struct obj *obj;
+initialspell(struct obj* obj)
{
int i, otyp = obj->otyp;
#include "hack.h"
-static int NDECL(stealarm);
-static int NDECL(unstolenarm);
-static const char *FDECL(equipname, (struct obj *));
+static int stealarm(void);
+static int unstolenarm(void);
+static const char *equipname(struct obj *);
static const char *
-equipname(otmp)
-register struct obj *otmp;
+equipname(register struct obj* otmp)
{
return ((otmp == uarmu) ? shirt_simple_name(otmp)
: (otmp == uarmf) ? boots_simple_name(otmp)
/* proportional subset of gold; return value actually fits in an int */
long
-somegold(lmoney)
-long lmoney;
+somegold(long lmoney)
{
#ifdef LINT /* long conv. ok */
int igold = 0;
* Deals in gold only, as leprechauns don't care for lesser coins.
*/
struct obj *
-findgold(chain)
-register struct obj *chain;
+findgold(register struct obj* chain)
{
while (chain && chain->otyp != GOLD_PIECE)
chain = chain->nobj;
* Steal gold coins only. Leprechauns don't care for lesser coins.
*/
void
-stealgold(mtmp)
-register struct monst *mtmp;
+stealgold(register struct monst* mtmp)
{
register struct obj *fgold = g_at(u.ux, u.uy);
register struct obj *ygold;
/* monster who was stealing from hero has just died */
void
-thiefdead()
+thiefdead(void)
{
/* hero is busy taking off an item of armor which takes multiple turns */
g.stealmid = 0;
/* An object you're wearing has been taken off by a monster (theft or
seduction). Also used if a worn item gets transformed (stone to flesh). */
void
-remove_worn_item(obj, unchain_ball)
-struct obj *obj;
-boolean unchain_ball; /* whether to unpunish or just unwield */
+remove_worn_item(
+ struct obj *obj,
+ boolean unchain_ball) /* whether to unpunish or just unwield */
{
if (donning(obj))
cancel_don();
* Nymphs and monkeys won't steal coins.
*/
int
-steal(mtmp, objnambuf)
-struct monst *mtmp;
-char *objnambuf;
+steal(struct monst* mtmp, char* objnambuf)
{
struct obj *otmp;
int tmp, could_petrify, armordelay, olddelay, icnt,
/* Returns 1 if otmp is free'd, 0 otherwise. */
int
-mpickobj(mtmp, otmp)
-register struct monst *mtmp;
-register struct obj *otmp;
+mpickobj(register struct monst* mtmp, register struct obj* otmp)
{
int freed_otmp;
boolean snuff_otmp = FALSE;
/* called for AD_SAMU (the Wizard and quest nemeses) */
void
-stealamulet(mtmp)
-struct monst *mtmp;
+stealamulet(struct monst* mtmp)
{
char buf[BUFSZ];
struct obj *otmp = 0, *obj = 0;
/* when a mimic gets poked with something, it might take that thing
(at present, only implemented for when the hero does the poking) */
void
-maybe_absorb_item(mon, obj, ochance, achance)
-struct monst *mon;
-struct obj *obj;
-int ochance, achance; /* percent chance for ordinary item, artifact */
+maybe_absorb_item(
+ struct monst *mon,
+ struct obj *obj,
+ int ochance, int achance) /* percent chance for ordinary item, artifact */
{
if (obj == uball || obj == uchain || obj->oclass == ROCK_CLASS
|| obj_resists(obj, 100 - ochance, 100 - achance)
/* drop one object taken from a (possibly dead) monster's inventory */
void
-mdrop_obj(mon, obj, verbosely)
-struct monst *mon;
-struct obj *obj;
-boolean verbosely;
+mdrop_obj(
+ struct monst *mon,
+ struct obj *obj,
+ boolean verbosely)
{
int omx = mon->mx, omy = mon->my;
boolean update_mon = FALSE;
even leaving the game entirely; when that happens, prevent them from
taking the Amulet, invocation items, or quest artifact with them */
void
-mdrop_special_objs(mon)
-struct monst *mon;
+mdrop_special_objs(struct monst* mon)
{
struct obj *obj, *otmp;
/* release the objects the creature is carrying */
void
-relobj(mtmp, show, is_pet)
-struct monst *mtmp;
-int show;
-boolean is_pet; /* If true, pet should keep wielded/worn items */
+relobj(
+ struct monst *mtmp,
+ int show,
+ boolean is_pet) /* If true, pet should keep wielded/worn items */
{
struct obj *otmp;
int omx = mtmp->mx, omy = mtmp->my;
S_CENTAUR, S_DRAGON, S_JABBERWOCK,
'\0' };
-static boolean FDECL(landing_spot, (coord *, int, int));
-static void FDECL(maybewakesteed, (struct monst *));
+static boolean landing_spot(coord *, int, int);
+static void maybewakesteed(struct monst *);
/* caller has decided that hero can't reach something while mounted */
void
-rider_cant_reach()
+rider_cant_reach(void)
{
You("aren't skilled enough to reach from %s.", y_monnam(u.usteed));
}
/* Can this monster wear a saddle? */
boolean
-can_saddle(mtmp)
-struct monst *mtmp;
+can_saddle(struct monst* mtmp)
{
struct permonst *ptr = mtmp->data;
}
int
-use_saddle(otmp)
-struct obj *otmp;
+use_saddle(struct obj* otmp)
{
struct monst *mtmp;
struct permonst *ptr;
}
void
-put_saddle_on_mon(saddle, mtmp)
-struct obj *saddle;
-struct monst *mtmp;
+put_saddle_on_mon(struct obj* saddle, struct monst* mtmp)
{
if (!can_saddle(mtmp) || which_armor(mtmp, W_SADDLE))
return;
/* Can we ride this monster? Caller should also check can_saddle() */
boolean
-can_ride(mtmp)
-struct monst *mtmp;
+can_ride(struct monst* mtmp)
{
return (mtmp->mtame && humanoid(g.youmonst.data)
&& !verysmall(g.youmonst.data) && !bigmonst(g.youmonst.data)
}
int
-doride()
+doride(void)
{
boolean forcemount = FALSE;
/* Start riding, with the given monster */
boolean
-mount_steed(mtmp, force)
-struct monst *mtmp; /* The animal */
-boolean force; /* Quietly force this animal */
+mount_steed(
+ struct monst *mtmp, /* The animal */
+ boolean force) /* Quietly force this animal */
{
struct obj *otmp;
char buf[BUFSZ];
/* You and your steed have moved */
void
-exercise_steed()
+exercise_steed(void)
{
if (!u.usteed)
return;
/* The player kicks or whips the steed */
void
-kick_steed()
+kick_steed(void)
{
char He[BUFSZ]; /* monverbself() appends to the "He"/"She"/"It" value */
if (!u.usteed)
* Adapted from mail daemon code.
*/
static boolean
-landing_spot(spot, reason, forceit)
-coord *spot; /* landing position (we fill it in) */
-int reason;
-int forceit;
+landing_spot(
+ coord *spot, /* landing position (we fill it in) */
+ int reason,
+ int forceit)
{
int i = 0, x, y, distance, min_distance = -1;
boolean found = FALSE;
/* Stop riding the current steed */
void
-dismount_steed(reason)
-int reason; /* Player was thrown off etc. */
+dismount_steed(
+ int reason) /* Player was thrown off etc. */
{
struct monst *mtmp;
struct obj *otmp;
/* when attempting to saddle or mount a sleeping steed, try to wake it up
(for the saddling case, it won't be u.usteed yet) */
static void
-maybewakesteed(steed)
-struct monst *steed;
+maybewakesteed(struct monst* steed)
{
int frozen = (int) steed->mfrozen;
boolean wasimmobile = steed->msleeping || !steed->mcanmove;
/* decide whether hero's steed is able to move;
doesn't check for holding traps--those affect the hero directly */
boolean
-stucksteed(checkfeeding)
-boolean checkfeeding;
+stucksteed(boolean checkfeeding)
{
struct monst *steed = u.usteed;
}
void
-place_monster(mon, x, y)
-struct monst *mon;
-int x, y;
+place_monster(struct monst* mon, int x, int y)
{
struct monst *othermon;
const char *monnm, *othnm;
extern const uchar def_r_oc_syms[MAXOCLASSES]; /* drawing.c */
#if defined(TERMLIB) || defined(CURSES_GRAPHICS)
-void NDECL((*decgraphics_mode_callback)) = 0; /* set in tty_start_screen() */
+void (*decgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */
#endif /* TERMLIB || CURSES */
#ifdef PC9800
-void NDECL((*ibmgraphics_mode_callback)) = 0; /* set in tty_start_screen() */
-void NDECL((*ascgraphics_mode_callback)) = 0; /* set in tty_start_screen() */
+void (*ibmgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */
+void (*ascgraphics_mode_callback)(void) = 0; /* set in tty_start_screen() */
#endif
#ifdef CURSES_GRAPHICS
-void NDECL((*cursesgraphics_mode_callback)) = 0;
+void (*cursesgraphics_mode_callback)(void) = 0;
#endif
/*
* Explanations of the functions found below:
*/
void
-init_symbols()
+init_symbols(void)
{
init_ov_primary_symbols();
init_ov_rogue_symbols();
}
void
-init_showsyms()
+init_showsyms(void)
{
register int i;
/* initialize defaults for the overrides to the rogue symset */
void
-init_ov_rogue_symbols()
+init_ov_rogue_symbols(void)
{
register int i;
}
/* initialize defaults for the overrides to the primary symset */
void
-init_ov_primary_symbols()
+init_ov_primary_symbols(void)
{
register int i;
}
nhsym
-get_othersym(idx, which_set)
-int idx, which_set;
+get_othersym(int idx, int which_set)
{
nhsym sym = (nhsym) 0;
int oidx = idx + SYM_OFF_X;
/* initialize defaults for the primary symset */
void
-init_primary_symbols()
+init_primary_symbols(void)
{
register int i;
/* initialize defaults for the rogue symset */
void
-init_rogue_symbols()
+init_rogue_symbols(void)
{
register int i;
}
void
-assign_graphics(whichset)
-int whichset;
+assign_graphics(int whichset)
{
register int i;
}
void
-switch_symbols(nondefault)
-int nondefault;
+switch_symbols(int nondefault)
{
register int i;
}
void
-update_ov_primary_symset(symp, val)
-struct symparse *symp;
-int val;
+update_ov_primary_symset(struct symparse* symp, int val)
{
g.ov_primary_syms[symp->idx] = val;
}
void
-update_ov_rogue_symset(symp, val)
-struct symparse *symp;
-int val;
+update_ov_rogue_symset(struct symparse* symp, int val)
{
g.ov_rogue_syms[symp->idx] = val;
}
void
-update_primary_symset(symp, val)
-struct symparse *symp;
-int val;
+update_primary_symset(struct symparse* symp, int val)
{
g.primary_syms[symp->idx] = val;
}
void
-update_rogue_symset(symp, val)
-struct symparse *symp;
-int val;
+update_rogue_symset(struct symparse* symp, int val)
{
g.rogue_syms[symp->idx] = val;
}
void
-clear_symsetentry(which_set, name_too)
-int which_set;
-boolean name_too;
+clear_symsetentry(int which_set, boolean name_too)
{
if (g.symset[which_set].desc)
free((genericptr_t) g.symset[which_set].desc);
struct sysopt sysopt;
void
-sys_early_init()
+sys_early_init(void)
{
sysopt.support = (char *) 0;
sysopt.recover = (char *) 0;
sysopt.bones_pools = 0;
/* record file */
- sysopt.persmax = PERSMAX;
- sysopt.entrymax = ENTRYMAX;
- sysopt.pointsmin = POINTSMIN;
+ sysopt.persmax = max(PERSMAX, 1);
+ sysopt.entrymax = max(ENTRYMAX, 10);
+ sysopt.pointsmin = max(POINTSMIN, 1);
sysopt.pers_is_uid = PERS_IS_UID;
sysopt.tt_oname_maxrank = 10;
/* sanity checks */
- if (PERSMAX < 1)
- sysopt.persmax = 1;
- if (ENTRYMAX < 10)
- sysopt.entrymax = 10;
- if (POINTSMIN < 1)
- sysopt.pointsmin = 1;
- if (PERS_IS_UID != 0 && PERS_IS_UID != 1)
+ if (sysopt.pers_is_uid != 0 && sysopt.pers_is_uid != 1)
panic("config error: PERS_IS_UID must be either 0 or 1");
#ifdef PANICTRACE
}
void
-sysopt_release()
+sysopt_release(void)
{
if (sysopt.support)
free((genericptr_t) sysopt.support), sysopt.support = (char *) 0;
extern const struct attack c_sa_no[NATTK];
void
-sysopt_seduce_set(val)
+sysopt_seduce_set(
#if 0
-int val;
+int val)
{
/*
* Attack substitution is now done on the fly in getmattk(mhitu.c).
mons[PM_SUCCUBUS].mattk[x] = setval[x];
}
#else
-int val UNUSED;
+int val UNUSED)
{
#endif
return;
#include "hack.h"
-static boolean FDECL(tele_jump_ok, (int, int, int, int));
-static boolean FDECL(teleok, (int, int, BOOLEAN_P));
-static void NDECL(vault_tele);
-static boolean FDECL(rloc_pos_ok, (int, int, struct monst *));
-static void FDECL(mvault_tele, (struct monst *));
+static boolean tele_jump_ok(int, int, int, int);
+static boolean teleok(int, int, boolean);
+static void vault_tele(void);
+static boolean rloc_pos_ok(int, int, struct monst *);
+static void mvault_tele(struct monst *);
/* teleporting is prevented on this level for this monster? */
boolean
-noteleport_level(mon)
-struct monst *mon;
+noteleport_level(struct monst* mon)
{
struct monst *mtmp;
* call it to generate new monster positions with fake monster structures.
*/
boolean
-goodpos(x, y, mtmp, gpflags)
-int x, y;
-struct monst *mtmp;
-long gpflags;
+goodpos(int x, int y, struct monst* mtmp, long gpflags)
{
struct permonst *mdat = (struct permonst *) 0;
boolean ignorewater = ((gpflags & MM_IGNOREWATER) != 0),
* Return TRUE and the position chosen when successful, FALSE otherwise.
*/
boolean
-enexto(cc, xx, yy, mdat)
-coord *cc;
-register xchar xx, yy;
-struct permonst *mdat;
+enexto(
+ coord *cc,
+ register xchar xx,
+ register xchar yy,
+ struct permonst *mdat)
{
return enexto_core(cc, xx, yy, mdat, NO_MM_FLAGS);
}
boolean
-enexto_core(cc, xx, yy, mdat, entflags)
-coord *cc;
-xchar xx, yy;
-struct permonst *mdat;
-long entflags;
+enexto_core(
+ coord *cc,
+ xchar xx,
+ xchar yy,
+ struct permonst *mdat,
+ long entflags)
{
#define MAX_GOOD 15
coord good[MAX_GOOD], *good_ptr;
* only for explicitly chosen destinations.)
*/
static boolean
-tele_jump_ok(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+tele_jump_ok(int x1, int y1, int x2, int y2)
{
if (!isok(x2, y2))
return FALSE;
}
static boolean
-teleok(x, y, trapok)
-register int x, y;
-boolean trapok;
+teleok(register int x, register int y, boolean trapok)
{
if (!trapok) {
/* allow teleportation onto vibrating square, it's not a real trap */
}
void
-teleds(nux, nuy, teleds_flags)
-int nux, nuy;
-int teleds_flags;
+teleds(int nux, int nuy, int teleds_flags)
{
boolean ball_active, ball_still_in_range = FALSE,
allow_drag = (teleds_flags & TELEDS_ALLOW_DRAG) != 0,
}
boolean
-safe_teleds(teleds_flags)
-int teleds_flags;
+safe_teleds(int teleds_flags)
{
register int nux, nuy, tcnt = 0;
}
static void
-vault_tele()
+vault_tele(void)
{
register struct mkroom *croom = search_special(VAULT);
coord c;
}
boolean
-teleport_pet(mtmp, force_it)
-register struct monst *mtmp;
-boolean force_it;
+teleport_pet(register struct monst* mtmp, boolean force_it)
{
register struct obj *otmp;
/* teleport the hero via some method other than scroll of teleport */
void
-tele()
+tele(void)
{
scrolltele((struct obj *) 0);
}
/* teleport the hero; usually discover scroll of teleporation if via scroll */
void
-scrolltele(scroll)
-struct obj *scroll;
+scrolltele(struct obj* scroll)
{
coord cc;
/* ^T command; 'm ^T' == choose among several teleport modes */
int
-dotelecmd()
+dotelecmd(void)
{
long save_HTele, save_ETele;
int res, added, hidden;
}
int
-dotele(break_the_rules)
-boolean break_the_rules; /* True: wizard mode ^T */
+dotele(
+ boolean break_the_rules) /* True: wizard mode ^T */
{
struct trap *trap;
const char *cantdoit;
}
void
-level_tele()
+level_tele(void)
{
static const char get_there_from[] = "get there from %s.";
register int newlev;
}
void
-domagicportal(ttmp)
-register struct trap *ttmp;
+domagicportal(register struct trap* ttmp)
{
struct d_level target_level;
}
void
-tele_trap(trap)
-struct trap *trap;
+tele_trap(struct trap* trap)
{
if (In_endgame(&u.uz) || Antimagic) {
if (Antimagic)
}
void
-level_tele_trap(trap, trflags)
-struct trap *trap;
-unsigned trflags;
+level_tele_trap(struct trap* trap, unsigned int trflags)
{
char verbbuf[BUFSZ];
boolean intentional = FALSE;
/* check whether monster can arrive at location <x,y> via Tport (or fall) */
static boolean
-rloc_pos_ok(x, y, mtmp)
-register int x, y; /* coordinates of candidate location */
-struct monst *mtmp;
+rloc_pos_ok(
+ register int x,
+ register int y, /* x,y - coordinates of candidate location */
+ struct monst *mtmp)
{
register int xx, yy;
* placed randomly around the head of the worm.
*/
void
-rloc_to(mtmp, x, y)
-struct monst *mtmp;
-register int x, y;
+rloc_to(struct monst* mtmp, register int x, register int y)
{
register int oldx = mtmp->mx, oldy = mtmp->my;
boolean resident_shk = mtmp->isshk && inhishop(mtmp);
}
static stairway *
-stairway_find_forwiz(isladder, up)
-boolean isladder, up;
+stairway_find_forwiz(boolean isladder, boolean up)
{
stairway *stway = g.stairs;
/* place a monster at a random location, typically due to teleport */
/* return TRUE if successful, FALSE if not */
boolean
-rloc(mtmp, suppress_impossible)
-struct monst *mtmp; /* mx==0 implies migrating monster arrival */
-boolean suppress_impossible;
+rloc(
+ struct monst *mtmp, /* mx==0 implies migrating monster arrival */
+ boolean suppress_impossible)
{
register int x, y, trycount;
}
static void
-mvault_tele(mtmp)
-struct monst *mtmp;
+mvault_tele(struct monst* mtmp)
{
struct mkroom *croom = search_special(VAULT);
coord c;
}
boolean
-tele_restrict(mon)
-struct monst *mon;
+tele_restrict(struct monst* mon)
{
if (noteleport_level(mon)) {
if (canseemon(mon))
}
void
-mtele_trap(mtmp, trap, in_sight)
-struct monst *mtmp;
-struct trap *trap;
-int in_sight;
+mtele_trap(struct monst* mtmp, struct trap* trap, int in_sight)
{
char *monname;
/* return 0 if still on level, 3 if not */
int
-mlevel_tele_trap(mtmp, trap, force_it, in_sight)
-struct monst *mtmp;
-struct trap *trap;
-boolean force_it;
-int in_sight;
+mlevel_tele_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ boolean force_it,
+ int in_sight)
{
int tt = (trap ? trap->ttyp : NO_TRAP);
/* place object randomly, returns False if it's gone (eg broken) */
boolean
-rloco(obj)
-register struct obj *obj;
+rloco(register struct obj* obj)
{
register xchar tx, ty, otx, oty;
boolean restricted_fall;
/* Returns an absolute depth */
int
-random_teleport_level()
+random_teleport_level(void)
{
int nlev, max_depth, min_depth, cur_depth = (int) depth(&u.uz);
/* you teleport a monster (via wand, spell, or poly'd q.mechanic attack);
return false iff the attempt fails */
boolean
-u_teleport_mon(mtmp, give_feedback)
-struct monst *mtmp;
-boolean give_feedback;
+u_teleport_mon(struct monst* mtmp, boolean give_feedback)
{
coord cc;
#include "hack.h"
-static void NDECL(stoned_dialogue);
-static void NDECL(vomiting_dialogue);
-static void NDECL(choke_dialogue);
-static void NDECL(levitation_dialogue);
-static void NDECL(slime_dialogue);
-static void FDECL(slimed_to_death, (struct kinfo *));
-static void NDECL(phaze_dialogue);
-static void FDECL(done_timeout, (int, int));
-static void NDECL(slip_or_trip);
-static void FDECL(see_lamp_flicker, (struct obj *, const char *));
-static void FDECL(lantern_message, (struct obj *));
-static void FDECL(cleanup_burn, (ANY_P *, long));
+static void stoned_dialogue(void);
+static void vomiting_dialogue(void);
+static void choke_dialogue(void);
+static void levitation_dialogue(void);
+static void slime_dialogue(void);
+static void slimed_to_death(struct kinfo *);
+static void phaze_dialogue(void);
+static void done_timeout(int, int);
+static void slip_or_trip(void);
+static void see_lamp_flicker(struct obj *, const char *);
+static void lantern_message(struct obj *);
+static void cleanup_burn(ANY_P *, long);
/* used by wizard mode #timeout and #wizintrinsic; order by 'interest'
for timeout countdown, where most won't occur in normal play */
};
static void
-stoned_dialogue()
+stoned_dialogue(void)
{
register long i = (Stoned & TIMEOUT);
};
static void
-vomiting_dialogue()
+vomiting_dialogue(void)
{
const char *txt = 0;
char buf[BUFSZ];
};
static void
-choke_dialogue()
+choke_dialogue(void)
{
register long i = (Strangled & TIMEOUT);
};
static void
-levitation_dialogue()
+levitation_dialogue(void)
{
/* -1 because the last message comes via float_down() */
long i = (((HLevitation & TIMEOUT) - 1L) / 2L);
};
static void
-slime_dialogue()
+slime_dialogue(void)
{
long t = (Slimed & TIMEOUT), i = t / 2L;
}
void
-burn_away_slime()
+burn_away_slime(void)
{
if (Slimed) {
make_slimed(0L, "The slime that covers you is burned away!");
/* countdown timer for turning into green slime has run out; kill our hero */
static void
-slimed_to_death(kptr)
-struct kinfo *kptr;
+slimed_to_death(struct kinfo* kptr)
{
uchar save_mvflags;
};
static void
-phaze_dialogue()
+phaze_dialogue(void)
{
long i = ((HPasses_walls & TIMEOUT) / 2L);
during end of game rundown (and potential dumplog);
timeout has already counted down to 0 by the time we get here */
static void
-done_timeout(how, which)
-int how, which;
+done_timeout(int how, int which)
{
long *intrinsic_p = &u.uprops[which].intrinsic;
}
void
-nh_timeout()
+nh_timeout(void)
{
register struct prop *upp;
struct kinfo *kptr;
}
void
-fall_asleep(how_long, wakeup_msg)
-int how_long;
-boolean wakeup_msg;
+fall_asleep(int how_long, boolean wakeup_msg)
{
stop_occupation();
nomul(how_long);
* existing hatch timer. Pass 0L for random hatch time.
*/
void
-attach_egg_hatch_timeout(egg, when)
-struct obj *egg;
-long when;
+attach_egg_hatch_timeout(struct obj* egg, long when)
{
int i;
/* prevent an egg from ever hatching */
void
-kill_egg(egg)
-struct obj *egg;
+kill_egg(struct obj* egg)
{
/* stop previous timer, if any */
(void) stop_timer(HATCH_EGG, obj_to_any(egg));
/* timer callback routine: hatch the given egg */
void
-hatch_egg(arg, timeout)
-anything *arg;
-long timeout;
+hatch_egg(anything *arg, long timeout)
{
struct obj *egg;
struct monst *mon, *mon2;
/* Learn to recognize eggs of the given type. */
void
-learn_egg_type(mnum)
-int mnum;
+learn_egg_type(int mnum)
{
/* baby monsters hatch from grown-up eggs */
mnum = little_to_big(mnum);
/* Attach a fig_transform timeout to the given figurine. */
void
-attach_fig_transform_timeout(figurine)
-struct obj *figurine;
+attach_fig_transform_timeout(struct obj* figurine)
{
int i;
/* give a fumble message */
static void
-slip_or_trip()
+slip_or_trip(void)
{
struct obj *otmp = vobj_at(u.ux, u.uy), *otmp2;
const char *what;
/* Print a lamp flicker message with tailer. */
static void
-see_lamp_flicker(obj, tailer)
-struct obj *obj;
-const char *tailer;
+see_lamp_flicker(struct obj* obj, const char* tailer)
{
switch (obj->where) {
case OBJ_INVENT:
/* Print a dimming message for brass lanterns. */
static void
-lantern_message(obj)
-struct obj *obj;
+lantern_message(struct obj* obj)
{
/* from adventure */
switch (obj->where) {
* See begin_burn() for meanings of obj->age and obj->spe.
*/
void
-burn_object(arg, timeout)
-anything *arg;
-long timeout;
+burn_object(anything* arg, long timeout)
{
struct obj *obj = arg->a_obj;
boolean canseeit, many, menorah, need_newsym, need_invupdate;
* This is a "silent" routine - it should not print anything out.
*/
void
-begin_burn(obj, already_lit)
-struct obj *obj;
-boolean already_lit;
+begin_burn(struct obj* obj, boolean already_lit)
{
int radius = 3;
long turns = 0;
* light source.
*/
void
-end_burn(obj, timer_attached)
-struct obj *obj;
-boolean timer_attached;
+end_burn(struct obj* obj, boolean timer_attached)
{
if (!obj->lamplit) {
impossible("end_burn: obj %s not lit", xname(obj));
* Cleanup a burning object if timer stopped.
*/
static void
-cleanup_burn(arg, expire_time)
-anything *arg;
-long expire_time;
+cleanup_burn(anything* arg, long expire_time)
{
struct obj *obj = arg->a_obj;
if (!obj->lamplit) {
}
void
-do_storms()
+do_storms(void)
{
int nstrike;
register int x, y;
* Check whether object has a timer of type timer_type.
*/
-static const char *FDECL(kind_name, (SHORT_P));
-static void FDECL(print_queue, (winid, timer_element *));
-static void FDECL(insert_timer, (timer_element *));
-static timer_element *FDECL(remove_timer,
- (timer_element **, SHORT_P, ANY_P *));
-static void FDECL(write_timer, (NHFILE *, timer_element *));
-static boolean FDECL(mon_is_local, (struct monst *));
-static boolean FDECL(timer_is_local, (timer_element *));
-static int FDECL(maybe_write_timer, (NHFILE *, int, BOOLEAN_P));
+static const char *kind_name(short);
+static void print_queue(winid, timer_element *);
+static void insert_timer(timer_element *);
+static timer_element *remove_timer(timer_element **, short, ANY_P *);
+static void write_timer(NHFILE *, timer_element *);
+static boolean mon_is_local(struct monst *);
+static boolean timer_is_local(timer_element *);
+static int maybe_write_timer(NHFILE *, int, boolean);
/* If defined, then include names when printing out the timer queue */
#define VERBOSE_TIMER
#undef TTAB
static const char *
-kind_name(kind)
-short kind;
+kind_name(short kind)
{
switch (kind) {
case TIMER_LEVEL:
}
static void
-print_queue(win, base)
-winid win;
-timer_element *base;
+print_queue(winid win, timer_element* base)
{
timer_element *curr;
char buf[BUFSZ];
}
int
-wiz_timeout_queue()
+wiz_timeout_queue(void)
{
winid win;
char buf[BUFSZ];
}
void
-timer_sanity_check()
+timer_sanity_check(void)
{
timer_element *curr;
* Do this until their time is less than or equal to the move count.
*/
void
-run_timers()
+run_timers(void)
{
timer_element *curr;
* Start a timer. Return TRUE if successful.
*/
boolean
-start_timer(when, kind, func_index, arg)
-long when;
-short kind;
-short func_index;
-anything *arg;
+start_timer(
+ long when,
+ short kind,
+ short func_index,
+ anything *arg)
{
timer_element *gnu, *dup;
* remaining until it would have gone off, 0 if not found.
*/
long
-stop_timer(func_index, arg)
-short func_index;
-anything *arg;
+stop_timer(short func_index, anything *arg)
{
timer_element *doomed;
long timeout;
* Find the timeout of specified timer; return 0 if none.
*/
long
-peek_timer(type, arg)
-short type;
-anything *arg;
+peek_timer(short type, anything *arg)
{
timer_element *curr;
* Move all object timers from src to dest, leaving src untimed.
*/
void
-obj_move_timers(src, dest)
-struct obj *src, *dest;
+obj_move_timers(struct obj* src, struct obj* dest)
{
int count;
timer_element *curr;
* Find all object timers and duplicate them for the new object "dest".
*/
void
-obj_split_timers(src, dest)
-struct obj *src, *dest;
+obj_split_timers(struct obj* src, struct obj* dest)
{
timer_element *curr, *next_timer = 0;
* all object pointers are unique.
*/
void
-obj_stop_timers(obj)
-struct obj *obj;
+obj_stop_timers(struct obj* obj)
{
timer_element *curr, *prev, *next_timer = 0;
* Check whether object has a timer of type timer_type.
*/
boolean
-obj_has_timer(object, timer_type)
-struct obj *object;
-short timer_type;
+obj_has_timer(struct obj* object, short timer_type)
{
long timeout = peek_timer(timer_type, obj_to_any(object));
*
*/
void
-spot_stop_timers(x, y, func_index)
-xchar x, y;
-short func_index;
+spot_stop_timers(xchar x, xchar y, short func_index)
{
timer_element *curr, *prev, *next_timer = 0;
long where = (((long) x << 16) | ((long) y));
* Returns 0L if no such timer.
*/
long
-spot_time_expires(x, y, func_index)
-xchar x, y;
-short func_index;
+spot_time_expires(xchar x, xchar y, short func_index)
{
timer_element *curr;
long where = (((long) x << 16) | ((long) y));
}
long
-spot_time_left(x, y, func_index)
-xchar x, y;
-short func_index;
+spot_time_left(xchar x, xchar y, short func_index)
{
long expires = spot_time_expires(x, y, func_index);
return (expires > 0L) ? expires - g.monstermoves : 0L;
/* Insert timer into the global queue */
static void
-insert_timer(gnu)
-timer_element *gnu;
+insert_timer(timer_element* gnu)
{
timer_element *curr, *prev;
}
static timer_element *
-remove_timer(base, func_index, arg)
-timer_element **base;
-short func_index;
-anything *arg;
+remove_timer(
+ timer_element **base,
+ short func_index,
+ anything *arg)
{
timer_element *prev, *curr;
}
static void
-write_timer(nhfp, timer)
-NHFILE *nhfp;
-timer_element *timer;
+write_timer(NHFILE* nhfp, timer_element* timer)
{
anything arg_save;
* saved.
*/
boolean
-obj_is_local(obj)
-struct obj *obj;
+obj_is_local(struct obj* obj)
{
switch (obj->where) {
case OBJ_INVENT:
* level is saved.
*/
static boolean
-mon_is_local(mon)
-struct monst *mon;
+mon_is_local(struct monst* mon)
{
struct monst *curr;
* level when the level is saved.
*/
static boolean
-timer_is_local(timer)
-timer_element *timer;
+timer_is_local(timer_element* timer)
{
switch (timer->kind) {
case TIMER_LEVEL:
* be written. If write_it is true, actually write the timer.
*/
static int
-maybe_write_timer(nhfp, range, write_it)
-NHFILE *nhfp;
-int range;
-boolean write_it;
+maybe_write_timer(NHFILE* nhfp, int range, boolean write_it)
{
int count = 0;
timer_element *curr;
* + timeouts that stay with the level (obj & monst)
*/
void
-save_timers(nhfp, range)
-NHFILE *nhfp;
-int range;
+save_timers(NHFILE* nhfp, int range)
{
timer_element *curr, *prev, *next_timer = 0;
int count;
* monster pointers.
*/
void
-restore_timers(nhfp, range, adjust)
-NHFILE *nhfp;
-int range;
-long adjust; /* how much to adjust timeout */
+restore_timers(NHFILE* nhfp, int range, long adjust)
{
int count = 0;
timer_element *curr;
/* to support '#stats' wizard-mode command */
void
-timer_stats(hdrfmt, hdrbuf, count, size)
-const char *hdrfmt;
-char *hdrbuf;
-long *count, *size;
+timer_stats(const char* hdrfmt, char *hdrbuf, long *count, long *size)
{
timer_element *te;
/* reset all timers that are marked for reseting */
void
-relink_timers(ghostly)
-boolean ghostly;
+relink_timers(boolean ghostly)
{
timer_element *curr;
unsigned nid;
room for separating space or trailing newline plus string terminator */
#define SCANBUFSZ (4 * (ROLESZ + 1) + (NAMSZ + 1) + (DTHSZ + 1) + 1)
-static void FDECL(topten_print, (const char *));
-static void FDECL(topten_print_bold, (const char *));
-static void NDECL(outheader);
-static void FDECL(outentry, (int, struct toptenentry *, BOOLEAN_P));
-static void FDECL(discardexcess, (FILE *));
-static void FDECL(readentry, (FILE *, struct toptenentry *));
-static void FDECL(writeentry, (FILE *, struct toptenentry *));
+static void topten_print(const char *);
+static void topten_print_bold(const char *);
+static void outheader(void);
+static void outentry(int, struct toptenentry *, boolean);
+static void discardexcess(FILE *);
+static void readentry(FILE *, struct toptenentry *);
+static void writeentry(FILE *, struct toptenentry *);
#ifdef XLOGFILE
-static void FDECL(writexlentry, (FILE *, struct toptenentry *, int));
-static long NDECL(encodexlogflags);
-static long NDECL(encodeconduct);
-static long FDECL(encodeachieve, (BOOLEAN_P));
-static void FDECL(add_achieveX, (char *, const char *, BOOLEAN_P));
-static char *NDECL(encode_extended_achievements);
-static char *NDECL(encode_extended_conducts);
+static void writexlentry(FILE *, struct toptenentry *, int);
+static long encodexlogflags(void);
+static long encodeconduct(void);
+static long encodeachieve(boolean);
+static void add_achieveX(char *, const char *, boolean);
+static char *encode_extended_achievements(void);
+static char *encode_extended_conducts(void);
#endif
-static void FDECL(free_ttlist, (struct toptenentry *));
-static int FDECL(classmon, (char *, BOOLEAN_P));
-static int FDECL(score_wanted, (BOOLEAN_P, int, struct toptenentry *, int,
- const char **, int));
+static void free_ttlist(struct toptenentry *);
+static int classmon(char *, boolean);
+static int score_wanted(boolean, int, struct toptenentry *, int,
+ const char **, int);
#ifdef NO_SCAN_BRACK
-static void FDECL(nsb_mung_line, (char *));
-static void FDECL(nsb_unmung_line, (char *));
+static void nsb_mung_line(char *);
+static void nsb_unmung_line(char *);
#endif
/* "killed by",&c ["an"] 'g.killer.name' */
void
-formatkiller(buf, siz, how, incl_helpless)
-char *buf;
-unsigned siz;
-int how;
-boolean incl_helpless;
+formatkiller(
+ char *buf,
+ unsigned siz,
+ int how,
+ boolean incl_helpless)
{
static NEARDATA const char *const killed_by_prefix[] = {
/* DIED, CHOKING, POISONING, STARVING, */
}
static void
-topten_print(x)
-const char *x;
+topten_print(const char *x)
{
if (g.toptenwin == WIN_ERR)
raw_print(x);
}
static void
-topten_print_bold(x)
-const char *x;
+topten_print_bold(const char* x)
{
if (g.toptenwin == WIN_ERR)
raw_print_bold(x);
}
int
-observable_depth(lev)
-d_level *lev;
+observable_depth(d_level* lev)
{
#if 0
/* if we ever randomize the order of the elemental planes, we
/* throw away characters until current record has been entirely consumed */
static void
-discardexcess(rfile)
-FILE *rfile;
+discardexcess(FILE* rfile)
{
int c;
}
static void
-readentry(rfile, tt)
-FILE *rfile;
-struct toptenentry *tt;
+readentry(FILE* rfile, struct toptenentry* tt)
{
char inbuf[SCANBUFSZ], s1[SCANBUFSZ], s2[SCANBUFSZ], s3[SCANBUFSZ],
s4[SCANBUFSZ], s5[SCANBUFSZ], s6[SCANBUFSZ];
}
static void
-writeentry(rfile, tt)
-FILE *rfile;
-struct toptenentry *tt;
+writeentry(FILE* rfile, struct toptenentry* tt)
{
static const char fmt32[] = "%c%c "; /* role,gender */
static const char fmt33[] = "%s %s %s %s "; /* role,race,gndr,algn */
/* as tab is never used in eg. g.plname or death, no need to mangle those. */
static void
-writexlentry(rfile, tt, how)
-FILE *rfile;
-struct toptenentry *tt;
-int how;
+writexlentry(FILE* rfile, struct toptenentry* tt, int how)
{
#define Fprintf (void) fprintf
#define XLOG_SEP '\t' /* xlogfile field separator. */
}
static long
-encodexlogflags()
+encodexlogflags(void)
{
long e = 0L;
}
static long
-encodeconduct()
+encodeconduct(void)
{
long e = 0L;
}
static long
-encodeachieve(secondlong)
-boolean secondlong; /* False: handle achievements 1..31, True: 32..62 */
+encodeachieve(
+ boolean secondlong) /* False: handle achievements 1..31, True: 32..62 */
{
int i, achidx, offset;
long r = 0L;
/* add the achievement or conduct comma-separated to string */
static void
-add_achieveX(buf, achievement, condition)
-char *buf;
-const char *achievement;
-boolean condition;
+add_achieveX(char* buf, const char* achievement, boolean condition)
{
if (condition) {
if (buf[0] != '\0') {
}
static char *
-encode_extended_achievements()
+encode_extended_achievements(void)
{
static char buf[N_ACH * 40];
char rnkbuf[40];
}
static char *
-encode_extended_conducts()
+encode_extended_conducts(void)
{
static char buf[BUFSZ];
#endif /* XLOGFILE */
static void
-free_ttlist(tt)
-struct toptenentry *tt;
+free_ttlist(struct toptenentry* tt)
{
struct toptenentry *ttnext;
}
void
-topten(how, when)
-int how;
-time_t when;
+topten(int how, time_t when)
{
int uid = getuid();
int rank, rank0 = -1, rank1 = 0;
}
static void
-outheader()
+outheader(void)
{
char linebuf[BUFSZ];
register char *bp;
/* so>0: standout line; so=0: ordinary line */
static void
-outentry(rank, t1, so)
-struct toptenentry *t1;
-int rank;
-boolean so;
+outentry(int rank, struct toptenentry* t1, boolean so)
{
boolean second_line = TRUE;
char linebuf[BUFSZ];
}
static int
-score_wanted(current_ver, rank, t1, playerct, players, uid)
-boolean current_ver;
-int rank;
-struct toptenentry *t1;
-int playerct;
-const char **players;
-int uid;
+score_wanted(
+ boolean current_ver,
+ int rank,
+ struct toptenentry *t1,
+ int playerct,
+ const char **players,
+ int uid)
{
int i;
* caveat: some shells might allow argv elements to be arbitrarily long.
*/
void
-prscore(argc, argv)
-int argc;
-char **argv;
+prscore(int argc, char **argv)
{
const char **players;
int playerct, rank;
}
static int
-classmon(plch, fem)
-char *plch;
-boolean fem;
+classmon(char *plch, boolean fem)
{
int i;
* Get a random player name and class from the high score list,
*/
struct toptenentry *
-get_rnd_toptenentry()
+get_rnd_toptenentry(void)
{
int rank, i;
FILE *rfile;
* to an object (for statues or morgue corpses).
*/
struct obj *
-tt_oname(otmp)
-struct obj *otmp;
+tt_oname(struct obj* otmp)
{
struct toptenentry *tt;
if (!otmp)
static NEARDATA coord utrack[UTSZ];
void
-initrack()
+initrack(void)
{
utcnt = utpnt = 0;
}
/* add to track */
void
-settrack()
+settrack(void)
{
if (utcnt < UTSZ)
utcnt++;
}
coord *
-gettrack(x, y)
-register int x, y;
+gettrack(register int x, register int y)
{
register int cnt, ndist;
register coord *tc;
extern const char *const destroy_strings[][3]; /* from zap.c */
-static boolean FDECL(keep_saddle_with_steedcorpse, (unsigned, struct obj *,
- struct obj *));
-static boolean FDECL(mu_maybe_destroy_web, (struct monst *, BOOLEAN_P,
- struct trap *));
-static struct obj *FDECL(t_missile, (int, struct trap *));
-static int FDECL(trapeffect_arrow_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_dart_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_rocktrap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_sqky_board, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_bear_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_slp_gas_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_rust_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_fire_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_pit, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_hole, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_telep_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_level_telep, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_web, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_statue_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_magic_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_anti_magic, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_poly_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_landmine, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_rolling_boulder_trap, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_magic_portal, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_vibrating_square, (struct monst *, struct trap *, unsigned));
-static int FDECL(trapeffect_selector, (struct monst *, struct trap *, unsigned));
-static char *FDECL(trapnote, (struct trap *, BOOLEAN_P));
-static int FDECL(steedintrap, (struct trap *, struct obj *));
-static void FDECL(launch_drop_spot, (struct obj *, XCHAR_P, XCHAR_P));
-static int FDECL(mkroll_launch, (struct trap *, XCHAR_P, XCHAR_P,
- SHORT_P, long));
-static boolean FDECL(isclearpath, (coord *, int, SCHAR_P, SCHAR_P));
-static void FDECL(dofiretrap, (struct obj *));
-static void NDECL(domagictrap);
-static boolean FDECL(emergency_disrobe, (boolean *));
-static int FDECL(untrap_prob, (struct trap *));
-static void FDECL(move_into_trap, (struct trap *));
-static int FDECL(try_disarm, (struct trap *, BOOLEAN_P));
-static void FDECL(reward_untrap, (struct trap *, struct monst *));
-static int FDECL(disarm_holdingtrap, (struct trap *));
-static int FDECL(disarm_landmine, (struct trap *));
-static int FDECL(unsqueak_ok, (struct obj *));
-static int FDECL(disarm_squeaky_board, (struct trap *));
-static int FDECL(disarm_shooting_trap, (struct trap *, int));
-static void FDECL(clear_conjoined_pits, (struct trap *));
-static boolean FDECL(adj_nonconjoined_pit, (struct trap *));
-static int FDECL(try_lift, (struct monst *, struct trap *, int,
- BOOLEAN_P));
-static int FDECL(help_monster_out, (struct monst *, struct trap *));
+static boolean keep_saddle_with_steedcorpse(unsigned, struct obj *,
+ struct obj *);
+static boolean mu_maybe_destroy_web(struct monst *, boolean,
+ struct trap *);
+static struct obj *t_missile(int, struct trap *);
+static int trapeffect_arrow_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_dart_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_rocktrap(struct monst *, struct trap *, unsigned);
+static int trapeffect_sqky_board(struct monst *, struct trap *, unsigned);
+static int trapeffect_bear_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_slp_gas_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_rust_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_fire_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_pit(struct monst *, struct trap *, unsigned);
+static int trapeffect_hole(struct monst *, struct trap *, unsigned);
+static int trapeffect_telep_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_level_telep(struct monst *, struct trap *, unsigned);
+static int trapeffect_web(struct monst *, struct trap *, unsigned);
+static int trapeffect_statue_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_magic_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_anti_magic(struct monst *, struct trap *, unsigned);
+static int trapeffect_poly_trap(struct monst *, struct trap *, unsigned);
+static int trapeffect_landmine(struct monst *, struct trap *, unsigned);
+static int trapeffect_rolling_boulder_trap(struct monst *, struct trap *,
+ unsigned);
+static int trapeffect_magic_portal(struct monst *, struct trap *, unsigned);
+static int trapeffect_vibrating_square(struct monst *, struct trap *,
+ unsigned);
+static int trapeffect_selector(struct monst *, struct trap *, unsigned);
+static char *trapnote(struct trap *, boolean);
+static int steedintrap(struct trap *, struct obj *);
+static void launch_drop_spot(struct obj *, xchar, xchar);
+static int mkroll_launch(struct trap *, xchar, xchar, short, long);
+static boolean isclearpath(coord *, int, schar, schar);
+static void dofiretrap(struct obj *);
+static void domagictrap(void);
+static boolean emergency_disrobe(boolean *);
+static int untrap_prob(struct trap *);
+static void move_into_trap(struct trap *);
+static int try_disarm(struct trap *, boolean);
+static void reward_untrap(struct trap *, struct monst *);
+static int disarm_holdingtrap(struct trap *);
+static int disarm_landmine(struct trap *);
+static int unsqueak_ok(struct obj *);
+static int disarm_squeaky_board(struct trap *);
+static int disarm_shooting_trap(struct trap *, int);
+static void clear_conjoined_pits(struct trap *);
+static boolean adj_nonconjoined_pit(struct trap *);
+static int try_lift(struct monst *, struct trap *, int, boolean);
+static int help_monster_out(struct monst *, struct trap *);
#if 0
-static void FDECL(join_adjacent_pits, (struct trap *));
+static void join_adjacent_pits(struct trap *);
#endif
-static boolean FDECL(thitm, (int, struct monst *, struct obj *, int,
- BOOLEAN_P));
-static void NDECL(maybe_finish_sokoban);
+static boolean thitm(int, struct monst *, struct obj *, int, boolean);
+static void maybe_finish_sokoban(void);
static const char *const a_your[2] = { "a", "your" };
static const char *const A_Your[2] = { "A", "Your" };
/* called when you're hit by fire (dofiretrap,buzz,zapyourself,explode);
returns TRUE if hit on torso */
boolean
-burnarmor(victim)
-struct monst *victim;
+burnarmor(struct monst* victim)
{
struct obj *item;
char buf[BUFSZ];
* Returns an erosion return value (ER_*)
*/
int
-erode_obj(otmp, ostr, type, ef_flags)
-register struct obj *otmp;
-const char *ostr;
-int type;
-int ef_flags;
+erode_obj(
+ register struct obj *otmp,
+ const char *ostr,
+ int type,
+ int ef_flags)
{
static NEARDATA const char
*const action[] = { "smoulder", "rust", "rot", "corrode" },
* wears off.
*/
boolean
-grease_protect(otmp, ostr, victim)
-register struct obj *otmp;
-const char *ostr;
-struct monst *victim;
+grease_protect(
+ register struct obj *otmp,
+ const char *ostr,
+ struct monst *victim)
{
static const char txt[] = "protected by the layer of grease!";
boolean vismon = victim && (victim != &g.youmonst) && canseemon(victim);
}
struct trap *
-maketrap(x, y, typ)
-int x, y, typ;
+maketrap(int x, int y, int typ)
{
static union vlaunchinfo zero_vl;
boolean oldplace;
}
void
-fall_through(td, ftflags)
-boolean td; /* td == TRUE : trap door or hole */
-unsigned ftflags;
+fall_through(
+ boolean td, /* td == TRUE : trap door or hole */
+ unsigned ftflags)
{
d_level dtmp;
char msgbuf[BUFSZ];
* shop status--it's not worth the hassle.]
*/
struct monst *
-animate_statue(statue, x, y, cause, fail_reason)
-struct obj *statue;
-xchar x, y;
-int cause;
-int *fail_reason;
+animate_statue(
+ struct obj *statue,
+ xchar x,
+ xchar y,
+ int cause,
+ int *fail_reason)
{
int mnum = statue->corpsenm;
struct permonst *mptr = &mons[mnum];
* or pick-axe.
*/
struct monst *
-activate_statue_trap(trap, x, y, shatter)
-struct trap *trap;
-xchar x, y;
-boolean shatter;
+activate_statue_trap(
+ struct trap *trap,
+ xchar x,
+ xchar y,
+ boolean shatter)
{
struct monst *mtmp = (struct monst *) 0;
struct obj *otmp = sobj_at(STATUE, x, y);
}
static boolean
-keep_saddle_with_steedcorpse(steed_mid, objchn, saddle)
-unsigned steed_mid;
-struct obj *objchn, *saddle;
+keep_saddle_with_steedcorpse(
+ unsigned steed_mid,
+ struct obj *objchn,
+ struct obj *saddle)
{
if (!saddle)
return FALSE;
/* monster or you go through and possibly destroy a web.
return TRUE if could go through. */
static boolean
-mu_maybe_destroy_web(mtmp, domsg, trap)
-struct monst *mtmp;
-boolean domsg;
-struct trap *trap;
+mu_maybe_destroy_web(
+ struct monst *mtmp,
+ boolean domsg,
+ struct trap *trap)
{
boolean isyou = (mtmp == &g.youmonst);
struct permonst *mptr = mtmp->data;
/* make a single arrow/dart/rock for a trap to shoot or drop */
static struct obj *
-t_missile(otyp, trap)
-int otyp;
-struct trap *trap;
+t_missile(int otyp, struct trap* trap)
{
struct obj *otmp = mksobj(otyp, TRUE, FALSE);
}
void
-set_utrap(tim, typ)
-unsigned tim, typ;
+set_utrap(unsigned int tim, unsigned int typ)
{
/* if we get here through reset_utrap(), the caller of that might
have already set u.utrap to 0 so this check won't be sufficient
}
void
-reset_utrap(msg)
-boolean msg;
+reset_utrap(boolean msg)
{
boolean was_Lev = (Levitation != 0), was_Fly = (Flying != 0);
}
static int
-trapeffect_arrow_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_arrow_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned trflags UNUSED)
{
struct obj *otmp;
}
static int
-trapeffect_dart_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_dart_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
struct obj *otmp;
}
static int
-trapeffect_rocktrap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_rocktrap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned trflags UNUSED)
{
struct obj *otmp;
}
static int
-trapeffect_sqky_board(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_sqky_board(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned trflags)
{
boolean forcetrap = ((trflags & FORCETRAP) != 0
|| (trflags & FAILEDUNTRAP) != 0);
}
static int
-trapeffect_bear_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_bear_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned trflags)
{
boolean forcetrap = ((trflags & FORCETRAP) != 0
|| (trflags & FAILEDUNTRAP) != 0);
}
static int
-trapeffect_slp_gas_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_slp_gas_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_rust_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_rust_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned int trflags UNUSED)
{
struct obj *otmp;
}
static int
-trapeffect_fire_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_fire_trap(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_pit(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_pit(
+ struct monst *mtmp,
+ struct trap *trap,
+ unsigned int trflags)
{
int ttype = trap->ttyp;
}
static int
-trapeffect_hole(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_hole(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
if (!Can_fall_thru(&u.uz)) {
}
static int
-trapeffect_telep_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_telep_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_level_telep(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_level_telep(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_web(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_web(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
boolean webmsgok = (trflags & NOWEBMSG) == 0;
}
static int
-trapeffect_statue_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_statue_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
(void) activate_statue_trap(trap, u.ux, u.uy, FALSE);
}
static int
-trapeffect_magic_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_magic_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_anti_magic(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_anti_magic(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
seetrap(trap);
}
static int
-trapeffect_poly_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_poly_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
boolean viasitting = (trflags & VIASITTING) != 0;
}
static int
-trapeffect_landmine(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_landmine(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
boolean already_seen = trap->tseen;
}
static int
-trapeffect_rolling_boulder_trap(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_rolling_boulder_trap(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
int style = ROLL | (trap->tseen ? LAUNCH_KNOWN : 0);
}
static int
-trapeffect_magic_portal(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_magic_portal(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
if (mtmp == &g.youmonst) {
feeltrap(trap);
}
static int
-trapeffect_vibrating_square(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags UNUSED;
+trapeffect_vibrating_square(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags UNUSED)
{
if (mtmp == &g.youmonst) {
feeltrap(trap);
}
static int
-trapeffect_selector(mtmp, trap, trflags)
-struct monst *mtmp;
-struct trap *trap;
-unsigned trflags;
+trapeffect_selector(
+ struct monst* mtmp,
+ struct trap* trap,
+ unsigned int trflags)
{
switch (trap->ttyp) {
case ARROW_TRAP:
}
void
-dotrap(trap, trflags)
-register struct trap *trap;
-unsigned trflags;
+dotrap(register struct trap* trap, unsigned int trflags)
{
register int ttype = trap->ttyp;
boolean already_seen = trap->tseen,
}
static char *
-trapnote(trap, noprefix)
-struct trap *trap;
-boolean noprefix;
+trapnote(struct trap* trap, boolean noprefix)
{
static char tnbuf[12];
const char *tn,
}
static int
-steedintrap(trap, otmp)
-struct trap *trap;
-struct obj *otmp;
+steedintrap(struct trap* trap, struct obj* otmp)
{
struct monst *steed = u.usteed;
int tt;
/* some actions common to both player and monsters for triggered landmine */
void
-blow_up_landmine(trap)
-struct trap *trap;
+blow_up_landmine(struct trap* trap)
{
int x = trap->tx, y = trap->ty, dbx, dby;
struct rm *lev = &levl[x][y];
}
static void
-launch_drop_spot(obj, x, y)
-struct obj *obj;
-xchar x, y;
+launch_drop_spot(struct obj* obj, xchar x, xchar y)
{
if (!obj) {
g.launchplace.obj = (struct obj *) 0;
}
boolean
-launch_in_progress()
+launch_in_progress(void)
{
if (g.launchplace.obj)
return TRUE;
}
void
-force_launch_placement()
+force_launch_placement(void)
{
if (g.launchplace.obj) {
g.launchplace.obj->otrapped = 0;
* 2 if an object was launched, but used up.
*/
int
-launch_obj(otyp, x1, y1, x2, y2, style)
-short otyp;
-register int x1, y1, x2, y2;
-int style;
+launch_obj(
+ short otyp,
+ register int x1,
+ register int y1,
+ register int x2,
+ register int y2,
+ int style)
{
register struct monst *mtmp;
register struct obj *otmp, *otmp2;
}
void
-seetrap(trap)
-struct trap *trap;
+seetrap(struct trap* trap)
{
if (!trap->tseen) {
trap->tseen = 1;
/* like seetrap() but overrides vision */
void
-feeltrap(trap)
-struct trap *trap;
+feeltrap(struct trap* trap)
{
trap->tseen = 1;
map_trap(trap, 1);
}
static int
-mkroll_launch(ttmp, x, y, otyp, ocount)
-struct trap *ttmp;
-xchar x, y;
-short otyp;
-long ocount;
+mkroll_launch(
+ struct trap *ttmp,
+ xchar x,
+ xchar y,
+ short otyp,
+ long ocount)
{
struct obj *otmp;
register int tmp;
}
static boolean
-isclearpath(cc, distance, dx, dy)
-coord *cc;
-int distance;
-schar dx, dy;
+isclearpath(
+ coord *cc,
+ int distance,
+ schar dx,
+ schar dy)
{
uchar typ;
xchar x, y;
}
int
-mintrap(mtmp)
-register struct monst *mtmp;
+mintrap(register struct monst *mtmp)
{
register struct trap *trap = t_at(mtmp->mx, mtmp->my);
boolean trapkilled = FALSE;
/* Combine cockatrice checks into single functions to avoid repeating code. */
void
-instapetrify(str)
-const char *str;
+instapetrify(const char *str)
{
if (Stone_resistance)
return;
}
void
-minstapetrify(mon, byplayer)
-struct monst *mon;
-boolean byplayer;
+minstapetrify(struct monst *mon, boolean byplayer)
{
if (resists_ston(mon))
return;
}
void
-selftouch(arg)
-const char *arg;
+selftouch(const char *arg)
{
char kbuf[BUFSZ];
}
void
-mselftouch(mon, arg, byplayer)
-struct monst *mon;
-const char *arg;
-boolean byplayer;
+mselftouch(
+ struct monst *mon,
+ const char *arg,
+ boolean byplayer)
{
struct obj *mwep = MON_WEP(mon);
/* start levitating */
void
-float_up()
+float_up(void)
{
g.context.botl = TRUE;
if (u.utrap) {
}
void
-fill_pit(x, y)
-int x, y;
+fill_pit(int x, int y)
{
struct obj *otmp;
struct trap *t;
/* stop levitating */
int
-float_down(hmask, emask)
-long hmask, emask; /* might cancel timeout */
+float_down(
+ long hmask,
+ long emask) /* might cancel timeout */
{
register struct trap *trap = (struct trap *) 0;
d_level current_dungeon_level;
/* shared code for climbing out of a pit */
void
-climb_pit()
+climb_pit(void)
{
const char *pitname;
}
static void
-dofiretrap(box)
-struct obj *box; /* null for floor trap */
+dofiretrap(
+ struct obj *box) /* null for floor trap */
{
boolean see_it = !Blind;
int num, alt;
}
static void
-domagictrap()
+domagictrap(void)
{
register int fate = rnd(20);
* Return whether the object was destroyed.
*/
boolean
-fire_damage(obj, force, x, y)
-struct obj *obj;
-boolean force;
-xchar x, y;
+fire_damage(
+ struct obj *obj,
+ boolean force,
+ xchar x,
+ xchar y)
{
int chance;
struct obj *otmp, *ncobj;
* Return number of objects destroyed. --ALI
*/
int
-fire_damage_chain(chain, force, here, x, y)
-struct obj *chain;
-boolean force, here;
-xchar x, y;
+fire_damage_chain(
+ struct obj *chain,
+ boolean force,
+ boolean here,
+ xchar x,
+ xchar y)
{
struct obj *obj, *nobj;
int num = 0;
/* obj has been thrown or dropped into lava; damage is worse than mere fire */
boolean
-lava_damage(obj, x, y)
-struct obj *obj;
-xchar x, y;
+lava_damage(struct obj* obj, xchar x, xchar y)
{
int otyp = obj->otyp, ocls = obj->oclass;
}
void
-acid_damage(obj)
-struct obj *obj;
+acid_damage(struct obj* obj)
{
/* Scrolls but not spellbooks can be erased by acid. */
struct monst *victim;
* Returns an erosion return value (ER_*)
*/
int
-water_damage(obj, ostr, force)
-struct obj *obj;
-const char *ostr;
-boolean force;
+water_damage(
+ struct obj *obj,
+ const char *ostr,
+ boolean force)
{
if (!obj)
return ER_NOTHING;
}
void
-water_damage_chain(obj, here)
-struct obj *obj;
-boolean here;
+water_damage_chain(
+ struct obj *obj,
+ boolean here)
{
struct obj *otmp;
xchar x, y;
* crawl out of the current predicament.
*/
static boolean
-emergency_disrobe(lostsome)
-boolean *lostsome;
+emergency_disrobe(boolean *lostsome)
{
int invc = inv_cnt(TRUE);
/* return TRUE iff player relocated */
boolean
-drown()
+drown(void)
{
const char *pool_of_water;
boolean inpool_ok = FALSE, crawl_ok;
}
void
-drain_en(n)
-int n;
+drain_en(int n)
{
if (!u.uenmax) {
/* energy is completely gone */
/* disarm a trap */
int
-dountrap()
+dountrap(void)
{
if (near_capacity() >= HVY_ENCUMBER) {
pline("You're too strained to do that.");
/* Probability of disabling a trap. Helge Hafting */
static int
-untrap_prob(ttmp)
-struct trap *ttmp;
+untrap_prob(struct trap* ttmp)
{
int chance = 3;
/* Replace trap with object(s). Helge Hafting */
void
-cnv_trap_obj(otyp, cnt, ttmp, bury_it)
-int otyp;
-int cnt;
-struct trap *ttmp;
-boolean bury_it;
+cnv_trap_obj(
+ int otyp,
+ int cnt,
+ struct trap *ttmp,
+ boolean bury_it)
{
struct obj *otmp = mksobj(otyp, TRUE, FALSE);
/* while attempting to disarm an adjacent trap, we've fallen into it */
static void
-move_into_trap(ttmp)
-struct trap *ttmp;
+move_into_trap(struct trap* ttmp)
{
int bc = 0;
xchar x = ttmp->tx, y = ttmp->ty, bx, by, cx, cy;
* 2: succeeds
*/
static int
-try_disarm(ttmp, force_failure)
-struct trap *ttmp;
-boolean force_failure;
+try_disarm(struct trap* ttmp, boolean force_failure)
{
struct monst *mtmp = m_at(ttmp->tx, ttmp->ty);
int ttype = ttmp->ttyp;
}
static void
-reward_untrap(ttmp, mtmp)
-struct trap *ttmp;
-struct monst *mtmp;
+reward_untrap(struct trap* ttmp, struct monst* mtmp)
{
if (!ttmp->madeby_u) {
if (rnl(10) < 8 && !mtmp->mpeaceful && !mtmp->msleeping
}
static int
-disarm_holdingtrap(ttmp) /* Helge Hafting */
-struct trap *ttmp;
+disarm_holdingtrap(struct trap* ttmp) /* Helge Hafting */
{
struct monst *mtmp;
int fails = try_disarm(ttmp, FALSE);
}
static int
-disarm_landmine(ttmp) /* Helge Hafting */
-struct trap *ttmp;
+disarm_landmine(struct trap* ttmp) /* Helge Hafting */
{
int fails = try_disarm(ttmp, FALSE);
/* getobj callback for object to disarm a squeaky board with */
static int
-unsqueak_ok(obj)
-struct obj *obj;
+unsqueak_ok(struct obj* obj)
{
if (!obj)
return GETOBJ_EXCLUDE;
/* it may not make much sense to use grease on floor boards, but so what? */
static int
-disarm_squeaky_board(ttmp)
-struct trap *ttmp;
+disarm_squeaky_board(struct trap* ttmp)
{
struct obj *obj;
boolean bad_tool;
/* removes traps that shoot arrows, darts, etc. */
static int
-disarm_shooting_trap(ttmp, otyp)
-struct trap *ttmp;
-int otyp;
+disarm_shooting_trap(struct trap* ttmp, int otyp)
{
int fails = try_disarm(ttmp, FALSE);
/* Is the weight too heavy?
* Formula as in near_capacity() & check_capacity() */
static int
-try_lift(mtmp, ttmp, wt, stuff)
-struct monst *mtmp;
-struct trap *ttmp;
-int wt;
-boolean stuff;
+try_lift(
+ struct monst *mtmp,
+ struct trap *ttmp,
+ int wt,
+ boolean stuff)
{
int wc = weight_cap();
/* Help trapped monster (out of a (spiked) pit) */
static int
-help_monster_out(mtmp, ttmp)
-struct monst *mtmp;
-struct trap *ttmp;
+help_monster_out(
+ struct monst *mtmp,
+ struct trap *ttmp)
{
int wt;
struct obj *otmp;
}
int
-untrap(force)
-boolean force;
+untrap(boolean force)
{
register struct obj *otmp;
register int x, y;
/* for magic unlocking; returns true if targetted monster (which might
be hero) gets untrapped; the trap remains intact */
boolean
-openholdingtrap(mon, noticed)
-struct monst *mon;
-boolean *noticed; /* set to true iff hero notices the effect; */
-{ /* otherwise left with its previous value intact */
+openholdingtrap(
+ struct monst *mon,
+ boolean *noticed) /* set to true iff hero notices the effect; */
+{ /* otherwise left with its previous value intact */
struct trap *t;
char buf[BUFSZ], whichbuf[20];
const char *trapdescr = 0, *which = 0;
/* for magic locking; returns true if targetted monster (which might
be hero) gets hit by a trap (might avoid actually becoming trapped) */
boolean
-closeholdingtrap(mon, noticed)
-struct monst *mon;
-boolean *noticed; /* set to true iff hero notices the effect; */
-{ /* otherwise left with its previous value intact */
+closeholdingtrap(
+ struct monst *mon,
+ boolean *noticed) /* set to true iff hero notices the effect; */
+{ /* otherwise left with its previous value intact */
struct trap *t;
unsigned dotrapflags;
boolean ishero = (mon == &g.youmonst), result;
/* for magic unlocking; returns true if targetted monster (which might
be hero) gets hit by a trap (target might avoid its effect) */
boolean
-openfallingtrap(mon, trapdoor_only, noticed)
-struct monst *mon;
-boolean trapdoor_only;
-boolean *noticed; /* set to true iff hero notices the effect; */
-{ /* otherwise left with its previous value intact */
+openfallingtrap(
+ struct monst *mon,
+ boolean trapdoor_only,
+ boolean *noticed) /* set to true iff hero notices the effect; */
+{ /* otherwise left with its previous value intact */
struct trap *t;
boolean ishero = (mon == &g.youmonst), result;
/* only called when the player is doing something to the chest directly */
boolean
-chest_trap(obj, bodypart, disarm)
-register struct obj *obj;
-register int bodypart;
-boolean disarm;
+chest_trap(
+ register struct obj *obj,
+ register int bodypart,
+ boolean disarm)
{
register struct obj *otmp = obj, *otmp2;
char buf[80];
}
struct trap *
-t_at(x, y)
-register int x, y;
+t_at(register int x, register int y)
{
register struct trap *trap = g.ftrap;
}
void
-deltrap(trap)
-register struct trap *trap;
+deltrap(register struct trap* trap)
{
register struct trap *ttmp;
}
boolean
-conjoined_pits(trap2, trap1, u_entering_trap2)
-struct trap *trap2, *trap1;
-boolean u_entering_trap2;
+conjoined_pits(
+ struct trap *trap2,
+ struct trap *trap1,
+ boolean u_entering_trap2)
{
int dx, dy, diridx, adjidx;
}
static void
-clear_conjoined_pits(trap)
-struct trap *trap;
+clear_conjoined_pits(struct trap* trap)
{
int diridx, adjidx, x, y;
struct trap *t;
}
static boolean
-adj_nonconjoined_pit(adjtrap)
-struct trap *adjtrap;
+adj_nonconjoined_pit(struct trap* adjtrap)
{
struct trap *trap_with_u = t_at(u.ux0, u.uy0);
* (currently not called from anywhere)
*/
static void
-join_adjacent_pits(trap)
-struct trap *trap;
+join_adjacent_pits(struct trap* trap)
{
struct trap *t;
int diridx, x, y;
* Returns TRUE if you escaped a pit and are standing on the precipice.
*/
boolean
-uteetering_at_seen_pit(trap)
-struct trap *trap;
+uteetering_at_seen_pit(struct trap* trap)
{
return (trap && is_pit(trap->ttyp) && trap->tseen
&& trap->tx == u.ux && trap->ty == u.uy
* release a trap door
*/
boolean
-uescaped_shaft(trap)
-struct trap *trap;
+uescaped_shaft(struct trap* trap)
{
return (trap && is_hole(trap->ttyp) && trap->tseen
&& trap->tx == u.ux && trap->ty == u.uy);
/* Destroy a trap that emanates from the floor. */
boolean
-delfloortrap(ttmp)
-register struct trap *ttmp;
+delfloortrap(struct trap* ttmp)
{
/* some of these are arbitrary -dlc */
if (ttmp && ((ttmp->ttyp == SQKY_BOARD) || (ttmp->ttyp == BEAR_TRAP)
/* used for doors (also tins). can be used for anything else that opens. */
void
-b_trapped(item, bodypart)
-const char *item;
-int bodypart;
+b_trapped(const char* item, int bodypart)
{
int lvl = level_difficulty(),
dmg = rnd(5 + (lvl < 5 ? lvl : 2 + lvl / 2));
/* Monster is hit by trap. */
/* Note: doesn't work if both obj and d_override are null */
static boolean
-thitm(tlev, mon, obj, d_override, nocorpse)
-int tlev;
-struct monst *mon;
-struct obj *obj;
-int d_override;
-boolean nocorpse;
+thitm(
+ int tlev,
+ struct monst *mon,
+ struct obj *obj,
+ int d_override,
+ boolean nocorpse)
{
int strike;
boolean trapkilled = FALSE;
}
boolean
-unconscious()
+unconscious(void)
{
if (g.multi >= 0)
return FALSE;
static const char lava_killer[] = "molten lava";
boolean
-lava_effects()
+lava_effects(void)
{
register struct obj *obj, *obj2;
int dmg = d(6, 6); /* only applicable for water walking */
/* called each turn when trapped in lava */
void
-sink_into_lava()
+sink_into_lava(void)
{
static const char sink_deeper[] = "You sink deeper into the lava.";
/* called when something has been done (breaking a boulder, for instance)
which entails a luck penalty if performed on a sokoban level */
void
-sokoban_guilt()
+sokoban_guilt(void)
{
if (Sokoban) {
u.uconduct.sokocheat++;
/* called when a trap has been deleted or had its ttyp replaced */
static void
-maybe_finish_sokoban()
+maybe_finish_sokoban(void)
{
struct trap *t;
* calls).
*/
const char *
-trapname(ttyp, override)
-int ttyp;
-boolean override;
+trapname(int ttyp, boolean override)
{
static const char *halu_trapnames[] = {
/* riffs on actual nethack traps */
chain, due to some external source of fire. The object chain should
be somewhere exposed, like someone's open inventory or the floor. */
void
-ignite_items(objchn)
-struct obj *objchn;
+ignite_items(struct obj* objchn)
{
struct obj *obj;
boolean bynexthere = (objchn && objchn->where == OBJ_FLOOR);
Bitfield(trbless, 2);
};
-static void FDECL(ini_inv, (struct trobj *));
-static void FDECL(knows_object, (int));
-static void FDECL(knows_class, (CHAR_P));
-static boolean FDECL(restricted_spell_discipline, (int));
+static void ini_inv(struct trobj *);
+static void knows_object(int);
+static void knows_class(char);
+static boolean restricted_spell_discipline(int);
#define UNDEF_TYP 0
#define UNDEF_SPE '\177'
};
static void
-knows_object(obj)
-register int obj;
+knows_object(int obj)
{
discover_object(obj, TRUE, FALSE);
objects[obj].oc_pre_discovered = 1; /* not a "discovery" */
* like all gems except the loadstone and luckstone.
*/
static void
-knows_class(sym)
-register char sym;
+knows_class(char sym)
{
register int ct;
for (ct = 1; ct < NUM_OBJECTS; ct++)
}
void
-u_init()
+u_init(void)
{
register int i;
struct u_roleplay tmpuroleplay = u.uroleplay; /* set by rcfile options */
/* skills aren't initialized, so we use the role-specific skill lists */
static boolean
-restricted_spell_discipline(otyp)
-int otyp;
+restricted_spell_discipline(int otyp)
{
const struct def_skill *skills;
int this_skill = spell_skilltype(otyp);
}
static void
-ini_inv(trop)
-register struct trobj *trop;
+ini_inv(struct trobj *trop)
{
struct obj *obj;
int otyp, i;
static const char brief_feeling[] =
"have a %s feeling for a moment, then it passes.";
-static boolean FDECL(known_hitum, (struct monst *, struct obj *, int *,
- int, int, struct attack *, int));
-static boolean FDECL(theft_petrifies, (struct obj *));
-static void FDECL(steal_it, (struct monst *, struct attack *));
-static boolean FDECL(hitum_cleave, (struct monst *, struct attack *));
-static boolean FDECL(hitum, (struct monst *, struct attack *));
-static boolean FDECL(hmon_hitmon, (struct monst *, struct obj *, int, int));
-static int FDECL(joust, (struct monst *, struct obj *));
-static void NDECL(demonpet);
-static boolean FDECL(m_slips_free, (struct monst *, struct attack *));
-static int FDECL(explum, (struct monst *, struct attack *));
-static void FDECL(start_engulf, (struct monst *));
-static void NDECL(end_engulf);
-static int FDECL(gulpum, (struct monst *, struct attack *));
-static boolean FDECL(hmonas, (struct monst *));
-static void FDECL(nohandglow, (struct monst *));
-static boolean FDECL(shade_aware, (struct obj *));
+static boolean known_hitum(struct monst *, struct obj *, int *, int, int,
+ struct attack *, int);
+static boolean theft_petrifies(struct obj *);
+static void steal_it(struct monst *, struct attack *);
+static boolean hitum_cleave(struct monst *, struct attack *);
+static boolean hitum(struct monst *, struct attack *);
+static boolean hmon_hitmon(struct monst *, struct obj *, int, int);
+static int joust(struct monst *, struct obj *);
+static void demonpet(void);
+static boolean m_slips_free(struct monst *, struct attack *);
+static int explum(struct monst *, struct attack *);
+static void start_engulf(struct monst *);
+static void end_engulf(void);
+static int gulpum(struct monst *, struct attack *);
+static boolean hmonas(struct monst *);
+static void nohandglow(struct monst *);
+static boolean shade_aware(struct obj *);
#define PROJECTILE(obj) ((obj) && is_ammo(obj))
void
-erode_armor(mdef, hurt)
-struct monst *mdef;
-int hurt;
+erode_armor(struct monst *mdef, int hurt)
{
struct obj *target;
/* FALSE means it's OK to attack */
boolean
-attack_checks(mtmp, wep)
-register struct monst *mtmp;
-struct obj *wep; /* uwep for attack(), null for kick_monster() */
+attack_checks(struct monst *mtmp,
+ struct obj *wep) /* uwep for attack(), null for kick_monster() */
{
int glyph;
* It is unchivalrous for a knight to attack the defenseless or from behind.
*/
void
-check_caitiff(mtmp)
-struct monst *mtmp;
+check_caitiff(struct monst *mtmp)
{
if (u.ualign.record <= -10)
return;
}
int
-find_roll_to_hit(mtmp, aatyp, weapon, attk_count, role_roll_penalty)
-register struct monst *mtmp;
-uchar aatyp; /* usually AT_WEAP or AT_KICK */
-struct obj *weapon; /* uwep or uswapwep or NULL */
-int *attk_count, *role_roll_penalty;
+find_roll_to_hit(struct monst *mtmp,
+ uchar aatyp, /* usually AT_WEAP or AT_KICK */
+ struct obj *weapon, /* uwep or uswapwep or NULL */
+ int *attk_count,
+ int *role_roll_penalty)
{
int tmp, tmp2;
/* try to attack; return False if monster evaded;
u.dx and u.dy must be set */
boolean
-attack(mtmp)
-register struct monst *mtmp;
+attack(struct monst *mtmp)
{
register struct permonst *mdat = mtmp->data;
/* really hit target monster; returns TRUE if it still lives */
static boolean
-known_hitum(mon, weapon, mhit, rollneeded, armorpenalty, uattk, dieroll)
-register struct monst *mon;
-struct obj *weapon;
-int *mhit;
-int rollneeded, armorpenalty; /* for monks */
-struct attack *uattk;
-int dieroll;
+known_hitum(struct monst *mon, struct obj *weapon, int *mhit, int rollneeded,
+ int armorpenalty, /* for monks */
+ struct attack *uattk,
+ int dieroll)
{
boolean malive = TRUE,
/* hmon() might destroy weapon; remember aspect for cutworm */
/* hit the monster next to you and the monsters to the left and right of it;
return False if the primary target is killed, True otherwise */
static boolean
-hitum_cleave(target, uattk)
-struct monst *target; /* non-Null; forcefight at nothing doesn't cleave... */
-struct attack *uattk; /* ... but we don't enforce that here; Null works ok */
+hitum_cleave(struct monst *target, /* non-Null; forcefight at nothing doesn't
+ cleave... */
+ struct attack *uattk) /* ... but we don't enforce that here; Null
+ works ok */
{
/* swings will be delivered in alternate directions; with consecutive
attacks it will simulate normal swing and backswing; when swings
/* hit target monster; returns TRUE if it still lives */
static boolean
-hitum(mon, uattk)
-struct monst *mon;
-struct attack *uattk;
+hitum(struct monst *mon, struct attack *uattk)
{
boolean malive, wep_was_destroyed = FALSE;
struct obj *wepbefore = uwep;
/* general "damage monster" routine; return True if mon still alive */
boolean
-hmon(mon, obj, thrown, dieroll)
-struct monst *mon;
-struct obj *obj;
-int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
-int dieroll;
+hmon(struct monst *mon,
+ struct obj *obj,
+ int thrown, /* HMON_xxx (0 => hand-to-hand, other => ranged) */
+ int dieroll)
{
boolean result, anger_guards;
/* guts of hmon() */
static boolean
-hmon_hitmon(mon, obj, thrown, dieroll)
-struct monst *mon;
-struct obj *obj;
-int thrown; /* HMON_xxx (0 => hand-to-hand, other => ranged) */
-int dieroll;
+hmon_hitmon(struct monst *mon,
+ struct obj *obj,
+ int thrown, /* HMON_xxx (0 => hand-to-hand, other => ranged) */
+ int dieroll)
{
int tmp;
struct permonst *mdat = mon->data;
}
static boolean
-shade_aware(obj)
-struct obj *obj;
+shade_aware(struct obj *obj)
{
if (!obj)
return FALSE;
/* used for hero vs monster and monster vs monster; also handles
monster vs hero but that won't happen because hero can't be a shade */
boolean
-shade_miss(magr, mdef, obj, thrown, verbose)
-struct monst *magr, *mdef;
-struct obj *obj;
-boolean thrown, verbose;
+shade_miss(struct monst *magr, struct monst *mdef, struct obj *obj,
+ boolean thrown, boolean verbose)
{
const char *what, *whose, *target;
boolean youagr = (magr == &g.youmonst), youdef = (mdef == &g.youmonst);
/* check whether slippery clothing protects from hug or wrap attack */
/* [currently assumes that you are the attacker] */
static boolean
-m_slips_free(mdef, mattk)
-struct monst *mdef;
-struct attack *mattk;
+m_slips_free(struct monst *mdef, struct attack *mattk)
{
struct obj *obj;
/* used when hitting a monster with a lance while mounted;
1: joust hit; 0: ordinary hit; -1: joust but break lance */
static int
-joust(mon, obj)
-struct monst *mon; /* target */
-struct obj *obj; /* weapon */
+joust(struct monst *mon, /* target */
+ struct obj *obj) /* weapon */
{
int skill_rating, joust_dieroll;
* Pulling it out makes it work.
*/
static void
-demonpet()
+demonpet(void)
{
int i;
struct permonst *pm;
}
static boolean
-theft_petrifies(otmp)
-struct obj *otmp;
+theft_petrifies(struct obj *otmp)
{
if (uarmg || otmp->otyp != CORPSE
|| !touch_petrifies(&mons[otmp->corpsenm]) || Stone_resistance)
* otherwise, take one object. [Is this really the behavior we want?]
*/
static void
-steal_it(mdef, mattk)
-struct monst *mdef;
-struct attack *mattk;
+steal_it(struct monst *mdef, struct attack *mattk)
{
struct obj *otmp, *gold = 0, *ustealo, **minvent_ptr;
long unwornmask;
}
void
-mhitm_ad_rust(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_rust(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_corr(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_corr(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_dcay(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_dcay(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_dren(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_dren(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_drli(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_drli(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_fire(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_fire(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_cold(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_cold(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_elec(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_elec(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_acid(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_acid(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_sgld(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_sgld(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
struct permonst *pd = mdef->data;
void
-mhitm_ad_tlpt(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_tlpt(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_blnd(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_blnd(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_curs(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_curs(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_drst(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_drst(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
}
void
-mhitm_ad_drin(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_drin(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_stck(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_stck(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_wrap(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_wrap(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_plys(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_plys(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_slee(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm UNUSED;
+mhitm_ad_slee(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm UNUSED)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_slim(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_slim(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_ench(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm UNUSED;
+mhitm_ad_ench(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm UNUSED)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_slow(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm UNUSED;
+mhitm_ad_slow(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm UNUSED)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_conf(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_conf(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_poly(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED; /* implied */
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_poly(struct monst *magr,
+ struct attack *mattk UNUSED, /* implied */
+ struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_famn(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_famn(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_pest(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_pest(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
}
void
-mhitm_ad_deth(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_deth(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_halu(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_halu(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
boolean
-do_stone_u(mtmp)
-struct monst *mtmp;
+do_stone_u(struct monst *mtmp)
{
if (!Stoned && !Stone_resistance
&& !(poly_when_stoned(g.youmonst.data)
}
void
-do_stone_mon(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+do_stone_mon(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_phys(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_phys(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_ston(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_ston(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_were(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_were(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
}
void
-mhitm_ad_heal(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_heal(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_stun(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_stun(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_legs(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_legs(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_dgst(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk UNUSED;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_dgst(struct monst *magr, struct attack *mattk UNUSED,
+ struct monst *mdef, struct mhitm_data *mhm)
{
struct permonst *pd = mdef->data;
}
void
-mhitm_ad_samu(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_samu(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_ad_dise(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_dise(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
}
void
-mhitm_ad_sedu(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_sedu(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
struct permonst *pa = magr->data;
}
void
-mhitm_ad_ssex(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_ad_ssex(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
if (magr == &g.youmonst) {
/* uhitm */
}
void
-mhitm_adtyping(magr, mattk, mdef, mhm)
-struct monst *magr;
-struct attack *mattk;
-struct monst *mdef;
-struct mhitm_data *mhm;
+mhitm_adtyping(struct monst *magr, struct attack *mattk, struct monst *mdef,
+ struct mhitm_data *mhm)
{
switch (mattk->adtyp) {
case AD_STUN: mhitm_ad_stun(magr, mattk, mdef, mhm); break;
}
int
-damageum(mdef, mattk, specialdmg)
-register struct monst *mdef;
-register struct attack *mattk;
-int specialdmg; /* blessed and/or silver bonus against various things */
+damageum(struct monst *mdef, struct attack *mattk,
+ int specialdmg) /* blessed and/or silver bonus against various things */
{
int armpro;
boolean negated;
}
static int
-explum(mdef, mattk)
-register struct monst *mdef;
-register struct attack *mattk;
+explum(struct monst *mdef, struct attack *mattk)
{
boolean resistance; /* only for cold/fire/elec */
register int tmp = d((int) mattk->damn, (int) mattk->damd);
}
static void
-start_engulf(mdef)
-struct monst *mdef;
+start_engulf(struct monst *mdef)
{
if (!Invisible) {
map_location(u.ux, u.uy, TRUE);
}
static void
-end_engulf()
+end_engulf(void)
{
if (!Invisible) {
tmp_at(DISP_END, 0);
}
static int
-gulpum(mdef, mattk)
-register struct monst *mdef;
-register struct attack *mattk;
+gulpum(struct monst *mdef, struct attack *mattk)
{
#ifdef LINT /* static char msgbuf[BUFSZ]; */
char msgbuf[BUFSZ];
}
void
-missum(mdef, mattk, wouldhavehit)
-register struct monst *mdef;
-register struct attack *mattk;
-boolean wouldhavehit;
+missum(struct monst *mdef, struct attack *mattk, boolean wouldhavehit)
{
if (wouldhavehit) /* monk is missing due to penalty for wearing suit */
Your("armor is rather cumbersome...");
/* attack monster as a monster; returns True if mon survives */
static boolean
-hmonas(mon)
-register struct monst *mon;
+hmonas(struct monst *mon)
{
struct attack *mattk, alt_attk;
struct obj *weapon, **originalweapon;
/* Special (passive) attacks on you by monsters done here.
*/
int
-passive(mon, weapon, mhitb, maliveb, aatyp, wep_was_destroyed)
-struct monst *mon;
-struct obj *weapon; /* uwep or uswapwep or uarmg or uarmf or Null */
-boolean mhitb;
-boolean maliveb;
-uchar aatyp;
-boolean wep_was_destroyed;
+passive(struct monst *mon,
+ struct obj *weapon, /* uwep or uswapwep or uarmg or uarmf or Null */
+ boolean mhitb,
+ boolean maliveb,
+ uchar aatyp,
+ boolean wep_was_destroyed)
{
register struct permonst *ptr = mon->data;
register int i, tmp;
* Assumes the attack was successful.
*/
void
-passive_obj(mon, obj, mattk)
-struct monst *mon;
-struct obj *obj; /* null means pick uwep, uswapwep or uarmg */
-struct attack *mattk; /* null means we find one internally */
+passive_obj(struct monst *mon,
+ struct obj *obj, /* null means pick uwep, uswapwep or uarmg */
+ struct attack *mattk) /* null means we find one internally */
{
struct permonst *ptr = mon->data;
int i;
/* Note: caller must ascertain mtmp is mimicking... */
void
-stumble_onto_mimic(mtmp)
-struct monst *mtmp;
+stumble_onto_mimic(struct monst *mtmp)
{
const char *fmt = "Wait! That's %s!", *generic = "a monster", *what = 0;
}
static void
-nohandglow(mon)
-struct monst *mon;
+nohandglow(struct monst *mon)
{
char *hands = makeplural(body_part(HAND));
/* returns 1 if light flash has noticeable effect on 'mtmp', 0 otherwise */
int
-flash_hits_mon(mtmp, otmp)
-struct monst *mtmp;
-struct obj *otmp; /* source of flash */
+flash_hits_mon(struct monst *mtmp,
+ struct obj *otmp) /* source of flash */
{
struct rm *lev;
int tmp, amt, useeit, res = 0;
}
void
-light_hits_gremlin(mon, dmg)
-struct monst *mon;
-int dmg;
+light_hits_gremlin(struct monst *mon, int dmg)
{
pline("%s %s!", Monnam(mon),
(dmg > mon->mhp / 2) ? "wails in agony" : "cries out in pain");
#include "hack.h"
-static boolean FDECL(clear_fcorr, (struct monst *, BOOLEAN_P));
-static void FDECL(blackout, (int, int));
-static void FDECL(restfakecorr, (struct monst *));
-static void FDECL(parkguard, (struct monst *));
-static boolean FDECL(in_fcorridor, (struct monst *, int, int));
-static boolean FDECL(find_guard_dest, (struct monst *, xchar *, xchar *));
-static void FDECL(move_gold, (struct obj *, int));
-static void FDECL(wallify_vault, (struct monst *));
-static void FDECL(gd_mv_monaway, (struct monst *, int, int));
-static void FDECL(gd_pick_corridor_gold, (struct monst *, int, int));
+static boolean clear_fcorr(struct monst *, boolean);
+static void blackout(int, int);
+static void restfakecorr(struct monst *);
+static void parkguard(struct monst *);
+static boolean in_fcorridor(struct monst *, int, int);
+static boolean find_guard_dest(struct monst *, xchar *, xchar *);
+static void move_gold(struct obj *, int);
+static void wallify_vault(struct monst *);
+static void gd_mv_monaway(struct monst *, int, int);
+static void gd_pick_corridor_gold(struct monst *, int, int);
void
-newegd(mtmp)
-struct monst *mtmp;
+newegd(struct monst *mtmp)
{
if (!mtmp->mextra)
mtmp->mextra = newmextra();
}
void
-free_egd(mtmp)
-struct monst *mtmp;
+free_egd(struct monst *mtmp)
{
if (mtmp->mextra && EGD(mtmp)) {
free((genericptr_t) EGD(mtmp));
maintained by guard 'grd'; if guard is still in it, removal will fail,
to be tried again later */
static boolean
-clear_fcorr(grd, forceshow)
-struct monst *grd;
-boolean forceshow;
+clear_fcorr(struct monst *grd, boolean forceshow)
{
register int fcx, fcy, fcbeg;
struct monst *mtmp;
the corridor, we don't want the light to reappear if/when a new tunnel
goes through the same area */
static void
-blackout(x, y)
-int x, y;
+blackout(int x, int y)
{
struct rm *lev;
int i, j;
}
static void
-restfakecorr(grd)
-struct monst *grd;
+restfakecorr(struct monst *grd)
{
/* it seems you left the corridor - let the guard disappear */
if (clear_fcorr(grd, FALSE)) {
/* move guard--dead to alive--to <0,0> until temporary corridor is removed */
static void
-parkguard(grd)
-struct monst *grd;
+parkguard(struct monst *grd)
{
/* either guard is dead or will now be treated as if so;
monster traversal loops should skip it */
/* called in mon.c */
boolean
-grddead(grd)
-struct monst *grd;
+grddead(struct monst *grd)
{
boolean dispose = clear_fcorr(grd, TRUE);
}
static boolean
-in_fcorridor(grd, x, y)
-struct monst *grd;
-int x, y;
+in_fcorridor(struct monst *grd, int x, int y)
{
register int fci;
struct egd *egrd = EGD(grd);
}
struct monst *
-findgd()
+findgd(void)
{
register struct monst *mtmp;
}
void
-vault_summon_gd()
+vault_summon_gd(void)
{
if (vault_occupied(u.urooms) && !findgd())
u.uinvault = (VAULT_GUARD_TIME - 1);
}
char
-vault_occupied(array)
-char *array;
+vault_occupied(char *array)
{
register char *ptr;
/* hero has teleported out of vault while a guard is active */
void
-uleftvault(grd)
-struct monst *grd;
+uleftvault(struct monst *grd)
{
/* only called if caller has checked vault_occupied() and findgd() */
if (!grd || !grd->isgd || DEADMONSTER(grd)) {
}
static boolean
-find_guard_dest(guard, rx, ry)
-struct monst *guard;
-xchar *rx, *ry;
+find_guard_dest(struct monst *guard, xchar *rx, xchar *ry)
{
register int x, y, dd, lx = 0, ly = 0;
}
void
-invault()
+invault(void)
{
struct monst *guard;
boolean gsensed;
}
static void
-move_gold(gold, vroom)
-struct obj *gold;
-int vroom;
+move_gold(struct obj *gold, int vroom)
{
xchar nx, ny;
}
static void
-wallify_vault(grd)
-struct monst *grd;
+wallify_vault(struct monst *grd)
{
int x, y, typ;
int vlt = EGD(grd)->vroom;
}
static void
-gd_mv_monaway(grd, nx, ny)
-register struct monst *grd;
-int nx, ny;
+gd_mv_monaway(struct monst *grd, int nx, int ny)
{
if (MON_AT(nx, ny) && !(nx == grd->mx && ny == grd->my)) {
if (!Deaf)
/* have guard pick gold off the floor, possibly moving to the gold's
position before message and back to his current spot after */
static void
-gd_pick_corridor_gold(grd, goldx, goldy)
-struct monst *grd;
-int goldx, goldy; /* <gold->ox, gold->oy> */
+gd_pick_corridor_gold(struct monst *grd, int goldx, int goldy)
{
struct obj *gold;
coord newcc, bestcc;
* return 1: guard moved, 0: guard didn't, -1: let m_move do it, -2: died
*/
int
-gd_move(grd)
-register struct monst *grd;
+gd_move(struct monst *grd)
{
int x, y, nx, ny, m, n;
int dx, dy, gx = 0, gy = 0, fci;
/* Routine when dying or quitting with a vault guard around */
void
-paygd(silently)
-boolean silently;
+paygd(boolean silently)
{
register struct monst *grd = findgd();
long umoney = money_cnt(g.invent);
return;
}
-/* amount of gold in carried containers */
+/*
+ * amount of gold in carried containers
+ *
+ * even_if_unknown:
+ * True: all gold
+ * False: limit to known contents
+ */
long
-hidden_gold(even_if_unknown)
-boolean even_if_unknown; /* True: all gold; False: limit to known contents */
+hidden_gold(boolean even_if_unknown)
{
long value = 0L;
struct obj *obj;
/* prevent "You hear footsteps.." when inappropriate */
boolean
-gd_sound()
+gd_sound(void)
{
struct monst *grd = findgd();
}
void
-vault_gd_watching(activity)
-unsigned int activity;
+vault_gd_watching(unsigned int activity)
{
struct monst *guard = findgd();
;
#endif
-static void FDECL(insert_rtoption, (char *));
+static void insert_rtoption(char *);
/* fill buffer with short version (so caller can avoid including date.h) */
char *
-version_string(buf)
-char *buf;
+version_string(char *buf)
{
return strcpy(buf, VERSION_STRING);
}
/* fill and return the given buffer with the long nethack version string */
char *
-getversionstring(buf)
-char *buf;
+getversionstring(char *buf)
{
Strcpy(buf, VERSION_ID);
/* the 'v' command */
int
-doversion()
+doversion(void)
{
char buf[BUFSZ];
/* the '#version' command; also a choice for '?' */
int
-doextversion()
+doextversion(void)
{
int rtcontext = 0;
const char *rtbuf;
}
void
-early_version_info(pastebuf)
-boolean pastebuf;
+early_version_info(boolean pastebuf)
{
char buf1[BUFSZ], buf2[BUFSZ];
char *buf, *tmp;
* game image, so we insert those options here.
*/
static void
-insert_rtoption(buf)
-char *buf;
+insert_rtoption(char *buf)
{
int i;
#ifdef MICRO
boolean
-comp_times(filetime)
-long filetime;
+comp_times(long filetime)
{
/* BUILD_TIME is constant but might have L suffix rather than UL;
'filetime' is historically signed but ought to have been unsigned */
#endif
boolean
-check_version(version_data, filename, complain, utdflags)
-struct version_info *version_data;
-const char *filename;
-boolean complain;
-unsigned long utdflags;
+check_version(struct version_info *version_data, const char *filename,
+ boolean complain, unsigned long utdflags)
{
if (
#ifdef VERSION_COMPATIBILITY
/* this used to be based on file date and somewhat OS-dependant,
but now examines the initial part of the file's contents */
boolean
-uptodate(nhfp, name, utdflags)
-NHFILE *nhfp;
-const char *name;
-unsigned long utdflags;
+uptodate(NHFILE *nhfp, const char *name, unsigned long utdflags)
{
int rlen = 0, cmc = 0, filecmc = 0;
struct version_info vers_info;
}
void
-store_formatindicator(nhfp)
-NHFILE *nhfp;
+store_formatindicator(NHFILE *nhfp)
{
char indicate = 'u';
int cmc = 0;
}
void
-store_version(nhfp)
-NHFILE *nhfp;
+store_version(NHFILE *nhfp)
{
#if !defined(CROSSCOMPILE) || !defined(CROSSCOMPILE_TARGET)
static const struct version_info version_data = {
#endif
unsigned long
-get_feature_notice_ver(str)
-char *str;
+get_feature_notice_ver(char *str)
{
char buf[BUFSZ];
int ver_maj, ver_min, patch;
}
unsigned long
-get_current_feature_ver()
+get_current_feature_ver(void)
{
return FEATURE_NOTICE_VER(VERSION_MAJOR, VERSION_MINOR, PATCHLEVEL);
}
/*ARGUSED*/
const char *
-copyright_banner_line(indx)
-int indx;
+copyright_banner_line(int indx)
{
#ifdef COPYRIGHT_BANNER_A
if (indx == 1)
static xchar right_ptrs[ROWNO][COLNO];
/* Forward declarations. */
-static void FDECL(fill_point, (int, int));
-static void FDECL(dig_point, (int, int));
-static void NDECL(view_init);
-static void FDECL(view_from, (int, int, xchar **, xchar *, xchar *, int,
- void (*)(int, int, genericptr_t),
- genericptr_t));
-static void FDECL(get_unused_cs, (xchar ***, xchar **, xchar **));
-static void FDECL(rogue_vision, (xchar **, xchar *, xchar *));
+static void fill_point(int, int);
+static void dig_point(int, int);
+static void view_init(void);
+static void view_from(int, int, xchar **, xchar *, xchar *, int,
+ void (*)(int, int, genericptr_t),
+ genericptr_t);
+static void get_unused_cs(xchar ***, xchar **, xchar **);
+static void rogue_vision(xchar **, xchar *, xchar *);
/* Macro definitions that I can't find anywhere. */
#define sign(z) ((z) < 0 ? -1 : ((z) ? 1 : 0))
* or before a game restore. Else we die a horrible death.
*/
void
-vision_init()
+vision_init(void)
{
int i;
* sight.
*/
int
-does_block(x, y, lev)
-int x, y;
-register struct rm *lev;
+does_block(int x, int y, struct rm *lev)
{
struct obj *obj;
struct monst *mon;
* level and the level monsters and objects are in place.
*/
void
-vision_reset()
+vision_reset(void)
{
int y;
register int x, i, dig_left, block;
* to the unused vision work area.
*/
static void
-get_unused_cs(rows, rmin, rmax)
-xchar ***rows;
-xchar **rmin, **rmax;
+get_unused_cs(xchar ***rows, xchar **rmin, xchar **rmax)
{
register int row;
register xchar *nrmin, *nrmax;
* due to the one-sided lit wall hack.
*/
static void
-rogue_vision(next, rmin, rmax)
-xchar **next; /* could_see array pointers */
-xchar *rmin, *rmax;
+rogue_vision(xchar **next, xchar *rmin, xchar *rmax)
{
int rnum = levl[u.ux][u.uy].roomno - ROOMOFFSET; /* no SHARED... */
int start, stop, in_door, xhi, xlo, yhi, ylo;
#ifdef EXTEND_SPINE
-static int FDECL(new_angle, (struct rm *, unsigned char *, int, int));
+static int new_angle(struct rm *, unsigned char *, int, int);
/*
* new_angle()
*
* checks. - Dean 2/11/93
*/
static int
-new_angle(lev, sv, row, col)
-struct rm *lev;
-unsigned char *sv;
-int row, col;
+new_angle(struct rm *lev, unsigned char *sv, int row, int col)
{
register int res = *sv;
* + Just before bubbles are moved. [movebubbles()]
*/
void
-vision_recalc(control)
-int control;
+vision_recalc(int control)
{
extern unsigned char seenv_matrix[3][3]; /* from display.c */
static unsigned char colbump[COLNO + 1]; /* cols to bump sv */
* + Monsters can see you even when you're in a pit.
*/
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0,
- (void FDECL((*), (int, int, genericptr_t))) 0,
+ (void (*)(int, int, genericptr_t)) 0,
(genericptr_t) 0);
/*
}
} else
view_from(u.uy, u.ux, next_array, next_rmin, next_rmax, 0,
- (void FDECL((*), (int, int, genericptr_t))) 0,
+ (void (*)(int, int, genericptr_t)) 0,
(genericptr_t) 0);
/*
* Make the location opaque to light.
*/
void
-block_point(x, y)
-int x, y;
+block_point(int x, int y)
{
fill_point(y, x);
* Make the location transparent to light.
*/
void
-unblock_point(x, y)
-int x, y;
+unblock_point(int x, int y)
{
dig_point(y, x);
* spot on its right) will point to itself.
*/
static void
-dig_point(row, col)
-int row, col;
+dig_point(int row, int col)
{
int i;
}
static void
-fill_point(row, col)
-int row, col;
+fill_point(int row, int col)
{
int i;
static xchar *cs_left;
static xchar *cs_right;
-static void FDECL((*vis_func), (int, int, genericptr_t));
+static void (*vis_func)(int, int, genericptr_t);
static genericptr_t varg;
/*
#else /* !MACRO_CPATH -- quadrants are really functions */
-static int FDECL(_q1_path, (int, int, int, int));
-static int FDECL(_q2_path, (int, int, int, int));
-static int FDECL(_q3_path, (int, int, int, int));
-static int FDECL(_q4_path, (int, int, int, int));
+static int _q1_path(int, int, int, int);
+static int _q2_path(int, int, int, int);
+static int _q3_path(int, int, int, int);
+static int _q4_path(int, int, int, int);
#define q1_path(sy, sx, y, x, dummy) result = _q1_path(sy, sx, y, x)
#define q2_path(sy, sx, y, x, dummy) result = _q2_path(sy, sx, y, x)
* Quadrant I (step < 0).
*/
static int
-_q1_path(srow, scol, y2, x2)
-int scol, srow, y2, x2;
+_q1_path(int scol, int srow, int y2, int x2)
{
int dx, dy;
register int k, err, x, y, dxs, dys;
* Quadrant IV (step > 0).
*/
static int
-_q4_path(srow, scol, y2, x2)
-int scol, srow, y2, x2;
+_q4_path(int scol, int srow, int y2, int x2)
{
int dx, dy;
register int k, err, x, y, dxs, dys;
* Quadrant II (step < 0).
*/
static int
-_q2_path(srow, scol, y2, x2)
-int scol, srow, y2, x2;
+_q2_path(int scol, int srow, int y2, int x2)
{
int dx, dy;
register int k, err, x, y, dxs, dys;
* Quadrant III (step > 0).
*/
static int
-_q3_path(srow, scol, y2, x2)
-int scol, srow, y2, x2;
+_q3_path(int scol, int srow, int y2, int x2)
{
int dx, dy;
register int k, err, x, y, dxs, dys;
* do_light_sources()
*/
boolean
-clear_path(col1, row1, col2, row2)
-int col1, row1, col2, row2;
+clear_path(int col1, int row1, int col2, int row2)
{
int result;
/*
* Defines local to Algorithm C.
*/
-static void FDECL(right_side, (int, int, int, const xchar *));
-static void FDECL(left_side, (int, int, int, const xchar *));
+static void right_side(int, int, int, const xchar *);
+static void left_side(int, int, int, const xchar *);
/* Initialize algorithm C (nothing). */
static void
-view_init()
+view_init(void)
{
}
/*
* Mark positions as visible on one quadrant of the right side. The
* quadrant is determined by the value of the global variable step.
+ *
+ * Arguments:
+ * row current row
+ * left first (left side) visible spot on prev row
+ * right_mark last (right side) visible spot on prev row
+ * limits points at range limit for current row, or NULL
*/
static void
-right_side(row, left, right_mark, limits)
-int row; /* current row */
-int left; /* first (left side) visible spot on prev row */
-int right_mark; /* last (right side) visible spot on prev row */
-const xchar *limits; /* points at range limit for current row, or NULL */
+right_side(int row, int left, int right_mark, const xchar *limits)
{
int right; /* right limit of "could see" */
int right_edge; /* right edge of an opening */
* extensive comments.
*/
static void
-left_side(row, left_mark, right, limits)
-int row, left_mark, right;
-const xchar *limits;
+left_side(int row, int left_mark, int right, const xchar *limits)
{
int left, left_edge, nrow, deeper, result;
register int i;
* Calculate all possible visible locations from the given location
* (srow,scol). NOTE this is (y,x)! Mark the visible locations in the
* array provided.
+ *
+ * Arguments
+ * srow, scol starting row and column
+ * loc_cs_rows pointers to the rows of the could_see array
+ * left_most min mark on each row
+ * right_most max mark on each row
+ * range 0 if unlimited
+ * func function to call on each spot
+ * arg argument for func
*/
static void
-view_from(srow, scol, loc_cs_rows, left_most, right_most, range, func, arg)
-int srow, scol; /* starting row and column */
-xchar **loc_cs_rows; /* pointers to the rows of the could_see array */
-xchar *left_most; /* min mark on each row */
-xchar *right_most; /* max mark on each row */
-int range; /* 0 if unlimited */
-void FDECL((*func), (int, int, genericptr_t));
-genericptr_t arg;
+view_from(int srow, int scol, xchar **loc_cs_rows,
+ xchar *left_most, xchar *right_most, int range,
+ void (*func)(int, int, genericptr_t), genericptr_t arg)
{
register int i; /* loop counter */
xchar *rowp; /* optimization for setting could_see */
* vision matrix and reduce extra work.
*/
void
-do_clear_area(scol, srow, range, func, arg)
-int scol, srow, range;
-void FDECL((*func), (int, int, genericptr_t));
-genericptr_t arg;
+do_clear_area(int scol, int srow, int range,
+ void (*func)(int, int, genericptr_t), genericptr_t arg)
{
/* If not centered on hero, do the hard work of figuring the area */
if (scol != u.ux || srow != u.uy) {
/* bitmask indicating ways mon is seen; extracted from lookat(pager.c) */
unsigned
-howmonseen(mon)
-struct monst *mon;
+howmonseen(struct monst *mon)
{
boolean useemon = (boolean) canseemon(mon);
int xraydist = (u.xray_range < 0) ? -1 : (u.xray_range * u.xray_range);
*/
#include "hack.h"
-static void FDECL(give_may_advance_msg, (int));
-static void FDECL(finish_towel_change, (struct obj *obj, int));
-static boolean FDECL(could_advance, (int));
-static boolean FDECL(peaked_skill, (int));
-static int FDECL(slots_required, (int));
-static void FDECL(skill_advance, (int));
+static void give_may_advance_msg(int);
+static void finish_towel_change(struct obj *obj, int);
+static boolean could_advance(int);
+static boolean peaked_skill(int);
+static int slots_required(int);
+static void skill_advance(int);
/* Categories whose names don't come from OBJ_NAME(objects[type])
*/
S_NAGA, S_GIANT, '\0' };
static void
-give_may_advance_msg(skill)
-int skill;
+give_may_advance_msg(int skill)
{
You_feel("more confident in your %sskills.",
(skill == P_NONE) ? ""
mostly used to shorten "you drop your <weapon>" messages when slippery
fingers or polymorph causes hero to involuntarily drop wielded weapon(s) */
const char *
-weapon_descr(obj)
-struct obj *obj;
+weapon_descr(struct obj *obj)
{
int skill = weapon_type(obj);
const char *descr = P_NAME(skill);
* of "otmp" against the monster.
*/
int
-hitval(otmp, mon)
-struct obj *otmp;
-struct monst *mon;
+hitval(struct obj *otmp, struct monst *mon)
{
int tmp = 0;
struct permonst *ptr = mon->data;
* of "otmp" against the monster.
*/
int
-dmgval(otmp, mon)
-struct obj *otmp;
-struct monst *mon;
+dmgval(struct obj *otmp, struct monst *mon)
{
int tmp = 0, otyp = otmp->otyp;
struct permonst *ptr = mon->data;
/* check whether blessed and/or silver damage applies for *non-weapon* hit;
return value is the amount of the extra damage */
int
-special_dmgval(magr, mdef, armask, silverhit_p)
-struct monst *magr, *mdef;
-long armask; /* armor mask, multiple bits accepted for W_ARMC|W_ARM|W_ARMU
- * or W_ARMG|W_RINGL|W_RINGR only */
-long *silverhit_p; /* output flag mask for silver bonus */
+special_dmgval(struct monst *magr,
+ struct monst *mdef,
+ long armask, /* armor mask, multiple bits accepted for
+ W_ARMC|W_ARM|W_ARMU or
+ W_ARMG|W_RINGL|W_RINGR only */
+ long *silverhit_p) /* output flag mask for silver bonus */
{
struct obj *obj;
struct permonst *ptr = mdef->data;
/* give a "silver <item> sears <target>" message;
not used for weapon hit, so we only handle rings */
void
-silver_sears(magr, mdef, silverhit)
-struct monst *magr UNUSED;
-struct monst *mdef;
-long silverhit;
+silver_sears(struct monst *magr UNUSED, struct monst *mdef,
+ long silverhit)
{
char rings[20]; /* plenty of room for "rings" */
int ltyp = ((uleft && (silverhit & W_RINGL) != 0L)
}
}
-static struct obj *FDECL(oselect, (struct monst *, int));
+static struct obj *oselect(struct monst *, int);
#define Oselect(x) \
if ((otmp = oselect(mtmp, x)) != 0) \
return otmp;
static struct obj *
-oselect(mtmp, x)
-struct monst *mtmp;
-int x;
+oselect(struct monst *mtmp, int x)
{
struct obj *otmp;
/* select a ranged weapon for the monster */
struct obj *
-select_rwep(mtmp)
-register struct monst *mtmp;
+select_rwep(struct monst *mtmp)
{
register struct obj *otmp;
struct obj *mwep;
/* is 'obj' a type of weapon that any monster knows how to throw? */
boolean
-monmightthrowwep(obj)
-struct obj *obj;
+monmightthrowwep(struct obj *obj)
{
short idx;
/* select a hand to hand weapon for the monster */
struct obj *
-select_hwep(mtmp)
-register struct monst *mtmp;
+select_hwep(struct monst *mtmp)
{
register struct obj *otmp;
register int i;
* otherwise never unwield stuff on their own. Might print message.
*/
void
-possibly_unwield(mon, polyspot)
-struct monst *mon;
-boolean polyspot;
+possibly_unwield(struct monst *mon, boolean polyspot)
{
struct obj *obj, *mw_tmp;
* Returns 1 if the monster took time to do it, 0 if it did not.
*/
int
-mon_wield_item(mon)
-register struct monst *mon;
+mon_wield_item(struct monst *mon)
{
struct obj *obj;
/* force monster to stop wielding current weapon, if any */
void
-mwepgone(mon)
-struct monst *mon;
+mwepgone(struct monst *mon)
{
struct obj *mwep = MON_WEP(mon);
/* attack bonus for strength & dexterity */
int
-abon()
+abon(void)
{
int sbon;
int str = ACURR(A_STR), dex = ACURR(A_DEX);
/* damage bonus for strength */
int
-dbon()
+dbon(void)
{
int str = ACURR(A_STR);
/* called when wet_a_towel() or dry_a_towel() is changing a towel's wetness */
static void
-finish_towel_change(obj, newspe)
-struct obj *obj;
-int newspe;
+finish_towel_change(struct obj *obj, int newspe)
{
/* towel wetness is always between 0 (dry) and 7, inclusive */
newspe = min(newspe, 7);
/* increase a towel's wetness */
void
-wet_a_towel(obj, amt, verbose)
-struct obj *obj;
-int amt; /* positive: new value; negative: increment by -amt; zero: no-op */
-boolean verbose;
+wet_a_towel(struct obj *obj,
+ int amt, /* positive: new value; negative: increment by -amt;
+ zero: no-op */
+ boolean verbose)
{
int newspe = (amt <= 0) ? obj->spe - amt : amt;
/* decrease a towel's wetness; unlike when wetting, 0 is not a no-op */
void
-dry_a_towel(obj, amt, verbose)
-struct obj *obj;
-int amt; /* positive or zero: new value; negative: decrement by abs(amt) */
-boolean verbose;
+dry_a_towel(struct obj *obj,
+ int amt, /* positive or zero: new value;
+ negative: decrement by abs(amt) */
+ boolean verbose)
{
int newspe = (amt < 0) ? obj->spe + amt : amt;
/* copy the skill level name into the given buffer */
char *
-skill_level_name(skill, buf)
-int skill;
-char *buf;
+skill_level_name(int skill, char *buf)
{
const char *ptr;
}
const char *
-skill_name(skill)
-int skill;
+skill_name(int skill)
{
return P_NAME(skill);
}
/* return the # of slots required to advance the skill */
static int
-slots_required(skill)
-int skill;
+slots_required(int skill)
{
int tmp = P_SKILL(skill);
/* return true if this skill can be advanced */
boolean
-can_advance(skill, speedy)
-int skill;
-boolean speedy;
+can_advance(int skill, boolean speedy)
{
if (P_RESTRICTED(skill)
|| P_SKILL(skill) >= P_MAX_SKILL(skill)
/* return true if this skill could be advanced if more slots were available */
static boolean
-could_advance(skill)
-int skill;
+could_advance(int skill)
{
if (P_RESTRICTED(skill)
|| P_SKILL(skill) >= P_MAX_SKILL(skill)
/* return true if this skill has reached its maximum and there's been enough
practice to become eligible for the next step if that had been possible */
static boolean
-peaked_skill(skill)
-int skill;
+peaked_skill(int skill)
{
if (P_RESTRICTED(skill))
return FALSE;
}
static void
-skill_advance(skill)
-int skill;
+skill_advance(int skill)
{
u.weapon_slots -= slots_required(skill);
P_SKILL(skill)++;
* others unselectable.
*/
int
-enhance_weapon_skill()
+enhance_weapon_skill(void)
{
int pass, i, n, len, longest, to_advance, eventually_advance, maxxed_cnt;
char buf[BUFSZ], sklnambuf[BUFSZ];
* function may be called with with P_NONE. Used in pray.c as well as below.
*/
void
-unrestrict_weapon_skill(skill)
-int skill;
+unrestrict_weapon_skill(int skill)
{
if (skill < P_NUM_SKILLS && P_RESTRICTED(skill)) {
P_SKILL(skill) = P_UNSKILLED;
}
void
-use_skill(skill, degree)
-int skill;
-int degree;
+use_skill(int skill, int degree)
{
boolean advance_before;
}
void
-add_weapon_skill(n)
-int n; /* number of slots to gain; normally one */
+add_weapon_skill(int n) /* number of slots to gain; normally one */
{
int i, before, after;
}
void
-lose_weapon_skill(n)
-int n; /* number of slots to lose; normally one */
+lose_weapon_skill(int n) /* number of slots to lose; normally one */
{
int skill;
}
void
-drain_weapon_skill(n)
-int n; /* number of skills to drain */
+drain_weapon_skill(int n) /* number of skills to drain */
{
int skill;
int i;
}
int
-weapon_type(obj)
-struct obj *obj;
+weapon_type(struct obj *obj)
{
/* KMH -- now uses the object table */
int type;
}
int
-uwep_skill_type()
+uwep_skill_type(void)
{
if (u.twoweap)
return P_TWO_WEAPON_COMBAT;
* Treat restricted weapons as unskilled.
*/
int
-weapon_hit_bonus(weapon)
-struct obj *weapon;
+weapon_hit_bonus(struct obj *weapon)
{
int type, wep_type, skill, bonus = 0;
static const char bad_skill[] = "weapon_hit_bonus: bad skill %d";
* Treat restricted weapons as unskilled.
*/
int
-weapon_dam_bonus(weapon)
-struct obj *weapon;
+weapon_dam_bonus(struct obj *weapon)
{
int type, wep_type, skill, bonus = 0;
* maximums.
*/
void
-skill_init(class_skill)
-const struct def_skill *class_skill;
+skill_init(const struct def_skill *class_skill)
{
struct obj *obj;
int skmax, skill;
}
void
-setmnotwielded(mon, obj)
-register struct monst *mon;
-register struct obj *obj;
+setmnotwielded(struct monst *mon, struct obj *obj)
{
if (!obj)
return;
#include "hack.h"
void
-were_change(mon)
-register struct monst *mon;
+were_change(struct monst *mon)
{
if (!is_were(mon->data))
return;
}
int
-counter_were(pm)
-int pm;
+counter_were(int pm)
{
switch (pm) {
case PM_WEREWOLF:
/* convert monsters similar to werecritters into appropriate werebeast */
int
-were_beastie(pm)
-int pm;
+were_beastie(int pm)
{
switch (pm) {
case PM_WERERAT:
}
void
-new_were(mon)
-register struct monst *mon;
+new_were(struct monst *mon)
{
register int pm;
/* were-creature (even you) summons a horde */
int
-were_summon(ptr, yours, visible, genbuf)
-struct permonst *ptr;
-boolean yours;
-int *visible; /* number of visible helpers created */
-char *genbuf;
+were_summon(struct permonst *ptr,
+ boolean yours,
+ int *visible, /* number of visible helpers created */
+ char *genbuf)
{
int i, typ, pm = monsndx(ptr);
struct monst *mtmp;
}
void
-you_were()
+you_were(void)
{
char qbuf[QBUFSZ];
boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
}
void
-you_unwere(purify)
-boolean purify;
+you_unwere(boolean purify)
{
boolean controllable_poly = Polymorph_control && !(Stunned || Unaware);
/* lycanthropy is being caught or cured, but no shape change is involved */
void
-set_ulycn(which)
-int which;
+set_ulycn(int which)
{
u.ulycn = which;
/* add or remove lycanthrope's innate intrinsics (Drain_resistance) */
* No item may be in more than one of these slots.
*/
-static boolean FDECL(cant_wield_corpse, (struct obj *));
-static int FDECL(ready_weapon, (struct obj *));
-static int FDECL(ready_ok, (struct obj *));
-static int FDECL(wield_ok, (struct obj *));
+static boolean cant_wield_corpse(struct obj *);
+static int ready_weapon(struct obj *);
+static int ready_ok(struct obj *);
+static int wield_ok(struct obj *);
/* used by will_weld() */
/* probably should be renamed */
* to print the appropriate messages.
*/
void
-setuwep(obj)
-register struct obj *obj;
+setuwep(struct obj *obj)
{
struct obj *olduwep = uwep;
}
static boolean
-cant_wield_corpse(obj)
-struct obj *obj;
+cant_wield_corpse(struct obj *obj)
{
char kbuf[BUFSZ];
}
static int
-ready_weapon(wep)
-struct obj *wep;
+ready_weapon(struct obj *wep)
{
/* Separated function so swapping works easily */
int res = 0;
}
void
-setuqwep(obj)
-register struct obj *obj;
+setuqwep(struct obj *obj)
{
setworn(obj, W_QUIVER);
/* no extra handling needed; this used to include a call to
}
void
-setuswapwep(obj)
-register struct obj *obj;
+setuswapwep(struct obj *obj)
{
setworn(obj, W_SWAPWEP);
return;
/* getobj callback for object to ready for throwing/shooting */
static int
-ready_ok(obj)
-struct obj *obj;
+ready_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_SUGGEST;
/* getobj callback for object to wield */
static int
-wield_ok(obj)
-struct obj *obj;
+wield_ok(struct obj *obj)
{
if (!obj)
return GETOBJ_SUGGEST;
}
int
-dowield()
+dowield(void)
{
char qbuf[QBUFSZ];
struct obj *wep, *oldwep;
}
int
-doswapweapon()
+doswapweapon(void)
{
register struct obj *oldwep, *oldswap;
int result = 0;
}
int
-dowieldquiver()
+dowieldquiver(void)
{
char qbuf[QBUFSZ];
struct obj *newquiver;
/* used for #rub and for applying pick-axe, whip, grappling hook or polearm */
boolean
-wield_tool(obj, verb)
-struct obj *obj;
-const char *verb; /* "rub",&c */
+wield_tool(struct obj *obj,
+ const char *verb) /* "rub",&c */
{
const char *what;
boolean more_than_1;
}
int
-can_twoweapon()
+can_twoweapon(void)
{
struct obj *otmp;
}
void
-drop_uswapwep()
+drop_uswapwep(void)
{
char str[BUFSZ];
struct obj *obj = uswapwep;
}
void
-set_twoweap(on_off)
-boolean on_off;
+set_twoweap(boolean on_off)
{
u.twoweap = on_off;
}
int
-dotwoweapon()
+dotwoweapon(void)
{
/* You can always toggle it off */
if (u.twoweap) {
* 2. Making an item disappear for a bones pile.
*/
void
-uwepgone()
+uwepgone(void)
{
if (uwep) {
if (artifact_light(uwep) && uwep->lamplit) {
}
void
-uswapwepgone()
+uswapwepgone(void)
{
if (uswapwep) {
setworn((struct obj *) 0, W_SWAPWEP);
}
void
-uqwepgone()
+uqwepgone(void)
{
if (uquiver) {
setworn((struct obj *) 0, W_QUIVER);
}
void
-untwoweapon()
+untwoweapon(void)
{
if (u.twoweap) {
You("%s.", can_no_longer_twoweap);
}
int
-chwepon(otmp, amount)
-register struct obj *otmp;
-register int amount;
+chwepon(struct obj *otmp, int amount)
{
const char *color = hcolor((amount < 0) ? NH_BLACK : NH_BLUE);
const char *xtime, *wepname = "";
}
int
-welded(obj)
-register struct obj *obj;
+welded(struct obj *obj)
{
if (obj && obj == uwep && will_weld(obj)) {
set_bknown(obj, 1);
}
void
-weldmsg(obj)
-register struct obj *obj;
+weldmsg(struct obj *obj)
{
long savewornmask;
/* test whether monster's wielded weapon is stuck to hand/paw/whatever */
boolean
-mwelded(obj)
-struct obj *obj;
+mwelded(struct obj *obj)
{
/* caller is responsible for making sure this is a monster's item */
if (obj && (obj->owornmask & W_WEP) && will_weld(obj))
/* Cannot just blindly include winX.h without including all of X11 stuff
and must get the order of include files right. Don't bother. */
extern struct window_procs X11_procs;
-extern void FDECL(win_X11_init, (int));
+extern void win_X11_init(int);
#endif
#ifdef QT_GRAPHICS
extern struct window_procs Qt_procs;
#endif
#ifdef BEOS_GRAPHICS
extern struct window_procs beos_procs;
-extern void FDECL(be_win_init, (int));
+extern void be_win_init(int);
FAIL /* be_win_init doesn't exist? XXX*/
#endif
#ifdef AMIGA_INTUITION
extern struct window_procs amii_procs;
extern struct window_procs amiv_procs;
-extern void FDECL(ami_wininit_data, (int));
+extern void ami_wininit_data(int);
#endif
#ifdef WIN32_GRAPHICS
extern struct window_procs win32_procs;
#endif
#ifdef WINCHAIN
extern struct window_procs chainin_procs;
-extern void FDECL(chainin_procs_init, (int));
-extern void *FDECL(chainin_procs_chain, (int, int, void *, void *, void *));
+extern void chainin_procs_init(int);
+extern void *chainin_procs_chain(int, int, void *, void *, void *);
extern struct chain_procs chainout_procs;
-extern void FDECL(chainout_procs_init, (int));
-extern void *FDECL(chainout_procs_chain, (int, int, void *, void *, void *));
+extern void chainout_procs_init(int);
+extern void *chainout_procs_chain(int, int, void *, void *, void *);
extern struct chain_procs trace_procs;
-extern void FDECL(trace_procs_init, (int));
-extern void *FDECL(trace_procs_chain, (int, int, void *, void *, void *));
+extern void trace_procs_init(int);
+extern void *trace_procs_chain(int, int, void *, void *, void *);
#endif
-static void FDECL(def_raw_print, (const char *s));
-static void NDECL(def_wait_synch);
+static void def_raw_print(const char *s);
+static void def_wait_synch(void);
#ifdef DUMPLOG
-static winid FDECL(dump_create_nhwindow, (int));
-static void FDECL(dump_clear_nhwindow, (winid));
-static void FDECL(dump_display_nhwindow, (winid, BOOLEAN_P));
-static void FDECL(dump_destroy_nhwindow, (winid));
-static void FDECL(dump_start_menu, (winid, unsigned long));
-static void FDECL(dump_add_menu, (winid, const glyph_info *, const ANY_P *, CHAR_P,
- CHAR_P, int, const char *, unsigned int));
-static void FDECL(dump_end_menu, (winid, const char *));
-static int FDECL(dump_select_menu, (winid, int, MENU_ITEM_P **));
-static void FDECL(dump_putstr, (winid, int, const char *));
+static winid dump_create_nhwindow(int);
+static void dump_clear_nhwindow(winid);
+static void dump_display_nhwindow(winid, boolean);
+static void dump_destroy_nhwindow(winid);
+static void dump_start_menu(winid, unsigned long);
+static void dump_add_menu(winid, const glyph_info *, const ANY_P *, char,
+ char, int, const char *, unsigned int);
+static void dump_end_menu(winid, const char *);
+static int dump_select_menu(winid, int, MENU_ITEM_P **);
+static void dump_putstr(winid, int, const char *);
#endif /* DUMPLOG */
#ifdef HANGUPHANDLING
static struct win_choices {
struct window_procs *procs;
- void FDECL((*ini_routine), (int)); /* optional (can be 0) */
+ void (*ini_routine)(int); /* optional (can be 0) */
#ifdef WINCHAIN
- void *FDECL((*chain_routine), (int, int, void *, void *, void *));
+ void *(*chain_routine)(int, int, void *, void *, void *);
#endif
} winchoices[] = {
#ifdef TTY_GRAPHICS
static struct winlink *chain = 0;
static struct winlink *
-wl_new()
+wl_new(void)
{
struct winlink *wl = (struct winlink *) alloc(sizeof *wl);
#endif /* WINCHAIN */
boolean
-genl_can_suspend_no(VOID_ARGS)
+genl_can_suspend_no(void)
{
return FALSE;
}
boolean
-genl_can_suspend_yes(VOID_ARGS)
+genl_can_suspend_yes(void)
{
return TRUE;
}
static
void
-def_raw_print(s)
-const char *s;
+def_raw_print(const char *s)
{
puts(s);
}
static
void
-def_wait_synch(VOID_ARGS)
+def_wait_synch(void)
{
/* Config file error handling routines
* call wait_sync() without checking to
#ifdef WINCHAIN
static struct win_choices *
-win_choices_find(s)
-const char *s;
+win_choices_find(const char *s)
{
register int i;
#endif
void
-choose_windows(s)
-const char *s;
+choose_windows(const char *s)
{
int i;
char *tmps = 0;
#ifdef WINCHAIN
void
-addto_windowchain(s)
-const char *s;
+addto_windowchain(const char *s)
{
register int i;
}
void
-commit_windowchain()
+commit_windowchain(void)
{
struct winlink *p;
int n;
*/
/*ARGSUSED*/
char
-genl_message_menu(let, how, mesg)
-char let UNUSED;
-int how UNUSED;
-const char *mesg;
+genl_message_menu(char let UNUSED,
+ int how UNUSED,
+ const char *mesg)
{
pline("%s", mesg);
return 0;
/*ARGSUSED*/
void
-genl_preference_update(pref)
-const char *pref UNUSED;
+genl_preference_update(const char *pref UNUSED)
{
/* window ports are expected to provide
their own preference update routine
}
char *
-genl_getmsghistory(init)
-boolean init UNUSED;
+genl_getmsghistory(boolean init UNUSED)
{
/* window ports can provide
their own getmsghistory() routine to
}
void
-genl_putmsghistory(msg, is_restoring)
-const char *msg;
-boolean is_restoring;
+genl_putmsghistory(const char *msg, boolean is_restoring)
{
/* window ports can provide
their own putmsghistory() routine to
* in order to avoid all terminal I/O after hangup/disconnect.
*/
-static int NDECL(hup_nhgetch);
-static char FDECL(hup_yn_function, (const char *, const char *, CHAR_P));
-static int FDECL(hup_nh_poskey, (int *, int *, int *));
-static void FDECL(hup_getlin, (const char *, char *));
-static void FDECL(hup_init_nhwindows, (int *, char **));
-static void FDECL(hup_exit_nhwindows, (const char *));
-static winid FDECL(hup_create_nhwindow, (int));
-static int FDECL(hup_select_menu, (winid, int, MENU_ITEM_P **));
-static void FDECL(hup_add_menu, (winid, const glyph_info *, const anything *,
- CHAR_P, CHAR_P, int, const char *,
- unsigned int));
-static void FDECL(hup_end_menu, (winid, const char *));
-static void FDECL(hup_putstr, (winid, int, const char *));
-static void FDECL(hup_print_glyph, (winid, XCHAR_P, XCHAR_P,
- const glyph_info *, const glyph_info *));
-static void FDECL(hup_outrip, (winid, int, time_t));
-static void FDECL(hup_curs, (winid, int, int));
-static void FDECL(hup_display_nhwindow, (winid, BOOLEAN_P));
-static void FDECL(hup_display_file, (const char *, BOOLEAN_P));
+static int hup_nhgetch(void);
+static char hup_yn_function(const char *, const char *, char);
+static int hup_nh_poskey(int *, int *, int *);
+static void hup_getlin(const char *, char *);
+static void hup_init_nhwindows(int *, char **);
+static void hup_exit_nhwindows(const char *);
+static winid hup_create_nhwindow(int);
+static int hup_select_menu(winid, int, MENU_ITEM_P **);
+static void hup_add_menu(winid, const glyph_info *, const anything *, char,
+ char, int, const char *, unsigned int);
+static void hup_end_menu(winid, const char *);
+static void hup_putstr(winid, int, const char *);
+static void hup_print_glyph(winid, xchar, xchar, const glyph_info *,
+ const glyph_info *);
+static void hup_outrip(winid, int, time_t);
+static void hup_curs(winid, int, int);
+static void hup_display_nhwindow(winid, boolean);
+static void hup_display_file(const char *, boolean);
#ifdef CLIPPING
-static void FDECL(hup_cliparound, (int, int));
+static void hup_cliparound(int, int);
#endif
#ifdef CHANGE_COLOR
-static void FDECL(hup_change_color, (int, long, int));
+static void hup_change_color(int, long, int);
#ifdef MAC
-static short FDECL(hup_set_font_name, (winid, char *));
+static short hup_set_font_name(winid, char *);
#endif
-static char *NDECL(hup_get_color_string);
+static char *hup_get_color_string(void);
#endif /* CHANGE_COLOR */
-static void FDECL(hup_status_update, (int, genericptr_t, int, int, int,
- unsigned long *));
+static void hup_status_update(int, genericptr_t, int, int, int,
+ unsigned long *);
-static int NDECL(hup_int_ndecl);
-static void NDECL(hup_void_ndecl);
-static void FDECL(hup_void_fdecl_int, (int));
-static void FDECL(hup_void_fdecl_winid, (winid));
-static void FDECL(hup_void_fdecl_winid_ulong, (winid, unsigned long));
-static void FDECL(hup_void_fdecl_constchar_p, (const char *));
+static int hup_int_ndecl(void);
+static void hup_void_ndecl(void);
+static void hup_void_fdecl_int(int);
+static void hup_void_fdecl_winid(winid);
+static void hup_void_fdecl_winid_ulong(winid, unsigned long);
+static void hup_void_fdecl_constchar_p(const char *);
static struct window_procs hup_procs = {
"hup", 0L, 0L,
hup_cliparound,
#endif
#ifdef POSITIONBAR
- (void FDECL((*), (char *))) hup_void_fdecl_constchar_p,
+ (void (*)(char *)) hup_void_fdecl_constchar_p,
/* update_positionbar */
#endif
hup_print_glyph,
genl_can_suspend_no,
};
-static void FDECL((*previnterface_exit_nhwindows), (const char *)) = 0;
+static void (*previnterface_exit_nhwindows)(const char *) = 0;
/* hangup has occurred; switch to no-op user interface */
void
-nhwindows_hangup()
+nhwindows_hangup(void)
{
- char *FDECL((*previnterface_getmsghistory), (BOOLEAN_P)) = 0;
+ char *(*previnterface_getmsghistory)(boolean) = 0;
#ifdef ALTMETA
/* command processor shouldn't look for 2nd char after seeing ESC */
}
static void
-hup_exit_nhwindows(lastgasp)
-const char *lastgasp;
+hup_exit_nhwindows(const char *lastgasp)
{
/* core has called exit_nhwindows(); call the previous interface's
shutdown routine now; xxx_exit_nhwindows() needs to call other
}
static int
-hup_nhgetch(VOID_ARGS)
+hup_nhgetch(void)
{
return '\033'; /* ESC */
}
/*ARGSUSED*/
static char
-hup_yn_function(prompt, resp, deflt)
-const char *prompt UNUSED, *resp UNUSED;
-char deflt;
+hup_yn_function(const char *prompt UNUSED,
+ const char *resp UNUSED,
+ char deflt)
{
if (!deflt)
deflt = '\033';
/*ARGSUSED*/
static int
-hup_nh_poskey(x, y, mod)
-int *x UNUSED, *y UNUSED, *mod UNUSED;
+hup_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED)
{
return '\033';
}
/*ARGSUSED*/
static void
-hup_getlin(prompt, outbuf)
-const char *prompt UNUSED;
-char *outbuf;
+hup_getlin(const char *prompt UNUSED, char *outbuf)
{
Strcpy(outbuf, "\033");
}
/*ARGSUSED*/
static void
-hup_init_nhwindows(argc_p, argv)
-int *argc_p UNUSED;
-char **argv UNUSED;
+hup_init_nhwindows(int *argc_p UNUSED, char **argv UNUSED)
{
iflags.window_inited = 1;
}
/*ARGUSED*/
static winid
-hup_create_nhwindow(type)
-int type UNUSED;
+hup_create_nhwindow(int type UNUSED)
{
return WIN_ERR;
}
/*ARGSUSED*/
static int
-hup_select_menu(window, how, menu_list)
-winid window UNUSED;
-int how UNUSED;
-struct mi **menu_list UNUSED;
+hup_select_menu(winid window UNUSED, int how UNUSED,
+ struct mi **menu_list UNUSED)
{
return -1;
}
/*ARGSUSED*/
static void
-hup_add_menu(window, glyphinfo, identifier, sel, grpsel, attr, txt, itemflags)
-winid window UNUSED;
-const glyph_info *glyphinfo UNUSED;
-int attr UNUSED;
-const anything *identifier UNUSED;
-char sel UNUSED, grpsel UNUSED;
-const char *txt UNUSED;
-unsigned int itemflags UNUSED;
+hup_add_menu(winid window UNUSED,
+ const glyph_info *glyphinfo UNUSED,
+ const anything *identifier UNUSED,
+ char sel UNUSED,
+ char grpsel UNUSED,
+ int attr UNUSED,
+ const char *txt UNUSED,
+ unsigned int itemflags UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_end_menu(window, prompt)
-winid window UNUSED;
-const char *prompt UNUSED;
+hup_end_menu(winid window UNUSED, const char *prompt UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_putstr(window, attr, text)
-winid window UNUSED;
-int attr UNUSED;
-const char *text UNUSED;
+hup_putstr(winid window UNUSED, int attr UNUSED, const char *text UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_print_glyph(window, x, y, glyphinfo, bkglyphinfo)
-winid window UNUSED;
-xchar x UNUSED, y UNUSED;
-const glyph_info *glyphinfo UNUSED;
-const glyph_info *bkglyphinfo UNUSED;
+hup_print_glyph(winid window UNUSED,
+ xchar x UNUSED, xchar y UNUSED,
+ const glyph_info *glyphinfo UNUSED,
+ const glyph_info *bkglyphinfo UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_outrip(tmpwin, how, when)
-winid tmpwin UNUSED;
-int how UNUSED;
-time_t when UNUSED;
+hup_outrip(winid tmpwin UNUSED, int how UNUSED, time_t when UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_curs(window, x, y)
-winid window UNUSED;
-int x UNUSED, y UNUSED;
+hup_curs(winid window UNUSED, int x UNUSED, int y UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_display_nhwindow(window, blocking)
-winid window UNUSED;
-boolean blocking UNUSED;
+hup_display_nhwindow(winid window UNUSED, boolean blocking UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-hup_display_file(fname, complain)
-const char *fname UNUSED;
-boolean complain UNUSED;
+hup_display_file(const char *fname UNUSED, boolean complain UNUSED)
{
return;
}
#ifdef CLIPPING
/*ARGSUSED*/
static void
-hup_cliparound(x, y)
-int x UNUSED, y UNUSED;
+hup_cliparound(int x UNUSED, int y UNUSED)
{
return;
}
#ifdef CHANGE_COLOR
/*ARGSUSED*/
static void
-hup_change_color(color, rgb, reverse)
-int color, reverse;
-long rgb;
+hup_change_color(int color, int reverse, long rgb)
{
return;
}
#ifdef MAC
/*ARGSUSED*/
static short
-hup_set_font_name(window, fontname)
-winid window;
-char *fontname;
+hup_set_font_name(winid window, char *fontname)
{
return 0;
}
#endif /* MAC */
static char *
-hup_get_color_string(VOID_ARGS)
+hup_get_color_string(void)
{
return (char *) 0;
}
/*ARGSUSED*/
static void
-hup_status_update(idx, ptr, chg, pc, color, colormasks)
-int idx UNUSED;
-genericptr_t ptr UNUSED;
-int chg UNUSED, pc UNUSED, color UNUSED;
-unsigned long *colormasks UNUSED;
-
+hup_status_update(int idx UNUSED, genericptr_t ptr UNUSED, int chg UNUSED,
+ int pc UNUSED, int color UNUSED,
+ unsigned long *colormasks UNUSED)
{
return;
}
*/
static int
-hup_int_ndecl(VOID_ARGS)
+hup_int_ndecl(void)
{
return -1;
}
static void
-hup_void_ndecl(VOID_ARGS)
+hup_void_ndecl(void)
{
return;
}
/*ARGUSED*/
static void
-hup_void_fdecl_int(arg)
-int arg UNUSED;
+hup_void_fdecl_int(int arg UNUSED)
{
return;
}
/*ARGUSED*/
static void
-hup_void_fdecl_winid(window)
-winid window UNUSED;
+hup_void_fdecl_winid(winid window UNUSED)
{
return;
}
/*ARGUSED*/
static void
-hup_void_fdecl_winid_ulong(window, mbehavior)
-winid window UNUSED;
-unsigned long mbehavior UNUSED;
+hup_void_fdecl_winid_ulong(winid window UNUSED,
+ unsigned long mbehavior UNUSED)
{
return;
}
/*ARGUSED*/
static void
-hup_void_fdecl_constchar_p(string)
-const char *string UNUSED;
+hup_void_fdecl_constchar_p(const char *string UNUSED)
{
return;
}
boolean status_activefields[MAXBLSTATS];
void
-genl_status_init()
+genl_status_init(void)
{
int i;
}
void
-genl_status_finish()
+genl_status_finish(void)
{
/* tear down routine */
int i;
}
void
-genl_status_enablefield(fieldidx, nm, fmt, enable)
-int fieldidx;
-const char *nm;
-const char *fmt;
-boolean enable;
+genl_status_enablefield(int fieldidx, const char *nm, const char *fmt,
+ boolean enable)
{
status_fieldfmt[fieldidx] = fmt;
status_fieldnm[fieldidx] = nm;
/* call once for each field, then call with BL_FLUSH to output the result */
void
-genl_status_update(idx, ptr, chg, percent, color, colormasks)
-int idx;
-genericptr_t ptr;
-int chg UNUSED, percent UNUSED, color UNUSED;
-unsigned long *colormasks UNUSED;
+genl_status_update(int idx, genericptr_t ptr, int chg UNUSED,
+ int percent UNUSED, int color UNUSED,
+ unsigned long *colormasks UNUSED)
{
char newbot1[MAXCO], newbot2[MAXCO];
long cond, *condptr = (long *) ptr;
static time_t dumplog_now;
char *
-dump_fmtstr(fmt, buf, fullsubs)
-const char *fmt;
-char *buf;
-boolean fullsubs; /* True -> full substitution for file name, False ->
- * partial substitution for '--showpaths' feedback
- * where there's no game in progress when executed */
+dump_fmtstr(const char *fmt, char *buf,
+ boolean fullsubs) /* True -> full substitution for file name,
+ False -> partial substitution for
+ '--showpaths' feedback where there's
+ no game in progress when executed */
{
const char *fp = fmt;
char *bp = buf;
#endif /* DUMPLOG */
void
-dump_open_log(now)
-time_t now;
+dump_open_log(time_t now)
{
#ifdef DUMPLOG
char buf[BUFSZ];
}
void
-dump_close_log()
+dump_close_log(void)
{
if (dumplog_file) {
(void) fclose(dumplog_file);
}
void
-dump_forward_putstr(win, attr, str, no_forward)
-winid win;
-int attr;
-const char *str;
-int no_forward;
+dump_forward_putstr(winid win, int attr, const char *str, int no_forward)
{
if (dumplog_file)
fprintf(dumplog_file, "%s\n", str);
/*ARGSUSED*/
static void
-dump_putstr(win, attr, str)
-winid win UNUSED;
-int attr UNUSED;
-const char *str;
+dump_putstr(winid win UNUSED, int attr UNUSED, const char *str)
{
if (dumplog_file)
fprintf(dumplog_file, "%s\n", str);
}
static winid
-dump_create_nhwindow(dummy)
-int dummy;
+dump_create_nhwindow(int dummy)
{
return dummy;
}
/*ARGUSED*/
static void
-dump_clear_nhwindow(win)
-winid win UNUSED;
+dump_clear_nhwindow(winid win UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-dump_display_nhwindow(win, p)
-winid win UNUSED;
-boolean p UNUSED;
+dump_display_nhwindow(winid win UNUSED, boolean p UNUSED)
{
return;
}
/*ARGUSED*/
static void
-dump_destroy_nhwindow(win)
-winid win UNUSED;
+dump_destroy_nhwindow(winid win UNUSED)
{
return;
}
/*ARGUSED*/
static void
-dump_start_menu(win, mbehavior)
-winid win UNUSED;
-unsigned long mbehavior UNUSED;
+dump_start_menu(winid win UNUSED, unsigned long mbehavior UNUSED)
{
return;
}
/*ARGSUSED*/
static void
-dump_add_menu(win, glyphinfo, identifier, ch, gch, attr, str, itemflags)
-winid win UNUSED;
-const glyph_info *glyphinfo;
-const anything *identifier UNUSED;
-char ch;
-char gch UNUSED;
-int attr UNUSED;
-const char *str;
-unsigned int itemflags UNUSED;
+dump_add_menu(winid win UNUSED,
+ const glyph_info *glyphinfo,
+ const anything *identifier UNUSED,
+ char ch,
+ char gch UNUSED,
+ int attr UNUSED,
+ const char *str,
+ unsigned int itemflags UNUSED)
{
if (dumplog_file) {
if (glyphinfo->glyph == NO_GLYPH)
/*ARGSUSED*/
static void
-dump_end_menu(win, str)
-winid win UNUSED;
-const char *str;
+dump_end_menu(winid win UNUSED, const char *str)
{
if (dumplog_file) {
if (str)
}
static int
-dump_select_menu(win, how, item)
-winid win UNUSED;
-int how UNUSED;
-menu_item **item;
+dump_select_menu(winid win UNUSED, int how UNUSED, menu_item **item)
{
*item = (menu_item *) 0;
return 0;
}
void
-dump_redirect(onoff_flag)
-boolean onoff_flag;
+dump_redirect(boolean onoff_flag)
{
if (dumplog_file) {
if (onoff_flag) {
#endif
int
-has_color(color)
-int color;
+has_color(int color)
{
return (iflags.use_color && windowprocs.name
&& (windowprocs.wincap & WC_COLOR) && windowprocs.has_color[color]
}
int
-glyph2ttychar(glyph)
-int glyph;
+glyph2ttychar(int glyph)
{
glyph_info glyphinfo;
}
int
-glyph2symidx(glyph)
-int glyph;
+glyph2symidx(int glyph)
{
glyph_info glyphinfo;
}
char *
-encglyph(glyph)
-int glyph;
+encglyph(int glyph)
{
static char encbuf[20]; /* 10+1 would suffice */
}
char *
-decode_mixed(buf, str)
-char *buf;
-const char *str;
+decode_mixed(char *buf, const char *str)
{
static const char hex[] = "00112233445566778899aAbBcCdDeEfF";
char *put = buf;
*/
void
-genl_putmixed(window, attr, str)
-winid window;
-int attr;
-const char *str;
+genl_putmixed(winid window, int attr, const char *str)
{
char buf[BUFSZ];
* logic into one place instead of 7 different window-port routines.
*/
boolean
-menuitem_invert_test(mode, itemflags, is_selected)
-int mode;
-unsigned itemflags; /* The itemflags for the item */
-boolean is_selected; /* The current selection status of the item */
+menuitem_invert_test(int mode,
+ unsigned itemflags, /* The itemflags for the item */
+ boolean is_selected) /* The current selection status
+ of the item */
{
boolean skipinvert = (itemflags & MENU_ITEMFLAGS_SKIPINVERT) != 0;
#include "hack.h"
-static short FDECL(which_arti, (int));
-static boolean FDECL(mon_has_arti, (struct monst *, SHORT_P));
-static struct monst *FDECL(other_mon_has_arti, (struct monst *, SHORT_P));
-static struct obj *FDECL(on_ground, (SHORT_P));
-static boolean FDECL(you_have, (int));
-static unsigned long FDECL(target_on, (int, struct monst *));
-static unsigned long FDECL(strategy, (struct monst *));
-static void FDECL(choose_stairs, (xchar *, xchar *));
+static short which_arti(int);
+static boolean mon_has_arti(struct monst *, short);
+static struct monst *other_mon_has_arti(struct monst *, short);
+static struct obj *on_ground(short);
+static boolean you_have(int);
+static unsigned long target_on(int, struct monst *);
+static unsigned long strategy(struct monst *);
+static void choose_stairs(xchar *, xchar *);
/* adding more neutral creatures will tend to reduce the number of monsters
summoned by nasty(); adding more lawful creatures will reduce the number
/* If you've found the Amulet, make the Wizard appear after some time */
/* Also, give hints about portal locations, if amulet is worn/wielded -dlc */
void
-amulet()
+amulet(void)
{
struct monst *mtmp;
struct trap *ttmp;
}
int
-mon_has_amulet(mtmp)
-register struct monst *mtmp;
+mon_has_amulet(struct monst *mtmp)
{
register struct obj *otmp;
}
int
-mon_has_special(mtmp)
-register struct monst *mtmp;
+mon_has_special(struct monst *mtmp)
{
register struct obj *otmp;
#define M_Wants(mask) (mtmp->data->mflags3 & (mask))
static short
-which_arti(mask)
-register int mask;
+which_arti(int mask)
{
switch (mask) {
case M3_WANTSAMUL:
* artifacts right now. [MRS]
*/
static boolean
-mon_has_arti(mtmp, otyp)
-register struct monst *mtmp;
-register short otyp;
+mon_has_arti(struct monst *mtmp, short otyp)
{
register struct obj *otmp;
}
static struct monst *
-other_mon_has_arti(mtmp, otyp)
-register struct monst *mtmp;
-register short otyp;
+other_mon_has_arti(struct monst *mtmp, short otyp)
{
register struct monst *mtmp2;
}
static struct obj *
-on_ground(otyp)
-register short otyp;
+on_ground(short otyp)
{
register struct obj *otmp;
}
static boolean
-you_have(mask)
-register int mask;
+you_have(int mask)
{
switch (mask) {
case M3_WANTSAMUL:
}
static unsigned long
-target_on(mask, mtmp)
-register int mask;
-register struct monst *mtmp;
+target_on(int mask, struct monst *mtmp)
{
register short otyp;
register struct obj *otmp;
}
static unsigned long
-strategy(mtmp)
-register struct monst *mtmp;
+strategy(struct monst *mtmp)
{
unsigned long strat, dstrat;
}
static void
-choose_stairs(sx, sy)
-xchar *sx;
-xchar *sy;
+choose_stairs(xchar *sx, xchar *sy)
{
xchar x = 0, y = 0;
stairway *stway = g.stairs;
}
int
-tactics(mtmp)
-register struct monst *mtmp;
+tactics(struct monst *mtmp)
{
unsigned long strat = strategy(mtmp);
xchar sx = 0, sy = 0, mx, my;
/* are there any monsters mon could aggravate? */
boolean
-has_aggravatables(mon)
-struct monst *mon;
+has_aggravatables(struct monst *mon)
{
struct monst *mtmp;
boolean in_w_tower = In_W_tower(mon->mx, mon->my, &u.uz);
}
void
-aggravate()
+aggravate(void)
{
register struct monst *mtmp;
boolean in_w_tower = In_W_tower(u.ux, u.uy, &u.uz);
only casting this when there is currently one wizard in existence;
the clone can't use it unless/until its creator has been killed off */
void
-clonewiz()
+clonewiz(void)
{
register struct monst *mtmp2;
/* also used by newcham() */
int
-pick_nasty(difcap)
-int difcap; /* if non-zero, try to make difficulty be lower than this */
+pick_nasty(int difcap) /* if non-zero, try to make difficulty be lower
+ than this */
{
int alt, res = nasties[rn2(SIZE(nasties))];
creatures on average (in 3.6.0 and earlier, Null was treated as chaotic);
returns the number of monsters created */
int
-nasty(summoner)
-struct monst *summoner;
+nasty(struct monst *summoner)
{
struct monst *mtmp;
coord bypos;
/* Let's resurrect the wizard, for some unexpected fun. */
void
-resurrect()
+resurrect(void)
{
struct monst *mtmp, **mmtmp;
long elapsed;
/* Here, we make trouble for the poor shmuck who actually
managed to do in the Wizard. */
void
-intervene()
+intervene(void)
{
int which = Is_astralevel(&u.uz) ? rnd(4) : rn2(6);
/* cases 0 and 5 don't apply on the Astral level */
}
void
-wizdead()
+wizdead(void)
{
g.context.no_of_wizards--;
if (!u.uevent.udemigod) {
/* Insult or intimidate the player */
void
-cuss(mtmp)
-register struct monst *mtmp;
+cuss(struct monst *mtmp)
{
if (Deaf)
return;
xchar wx, wy; /* the segment's position */
};
-static void FDECL(toss_wsegs, (struct wseg *, BOOLEAN_P));
-static void FDECL(shrink_worm, (int));
+static void toss_wsegs(struct wseg *, boolean);
+static void shrink_worm(int);
#if 0
-static void FDECL(random_dir, (int, int, int *, int *));
+static void random_dir(int, int, int *, int *);
#endif
-static struct wseg *FDECL(create_worm_tail, (int));
+static struct wseg *create_worm_tail(int);
/* Description of long worm implementation.
*
* Implementation is left to the interested hacker.
*/
int
-get_wormno()
+get_wormno(void)
{
int new_wormno = 1;
* not be called.
*/
void
-initworm(worm, wseg_count)
-struct monst *worm;
-int wseg_count;
+initworm(struct monst *worm, int wseg_count)
{
struct wseg *seg, *new_tail = create_worm_tail(wseg_count);
int wnum = worm->wormno;
*/
static
void
-toss_wsegs(curr, display_update)
-struct wseg *curr;
-boolean display_update;
+toss_wsegs(struct wseg *curr, boolean display_update)
{
struct wseg *nxtseg;
*/
static
void
-shrink_worm(wnum)
-int wnum; /* worm number */
+shrink_worm(int wnum) /* worm number */
{
struct wseg *seg;
* Move the worm. Maybe grow.
*/
void
-worm_move(worm)
-struct monst *worm;
+worm_move(struct monst *worm)
{
struct wseg *seg, *new_seg; /* new segment */
int wnum = worm->wormno; /* worm number */
* The worm don't move so it should shrink.
*/
void
-worm_nomove(worm)
-struct monst *worm;
+worm_nomove(struct monst *worm)
{
shrink_worm((int) worm->wormno); /* shrink */
* Kill a worm tail.
*/
void
-wormgone(worm)
-struct monst *worm;
+wormgone(struct monst *worm)
{
int wnum = worm->wormno;
* or 0 if it doesn't.
*/
int
-wormhitu(worm)
-struct monst *worm;
+wormhitu(struct monst *worm)
{
int wnum = worm->wormno;
struct wseg *seg;
* that both halves will survive.
*/
void
-cutworm(worm, x, y, cuttier)
-struct monst *worm;
-xchar x, y;
-boolean cuttier; /* hit is by wielded blade or axe or by thrown axe */
+cutworm(struct monst *worm, xchar x, xchar y,
+ boolean cuttier) /* hit is by wielded blade or axe or by thrown axe */
{
struct wseg *curr, *new_tail;
struct monst *new_worm;
* is located here for modularity.
*/
void
-see_wsegs(worm)
-struct monst *worm;
+see_wsegs(struct monst *worm)
{
struct wseg *curr = wtails[worm->wormno];
* Display all of the segments of the given worm for detection.
*/
void
-detect_wsegs(worm, use_detection_glyph)
-struct monst *worm;
-boolean use_detection_glyph;
+detect_wsegs(struct monst *worm, boolean use_detection_glyph)
{
int num;
struct wseg *curr = wtails[worm->wormno];
* of segments, including the dummy. Called from save.c.
*/
void
-save_worm(nhfp)
-NHFILE *nhfp;
+save_worm(NHFILE *nhfp)
{
int i;
int count;
* Restore the worm information from the save file. Called from restore.c
*/
void
-rest_worm(nhfp)
-NHFILE *nhfp;
+rest_worm(NHFILE *nhfp)
{
int i, j, count = 0;
struct wseg *curr, *temp;
* in the same location as worm segments
*/
void
-place_wsegs(worm, oldworm)
-struct monst *worm, *oldworm;
+place_wsegs(struct monst *worm, struct monst *oldworm)
{
struct wseg *curr = wtails[worm->wormno];
/* called from mon_sanity_check(mon.c) */
void
-sanity_check_worm(worm)
-struct monst *worm;
+sanity_check_worm(struct monst *worm)
{
struct wseg *curr;
int wnum, x, y;
/* called from mon_sanity_check(mon.c) */
void
-wormno_sanity_check()
+wormno_sanity_check(void)
{
#ifdef EXTRA_SANITY_CHECKS
struct wseg *seg;
* not remove the mon from the fmon chain.
*/
void
-remove_worm(worm)
-struct monst *worm;
+remove_worm(struct monst *worm)
{
struct wseg *curr = wtails[worm->wormno];
* be, if somehow the head is disjoint from the tail.
*/
void
-place_worm_tail_randomly(worm, x, y)
-struct monst *worm;
-xchar x, y;
+place_worm_tail_randomly(struct monst *worm, xchar x, xchar y)
{
int wnum = worm->wormno;
struct wseg *curr = wtails[wnum];
* This function, and the loop it serves, could be eliminated by coding
* enexto() with a search radius.
*/
-static
-void
-random_dir(x, y, nx, ny)
-int x, y;
-int *nx, *ny;
+static void
+random_dir(int x, int y, int *nx, int *ny)
{
*nx = x + (x > 1 /* extreme left ? */
? (x < COLNO - 1 /* extreme right ? */
/* for size_monst(cmd.c) to support #stats */
int
-size_wseg(worm)
-struct monst *worm;
+size_wseg(struct monst *worm)
{
return (int) (count_wsegs(worm) * sizeof (struct wseg));
}
* returns the number of segments that a worm has.
*/
int
-count_wsegs(mtmp)
-struct monst *mtmp;
+count_wsegs(struct monst *mtmp)
{
int i = 0;
struct wseg *curr;
*/
static
struct wseg *
-create_worm_tail(num_segs)
-int num_segs;
+create_worm_tail(int num_segs)
{
int i = 0;
struct wseg *new_tail, *curr;
* Mostly used in the canseemon() macro.
*/
boolean
-worm_known(worm)
-struct monst *worm;
+worm_known(struct monst *worm)
{
struct wseg *curr = wtails[worm->wormno];
/* would moving from <x1,y1> to <x2,y2> involve passing between two
consecutive segments of the same worm? */
boolean
-worm_cross(x1, y1, x2, y2)
-int x1, y1, x2, y2;
+worm_cross(int x1, int y1, int x2, int y2)
{
struct monst *worm;
struct wseg *curr, *wnxt;
/* construct an index number for a worm tail segment */
int
-wseg_at(worm, x, y)
-struct monst *worm;
-int x, y;
+wseg_at(struct monst *worm, int x, int y)
{
int res = 0;
}
void
-flip_worm_segs_vertical(worm, miny, maxy)
-struct monst *worm;
-int miny, maxy;
+flip_worm_segs_vertical(struct monst *worm, int miny, int maxy)
{
struct wseg *curr = wtails[worm->wormno];
}
void
-flip_worm_segs_horizontal(worm, minx, maxx)
-struct monst *worm;
-int minx, maxx;
+flip_worm_segs_horizontal(struct monst *worm, int minx, int maxx)
{
struct wseg *curr = wtails[worm->wormno];
#include "hack.h"
-static void FDECL(m_lose_armor, (struct monst *, struct obj *));
-static void FDECL(m_dowear_type,
- (struct monst *, long, BOOLEAN_P, BOOLEAN_P));
-static int FDECL(extra_pref, (struct monst *, struct obj *));
+static void m_lose_armor(struct monst *, struct obj *);
+static void m_dowear_type(struct monst *, long, boolean, boolean);
+static int extra_pref(struct monst *, struct obj *);
const struct worn {
long w_mask;
/* Updated to use the extrinsic and blocked fields. */
void
-setworn(obj, mask)
-register struct obj *obj;
-long mask;
+setworn(struct obj *obj, long mask)
{
register const struct worn *wp;
register struct obj *oobj;
/* called e.g. when obj is destroyed */
/* Updated to use the extrinsic and blocked fields. */
void
-setnotworn(obj)
-register struct obj *obj;
+setnotworn(struct obj *obj)
{
register const struct worn *wp;
register int p;
/* called when saving with FREEING flag set has just discarded inventory */
void
-allunworn()
+allunworn(void)
{
const struct worn *wp;
/* return item worn in slot indiciated by wornmask; needed by poly_obj() */
struct obj *
-wearmask_to_obj(wornmask)
-long wornmask;
+wearmask_to_obj(long wornmask)
{
const struct worn *wp;
/* return a bitmask of the equipment slot(s) a given item might be worn in */
long
-wearslot(obj)
-struct obj *obj;
+wearslot(struct obj *obj)
{
int otyp = obj->otyp;
/* practically any item can be wielded or quivered; it's up to
}
void
-mon_set_minvis(mon)
-struct monst *mon;
+mon_set_minvis(struct monst *mon)
{
mon->perminvis = 1;
if (!mon->invis_blkd) {
}
void
-mon_adjust_speed(mon, adjust, obj)
-struct monst *mon;
-int adjust; /* positive => increase speed, negative => decrease */
-struct obj *obj; /* item to make known if effect can be seen */
+mon_adjust_speed(struct monst *mon,
+ int adjust, /* positive => increase speed, negative =>
+ decrease */
+ struct obj *obj) /* item to make known if effect can be seen */
{
struct obj *otmp;
boolean give_msg = !g.in_mklev, petrify = FALSE;
/* armor put on or taken off; might be magical variety
[TODO: rename to 'update_mon_extrinsics()' and change all callers...] */
void
-update_mon_intrinsics(mon, obj, on, silently)
-struct monst *mon;
-struct obj *obj;
-boolean on, silently;
+update_mon_intrinsics(struct monst *mon, struct obj *obj, boolean on,
+ boolean silently)
{
int unseen;
uchar mask;
}
int
-find_mac(mon)
-register struct monst *mon;
+find_mac(struct monst *mon)
{
register struct obj *obj;
int base = mon->data->ac;
* already worn body armor is too obviously buggy...
*/
void
-m_dowear(mon, creation)
-register struct monst *mon;
-boolean creation;
+m_dowear(struct monst *mon, boolean creation)
{
#define RACE_EXCEPTION TRUE
/* Note the restrictions here are the same as in dowear in do_wear.c
}
static void
-m_dowear_type(mon, flag, creation, racialexception)
-struct monst *mon;
-long flag;
-boolean creation;
-boolean racialexception;
+m_dowear_type(struct monst *mon, long flag, boolean creation,
+ boolean racialexception)
{
struct obj *old, *best, *obj;
int m_delay = 0;
#undef RACE_EXCEPTION
struct obj *
-which_armor(mon, flag)
-struct monst *mon;
-long flag;
+which_armor(struct monst *mon, long flag)
{
if (mon == &g.youmonst) {
switch (flag) {
/* remove an item of armor and then drop it */
static void
-m_lose_armor(mon, obj)
-struct monst *mon;
-struct obj *obj;
+m_lose_armor(struct monst *mon, struct obj *obj)
{
mon->misc_worn_check &= ~obj->owornmask;
if (obj->owornmask)
/* all objects with their bypass bit set should now be reset to normal */
void
-clear_bypasses()
+clear_bypasses(void)
{
struct obj *otmp, *nobj;
struct monst *mtmp;
}
void
-bypass_obj(obj)
-struct obj *obj;
+bypass_obj(struct obj *obj)
{
obj->bypass = 1;
g.context.bypasses = TRUE;
/* set or clear the bypass bit in a list of objects */
void
-bypass_objlist(objchain, on)
-struct obj *objchain;
-boolean on; /* TRUE => set, FALSE => clear */
+bypass_objlist(struct obj *objchain,
+ boolean on) /* TRUE => set, FALSE => clear */
{
if (on && objchain)
g.context.bypasses = TRUE;
/* return the first object without its bypass bit set; set that bit
before returning so that successive calls will find further objects */
struct obj *
-nxt_unbypassed_obj(objchain)
-struct obj *objchain;
+nxt_unbypassed_obj(struct obj *objchain)
{
while (objchain) {
if (!objchain->bypass) {
there's an added complication that the array may have stale pointers
for deleted objects (see Multiple-Drop case in askchain(invent.c)) */
struct obj *
-nxt_unbypassed_loot(lootarray, listhead)
-Loot *lootarray;
-struct obj *listhead;
+nxt_unbypassed_loot(Loot *lootarray, struct obj *listhead)
{
struct obj *o, *obj;
}
void
-mon_break_armor(mon, polyspot)
-struct monst *mon;
-boolean polyspot;
+mon_break_armor(struct monst *mon, boolean polyspot)
{
register struct obj *otmp;
struct permonst *mdat = mon->data;
/* bias a monster's preferences towards armor that has special benefits. */
static int
-extra_pref(mon, obj)
-struct monst *mon;
-struct obj *obj;
+extra_pref(struct monst *mon, struct obj *obj)
{
/* currently only does speed boots, but might be expanded if monsters
* get to use more armor abilities
* -1 If the race/object combination is unacceptable.
*/
int
-racial_exception(mon, obj)
-struct monst *mon;
-struct obj *obj;
+racial_exception(struct monst *mon, struct obj *obj)
{
const struct permonst *ptr = raceptr(mon);
#include "hack.h"
-static int FDECL(cost, (struct obj *));
-static boolean FDECL(label_known, (int, struct obj *));
-static int FDECL(write_ok, (struct obj *));
-static char *FDECL(new_book_description, (int, char *));
+static int cost(struct obj *);
+static boolean label_known(int, struct obj *);
+static int write_ok(struct obj *);
+static char *new_book_description(int, char *);
/*
* returns basecost of a scroll or a spellbook
*/
static int
-cost(otmp)
-register struct obj *otmp;
+cost(struct obj *otmp)
{
if (otmp->oclass == SPBOOK_CLASS)
return (10 * objects[otmp->otyp].oc_level);
the discoveries list and aren't present in current inventory,
so some scrolls with ought to yield True will end up False */
static boolean
-label_known(scrolltype, objlist)
-int scrolltype;
-struct obj *objlist;
+label_known(int scrolltype, struct obj *objlist)
{
struct obj *otmp;
/* getobj callback for object to write on */
static int
-write_ok(obj)
-struct obj *obj;
+write_ok(struct obj *obj)
{
if (!obj || (obj->oclass != SCROLL_CLASS && obj->oclass != SPBOOK_CLASS))
return GETOBJ_EXCLUDE;
/* write -- applying a magic marker */
int
-dowrite(pen)
-register struct obj *pen;
+dowrite(struct obj *pen)
{
register struct obj *paper;
char namebuf[BUFSZ] = DUMMY, *nm, *bp;
even that's rather iffy, indicating that such descriptions probably
ought to be eliminated (especially "cloth"!) */
static char *
-new_book_description(booktype, outbuf)
-int booktype;
-char *outbuf;
+new_book_description(int booktype, char *outbuf)
{
/* subset of description strings from objects.c; if it grows
much, we may need to add a new flag field to objects[] instead */
*/
#define MAGIC_COOKIE 1000
-static void FDECL(polyuse, (struct obj *, int, int));
-static void FDECL(create_polymon, (struct obj *, int));
-static int FDECL(stone_to_flesh_obj, (struct obj *));
-static boolean FDECL(zap_updown, (struct obj *));
-static void FDECL(zhitu, (int, int, const char *, XCHAR_P, XCHAR_P));
-static void FDECL(revive_egg, (struct obj *));
-static boolean FDECL(zap_steed, (struct obj *));
-static void FDECL(skiprange, (int, int *, int *));
-static int FDECL(zap_hit, (int, int));
-static void FDECL(disintegrate_mon, (struct monst *, int, const char *));
-static void FDECL(backfire, (struct obj *));
-static int FDECL(zap_ok, (struct obj *));
-static void FDECL(boxlock_invent, (struct obj *));
-static int FDECL(spell_hit_bonus, (int));
-static void FDECL(destroy_one_item, (struct obj *, int, int));
-static void FDECL(wishcmdassist, (int));
+static void polyuse(struct obj *, int, int);
+static void create_polymon(struct obj *, int);
+static int stone_to_flesh_obj(struct obj *);
+static boolean zap_updown(struct obj *);
+static void zhitu(int, int, const char *, xchar, xchar);
+static void revive_egg(struct obj *);
+static boolean zap_steed(struct obj *);
+static void skiprange(int, int *, int *);
+static int zap_hit(int, int);
+static void disintegrate_mon(struct monst *, int, const char *);
+static void backfire(struct obj *);
+static int zap_ok(struct obj *);
+static void boxlock_invent(struct obj *);
+static int spell_hit_bonus(int);
+static void destroy_one_item(struct obj *, int, int);
+static void wishcmdassist(int);
#define ZT_MAGIC_MISSILE (AD_MAGM - 1)
#define ZT_FIRE (AD_FIRE - 1)
/* wand discovery gets special handling when hero is blinded */
void
-learnwand(obj)
-struct obj *obj;
+learnwand(struct obj *obj)
{
/* For a wand (or wand-like tool) zapped by the player, if the
effect was observable (determined by caller; usually seen, but
/* Routines for IMMEDIATE wands and spells. */
/* bhitm: monster mtmp was hit by the effect of wand or spell otmp */
int
-bhitm(mtmp, otmp)
-struct monst *mtmp;
-struct obj *otmp;
+bhitm(struct monst *mtmp, struct obj *otmp)
{
boolean wake = TRUE; /* Most 'zaps' should wake monster */
boolean reveal_invis = FALSE, learn_it = FALSE;
}
void
-probe_monster(mtmp)
-struct monst *mtmp;
+probe_monster(struct monst *mtmp)
{
struct obj *otmp;
* is not available or subject to the constraints above.
*/
boolean
-get_obj_location(obj, xp, yp, locflags)
-struct obj *obj;
-xchar *xp, *yp;
-int locflags;
+get_obj_location(struct obj *obj, xchar *xp, xchar *yp, int locflags)
{
switch (obj->where) {
case OBJ_INVENT:
}
boolean
-get_mon_location(mon, xp, yp, locflags)
-struct monst *mon;
-xchar *xp, *yp;
-int locflags; /* non-zero means get location even if monster is buried */
+get_mon_location(struct monst *mon, xchar *xp, xchar *yp,
+ int locflags) /* non-zero means get location even if monster
+ is buried */
{
if (mon == &g.youmonst) {
*xp = u.ux;
/* used by revive() and animate_statue() */
struct monst *
-montraits(obj, cc, adjacentok)
-struct obj *obj;
-coord *cc;
-boolean adjacentok; /* False: at obj's spot only, True: nearby is allowed */
+montraits(struct obj *obj, coord *cc,
+ boolean adjacentok) /* False: at obj's spot only, True: nearby is
+ allowed */
{
struct monst *mtmp, *mtmp2 = has_omonst(obj) ? get_mtraits(obj, TRUE) : 0;
* if applicable.
*/
struct monst *
-get_container_location(obj, loc, container_nesting)
-struct obj *obj;
-int *loc;
-int *container_nesting;
+get_container_location(struct obj *obj, int *loc, int *container_nesting)
{
if (!obj || !loc)
return 0;
* and only one monster will be resurrected.
*/
struct monst *
-revive(corpse, by_hero)
-struct obj *corpse;
-boolean by_hero;
+revive(struct obj *corpse, boolean by_hero)
{
struct monst *mtmp = 0;
struct permonst *mptr;
}
static void
-revive_egg(obj)
-struct obj *obj;
+revive_egg(struct obj *obj)
{
/*
* Note: generic eggs with corpsenm set to NON_PM will never hatch.
/* try to revive all corpses and eggs carried by `mon' */
int
-unturn_dead(mon)
-struct monst *mon;
+unturn_dead(struct monst *mon)
{
struct obj *otmp, *otmp2;
struct monst *mtmp2;
}
void
-unturn_you()
+unturn_you(void)
{
(void) unturn_dead(&g.youmonst); /* hit carried corpses and eggs */
/* cancel obj, possibly carried by you or a monster */
void
-cancel_item(obj)
-register struct obj *obj;
+cancel_item(struct obj *obj)
{
int otyp = obj->otyp;
* possibly carried by you or a monster
*/
boolean
-drain_item(obj, by_you)
-struct obj *obj;
-boolean by_you;
+drain_item(struct obj *obj, boolean by_you)
{
boolean u_ring;
}
boolean
-obj_resists(obj, ochance, achance)
-struct obj *obj;
-int ochance, achance; /* percent chance for ordinary objects, artifacts */
+obj_resists(struct obj *obj,
+ int ochance, /* percent chance for ordinary objects */
+ int achance) /* percent chance for artifacts */
{
if (obj->otyp == AMULET_OF_YENDOR
|| obj->otyp == SPE_BOOK_OF_THE_DEAD
}
boolean
-obj_shudders(obj)
-struct obj *obj;
+obj_shudders(struct obj *obj)
{
int zap_odds;
* at the top of the pile.
*/
static void
-polyuse(objhdr, mat, minwt)
-struct obj *objhdr;
-int mat, minwt;
+polyuse(struct obj *objhdr, int mat, int minwt)
{
register struct obj *otmp, *otmp2;
* a golem of the kind okind.
*/
static void
-create_polymon(obj, okind)
-struct obj *obj;
-int okind;
+create_polymon(struct obj *obj, int okind)
{
struct permonst *mdat = (struct permonst *) 0;
struct monst *mtmp;
/* Assumes obj is on the floor. */
void
-do_osshock(obj)
-struct obj *obj;
+do_osshock(struct obj *obj)
{
long i;
/* Returns TRUE if obj resists polymorphing */
boolean
-obj_unpolyable(obj)
-struct obj *obj;
+obj_unpolyable(struct obj *obj)
{
return (unpolyable(obj)
|| obj == uball || obj == uskin
* This should be safe to call for an object anywhere.
*/
struct obj *
-poly_obj(obj, id)
-struct obj *obj;
-int id;
+poly_obj(struct obj *obj, int id)
{
struct obj *otmp;
xchar ox = 0, oy = 0;
/* stone-to-flesh spell hits and maybe transforms or animates obj */
static int
-stone_to_flesh_obj(obj)
-struct obj *obj;
+stone_to_flesh_obj(struct obj *obj)
{
int res = 1; /* affected object by default */
struct permonst *ptr;
* non-zero if the wand/spell had any effect.
*/
int
-bhito(obj, otmp)
-struct obj *obj, *otmp;
+bhito(struct obj *obj, struct obj *otmp)
{
int res = 1; /* affected object by default */
boolean learn_it = FALSE, maybelearnit;
/* returns nonzero if something was hit */
int
-bhitpile(obj, fhito, tx, ty, zz)
-struct obj *obj;
-int FDECL((*fhito), (OBJ_P, OBJ_P));
-int tx, ty;
-schar zz;
+bhitpile(struct obj *obj, int (*fhito)(OBJ_P, OBJ_P), int tx, int ty, schar zz)
{
int hitanything = 0;
register struct obj *otmp, *next_obj;
* added by GAN 11/03/86
*/
int
-zappable(wand)
-register struct obj *wand;
+zappable(struct obj *wand)
{
if (wand->spe < 0 || (wand->spe == 0 && rn2(121)))
return 0;
}
void
-do_enlightenment_effect()
+do_enlightenment_effect(void)
{
You_feel("self-knowledgeable...");
display_nhwindow(WIN_MESSAGE, FALSE);
* added by GAN 11/03/86
*/
void
-zapnodir(obj)
-register struct obj *obj;
+zapnodir(struct obj *obj)
{
boolean known = FALSE;
}
static void
-backfire(otmp)
-struct obj *otmp;
+backfire(struct obj *otmp)
{
int dmg;
/* getobj callback for object to zap */
static int
-zap_ok(obj)
-struct obj *obj;
+zap_ok(struct obj *obj)
{
if (obj && obj->oclass == WAND_CLASS)
return GETOBJ_SUGGEST;
/* 'z' command (or 'y' if numbed_pad==-1) */
int
-dozap()
+dozap(void)
{
struct obj *obj;
int damage, need_dir;
/* Lock or unlock all boxes in inventory */
static void
-boxlock_invent(obj)
-struct obj *obj;
+boxlock_invent(struct obj *obj)
{
struct obj *otmp;
boolean boxing = FALSE;
}
int
-zapyourself(obj, ordinary)
-struct obj *obj;
-boolean ordinary;
+zapyourself(struct obj *obj, boolean ordinary)
{
boolean learn_it = FALSE;
int damage = 0;
/* called when poly'd hero uses breath attack against self */
void
-ubreatheu(mattk)
-struct attack *mattk;
+ubreatheu(struct attack *mattk)
{
int dtyp = 20 + mattk->adtyp - 1; /* breath by hero */
const char *fltxt = flash_types[dtyp]; /* blast of <something> */
/* light damages hero in gremlin form */
int
-lightdamage(obj, ordinary, amt)
-struct obj *obj; /* item making light (fake book if spell) */
-boolean ordinary; /* wand/camera zap vs wand destruction */
-int amt; /* pseudo-damage used to determine blindness duration */
+lightdamage(struct obj *obj, /* item making light (fake book if spell) */
+ boolean ordinary, /* wand/camera zap vs wand destruction */
+ int amt) /* pseudo-damage used to determine blindness
+ duration */
{
char buf[BUFSZ];
const char *how;
/* light[ning] causes blindness */
boolean
-flashburn(duration)
-long duration;
+flashburn(long duration)
{
if (!resists_blnd(&g.youmonst)) {
You(are_blinded_by_the_flash);
* Return FALSE if the steed was not hit by the wand.
*/
static boolean
-zap_steed(obj)
-struct obj *obj; /* wand or spell */
+zap_steed(struct obj *obj) /* wand or spell */
{
int steedhit = FALSE;
* themselves with cancellation.
*/
boolean
-cancel_monst(mdef, obj, youattack, allow_cancel_kill, self_cancel)
-register struct monst *mdef;
-register struct obj *obj;
-boolean youattack, allow_cancel_kill, self_cancel;
+cancel_monst(struct monst *mdef, struct obj *obj, boolean youattack,
+ boolean allow_cancel_kill, boolean self_cancel)
{
static const char
writing_vanishes[] = "Some writing vanishes from %s head!",
/* you've zapped an immediate type wand up or down */
static boolean
-zap_updown(obj)
-struct obj *obj; /* wand or spell */
+zap_updown(struct obj *obj) /* wand or spell */
{
boolean striking = FALSE, disclose = FALSE;
int x, y, xx, yy, ptmp;
/* used by do_break_wand() was well as by weffects() */
void
-zapsetup()
+zapsetup(void)
{
g.obj_zapped = FALSE;
}
void
-zapwrapup()
+zapwrapup(void)
{
/* if do_osshock() set obj_zapped while polying, give a message now */
if (g.obj_zapped)
/* called for various wand and spell effects - M. Stephenson */
void
-weffects(obj)
-struct obj *obj;
+weffects(struct obj *obj)
{
int otyp = obj->otyp;
boolean disclose = FALSE, was_unkn = !objects[otyp].oc_name_known;
/* augment damage for a spell dased on the hero's intelligence (and level) */
int
-spell_damage_bonus(dmg)
-int dmg; /* base amount to be adjusted by bonus or penalty */
+spell_damage_bonus(int dmg) /* base amount to be adjusted by bonus or penalty */
{
int intell = ACURR(A_INT);
* spell class and dexterity.
*/
static int
-spell_hit_bonus(skill)
-int skill;
+spell_hit_bonus(int skill)
{
int hit_bon = 0;
int dex = ACURR(A_DEX);
}
const char *
-exclam(force)
-int force;
+exclam(int force)
{
/* force == 0 occurs e.g. with sleep ray */
/* note that large force is usual with wands so that !! would
}
void
-hit(str, mtmp, force)
-const char *str;
-struct monst *mtmp;
-const char *force; /* usually either "." or "!" */
+hit(const char *str, struct monst *mtmp,
+ const char *force) /* usually either "." or "!" */
{
if ((!cansee(g.bhitpos.x, g.bhitpos.y) && !canspotmon(mtmp)
&& !(u.uswallow && mtmp == u.ustuck)) || !flags.verbose)
}
void
-miss(str, mtmp)
-register const char *str;
-register struct monst *mtmp;
+miss(const char *str, struct monst *mtmp)
{
pline(
"%s %s %s.", The(str), vtense(str, "miss"),
}
static void
-skiprange(range, skipstart, skipend)
-int range, *skipstart, *skipend;
+skiprange(int range, int *skipstart, int *skipend)
{
int tr = (range / 4);
int tmp = range - ((tr > 0) ? rnd(tr) : 0);
* one is revealed for a weapon, but if not a weapon is left up to fhitm().
*/
struct monst *
-bhit(ddx, ddy, range, weapon, fhitm, fhito, pobj)
-register int ddx, ddy, range; /* direction and range */
-enum bhit_call_types weapon; /* defined in hack.h */
-int FDECL((*fhitm), (MONST_P, OBJ_P)), /* fns called when mon/obj hit */
- FDECL((*fhito), (OBJ_P, OBJ_P));
-struct obj **pobj; /* object tossed/used, set to NULL
- * if object is destroyed */
+bhit(int ddx, int ddy, int range, /* direction and range */
+ enum bhit_call_types weapon, /* defined in hack.h */
+ int (*fhitm)(MONST_P, OBJ_P), /* fns called when mon/obj hit */
+ int (*fhito)(OBJ_P, OBJ_P),
+ struct obj **pobj) /* object tossed/used, set to NULL
+ if object is destroyed */
{
struct monst *mtmp, *result = (struct monst *) 0;
struct obj *obj = *pobj;
* is too obviously silly.
*/
struct monst *
-boomhit(obj, dx, dy)
-struct obj *obj;
-int dx, dy;
+boomhit(struct obj *obj, int dx, int dy)
{
register int i, ct;
int boom; /* showsym[] index */
/* used by buzz(); also used by munslime(muse.c); returns damage applied
to mon; note: caller is responsible for killing mon if damage is fatal */
int
-zhitm(mon, type, nd, ootmp)
-register struct monst *mon;
-register int type, nd;
-struct obj **ootmp; /* to return worn armor for caller to disintegrate */
+zhitm(struct monst *mon, int type, int nd,
+ struct obj **ootmp) /* to return worn armor for caller to disintegrate */
{
register int tmp = 0;
register int abstype = abs(type) % 10;
}
static void
-zhitu(type, nd, fltxt, sx, sy)
-int type, nd;
-const char *fltxt;
-xchar sx, sy;
+zhitu(int type, int nd, const char *fltxt, xchar sx, xchar sy)
{
int dam = 0, abstyp = abs(type);
* at position x,y; return the number of objects burned
*/
int
-burn_floor_objects(x, y, give_feedback, u_caused)
-int x, y;
-boolean give_feedback; /* caller needs to decide about visibility checks */
-boolean u_caused;
+burn_floor_objects(int x, int y,
+ boolean give_feedback, /* caller needs to decide about
+ visibility checks */
+ boolean u_caused)
{
struct obj *obj, *obj2;
long i, scrquan, delquan;
/* will zap/spell/breath attack score a hit against armor class `ac'? */
static int
-zap_hit(ac, type)
-int ac;
-int type; /* either hero cast spell type or 0 */
+zap_hit(int ac,
+ int type) /* either hero cast spell type or 0 */
{
int chance = rn2(20);
int spell_bonus = type ? spell_hit_bonus(type) : 0;
}
static void
-disintegrate_mon(mon, type, fltxt)
-struct monst *mon;
-int type; /* hero vs other */
-const char *fltxt;
+disintegrate_mon(struct monst *mon,
+ int type, /* hero vs other */
+ const char *fltxt)
{
struct obj *otmp, *otmp2, *m_amulet = mlifesaver(mon);
}
void
-buzz(type, nd, sx, sy, dx, dy)
-int type, nd;
-xchar sx, sy;
-int dx, dy;
+buzz(int type, int nd, xchar sx, xchar sy, int dx, int dy)
{
dobuzz(type, nd, sx, sy, dx, dy, TRUE);
}
* called with dx = dy = 0 with vertical bolts
*/
void
-dobuzz(type, nd, sx, sy, dx, dy, say)
-register int type, nd;
-register xchar sx, sy;
-register int dx, dy;
-boolean say; /* Announce out of sight hit/miss events if true */
+dobuzz(int type, int nd, xchar sx, xchar sy, int dx, int dy,
+ boolean say) /* Announce out of sight hit/miss events if true */
{
int range, abstype = abs(type) % 10;
register xchar lsx, lsy;
}
void
-melt_ice(x, y, msg)
-xchar x, y;
-const char *msg;
+melt_ice(xchar x, xchar y, const char *msg)
{
struct rm *lev = &levl[x][y];
struct obj *otmp;
* permanent instead.
*/
void
-start_melt_ice_timeout(x, y, min_time)
-xchar x, y;
-long min_time; /* <x,y>'s old melt timeout (deleted by time we get here) */
+start_melt_ice_timeout(xchar x, xchar y,
+ long min_time) /* <x,y>'s old melt timeout (deleted by
+ time we get here) */
{
int when;
long where;
* Called when ice has melted completely away.
*/
void
-melt_ice_away(arg, timeout)
-anything *arg;
-long timeout UNUSED;
+melt_ice_away(anything *arg, long timeout UNUSED)
{
xchar x, y;
long where = arg->a_long;
* amount by which range is reduced (the latter is just ignored by fireballs)
*/
int
-zap_over_floor(x, y, type, shopdamage, exploding_wand_typ)
-xchar x, y;
-int type;
-boolean *shopdamage;
-short exploding_wand_typ;
+zap_over_floor(xchar x, xchar y, int type, boolean *shopdamage,
+ short exploding_wand_typ)
{
const char *zapverb;
struct monst *mon;
/* fractured by pick-axe or wand of striking */
void
-fracture_rock(obj)
-register struct obj *obj; /* no texts here! */
+fracture_rock(struct obj *obj) /* no texts here! */
{
xchar x, y;
boolean by_you = !g.context.mon_moving;
/* handle statue hit by striking/force bolt/pick-axe */
boolean
-break_statue(obj)
-register struct obj *obj;
+break_statue(struct obj *obj)
{
/* [obj is assumed to be on floor, so no get_obj_location() needed] */
struct trap *trap = t_at(obj->ox, obj->oy);
/* guts of destroy_item(), which ought to be called maybe_destroy_items();
caller must decide whether obj is eligible */
static void
-destroy_one_item(obj, osym, dmgtyp)
-struct obj *obj;
-int osym, dmgtyp;
+destroy_one_item(struct obj *obj, int osym, int dmgtyp)
{
long i, cnt, quan;
int dmg, xresist, skip, dindx;
/* target items of specified class for possible destruction */
void
-destroy_item(osym, dmgtyp)
-int osym, dmgtyp;
+destroy_item(int osym, int dmgtyp)
{
register struct obj *obj;
int i, deferral_indx = 0;
}
int
-destroy_mitem(mtmp, osym, dmgtyp)
-struct monst *mtmp;
-int osym, dmgtyp;
+destroy_mitem(struct monst *mtmp, int osym, int dmgtyp)
{
struct obj *obj;
int skip, tmp = 0;
}
int
-resist(mtmp, oclass, damage, tell)
-struct monst *mtmp;
-char oclass;
-int damage, tell;
+resist(struct monst *mtmp, char oclass, int damage, int tell)
{
int resisted;
int alev, dlev;
#define MAXWISHTRY 5
static void
-wishcmdassist(triesleft)
-int triesleft;
+wishcmdassist(int triesleft)
{
static NEARDATA const char *
wishinfo[] = {
}
void
-makewish()
+makewish(void)
{
char buf[BUFSZ] = DUMMY;
char promptbuf[BUFSZ];
#if !defined(_BULL_SOURCE) && !defined(__sgi) && !defined(_M_UNIX)
#if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__))
#if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
-extern struct passwd *FDECL(getpwuid, (uid_t));
+extern struct passwd *getpwuid(uid_t);
#else
-extern struct passwd *FDECL(getpwuid, (int));
+extern struct passwd *getpwuid, (int);
#endif
#endif
#endif
-extern struct passwd *FDECL(getpwnam, (const char *));
+extern struct passwd *getpwnam(const char *);
#ifdef CHDIR
-static void FDECL(chdirx, (const char *, BOOLEAN_P));
+static void chdirx(const char *, boolean);
#endif /* CHDIR */
-static boolean NDECL(whoami);
-static void FDECL(process_options, (int, char **));
+static boolean whoami(void);
+static void process_options(int, char **);
#ifdef _M_UNIX
-extern void NDECL(check_sco_console);
-extern void NDECL(init_sco_cons);
+extern void check_sco_console(void);
+extern void init_sco_cons(void);
#endif
#ifdef __linux__
-extern void NDECL(check_linux_console);
-extern void NDECL(init_linux_cons);
+extern void check_linux_console(void);
+extern void init_linux_cons(void);
#endif
-static void NDECL(wd_message);
+static void wd_message(void);
static boolean wiz_error_flag = FALSE;
-static struct passwd *NDECL(get_unix_pw);
+static struct passwd *get_unix_pw(void);
#ifdef __EMSCRIPTEN__
/* if WebAssembly, export this API and don't optimize it out */
EMSCRIPTEN_KEEPALIVE
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
#else /* !__EMSCRIPTEN__ */
int
-nhmain(argc, argv)
-int argc;
-char *argv[];
+nhmain(int argc, char *argv[])
#endif /* __EMSCRIPTEN__ */
{
/* caveat: argv elements might be arbitrary long */
static void
-process_options(argc, argv)
-int argc;
-char *argv[];
+process_options(int argc, char *argv[])
{
int i, l;
#ifdef CHDIR
static void
-chdirx(dir, wr)
-const char *dir;
-boolean wr;
+chdirx(const char *dir, boolean wr)
{
if (dir /* User specified directory? */
#ifdef HACKDIR
/* returns True iff we set plname[] to username which contains a hyphen */
static boolean
-whoami()
+whoami(void)
{
/*
* Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS
#ifndef NO_SIGNAL
void
-sethanguphandler(handler)
-void FDECL((*handler), (int));
+sethanguphandler(void (*handler)(int))
{
#ifdef SA_RESTART
/* don't want reads to restart. If SA_RESTART is defined, we know
#ifdef PORT_HELP
void
-port_help()
+port_help(void)
{
/*
* Display unix-specific help. Just show contents of the helpfile
/* validate wizard mode if player has requested access to it */
boolean
-authorize_wizard_mode()
+authorize_wizard_mode(void)
{
struct passwd *pw = get_unix_pw();
}
static void
-wd_message()
+wd_message(void)
{
if (wiz_error_flag) {
if (sysopt.wizards && sysopt.wizards[0]) {
* be room for the /
*/
void
-append_slash(name)
-char *name;
+append_slash(char *name)
{
char *ptr;
}
boolean
-check_user_string(optstr)
-const char *optstr;
+check_user_string(const char *optstr)
{
struct passwd *pw;
int pwlen;
}
static struct passwd *
-get_unix_pw()
+get_unix_pw(void)
{
char *user;
unsigned uid;
}
char *
-get_login_name()
+get_login_name(void)
{
static char buf[BUFSZ];
struct passwd *pw = get_unix_pw();
}
unsigned long
-sys_random_seed()
+sys_random_seed(void)
{
unsigned long seed = 0L;
unsigned long pid = (unsigned long) getpid();
#define GETKEYFLAGS 0x02 /* Get Keyboard Flags */
/*#define KEY_DEBUG */ /* print values of unexpected key codes - devel*/
-void FDECL(get_cursor, (int *, int *));
+void get_cursor(int *, int *);
/* direct bios calls are used only when iflags.BIOS is set */
-static char NDECL(DOSgetch);
-static char NDECL(BIOSgetch);
+static char DOSgetch(void);
+static char BIOSgetch(void);
+/* static long freediskspace(char *path); */
+unsigned long sys_random_seed(void);
+
#ifndef __GO32__
-static char *NDECL(getdta);
+static char *getdta(void);
#endif
-static unsigned int FDECL(dos_ioctl, (int, int, unsigned));
+static unsigned int dos_ioctl(int, int, unsigned);
#ifdef USE_TILES
-extern boolean FDECL(pckeys, (unsigned char, unsigned char)); /* pckeys.c */
+extern boolean pckeys(unsigned char, unsigned char); /* pckeys.c */
#endif
int
-tgetch()
+tgetch(void)
{
char ch;
#endif /* PC9800 */
static char
-BIOSgetch()
+BIOSgetch(void)
{
unsigned char scan, shift, ch = 0;
const struct pad *kpad;
}
static char
-DOSgetch()
+DOSgetch(void)
{
union REGS regs;
char ch;
}
char
-switchar()
+switchar(void)
{
union REGS regs;
return regs.h.dl;
}
-long
-freediskspace(path)
-char *path;
+#if 0
+static long
+freediskspace(char *path)
{
union REGS regs;
else
return ((long) regs.x.bx * regs.x.cx * regs.x.ax);
}
+#endif /* 0 */
#ifndef __GO32__
/*
* Functions to get filenames using wildcards
*/
int
-findfirst_file(path)
-char *path;
+findfirst_file(char *path)
{
union REGS regs;
struct SREGS sregs;
}
int
-findnext_file()
+findnext_file(void)
{
union REGS regs;
}
char *
-foundfile_buffer()
+foundfile_buffer(void)
{
return (getdta() + 30);
}
/* Get disk transfer area */
static char *
-getdta()
+getdta(void)
{
union REGS regs;
struct SREGS sregs;
}
long
-filesize_nh(file)
-char *file;
+filesize_nh(char *file)
{
char *dta;
* Chdrive() changes the default drive.
*/
void
-chdrive(str)
-char *str;
+chdrive(char *str)
{
#define SELECTDISK 0x0E
char *ptr;
static unsigned int old_stdin, old_stdout;
void
-disable_ctrlP()
+disable_ctrlP(void)
{
if (!iflags.rawio)
return;
}
void
-enable_ctrlP()
+enable_ctrlP(void)
{
if (!iflags.rawio)
return;
}
static unsigned int
-dos_ioctl(handle, mode, setvalue)
-int handle, mode;
-unsigned setvalue;
+dos_ioctl(int handle, int mode, unsigned setvalue)
{
union REGS regs;
}
unsigned long
-sys_random_seed(VOID_ARGS)
+sys_random_seed(void)
{
unsigned long ourseed = 0UL;
time_t datetime = 0;
#include "wintty.h"
#include "pcvideo.h"
-boolean FDECL(pckeys, (unsigned char, unsigned char));
-static void FDECL(userpan, (BOOLEAN_P));
-static void FDECL(overview, (BOOLEAN_P));
-static void FDECL(traditional, (BOOLEAN_P));
-static void NDECL(refresh);
+boolean pckeys(unsigned char, unsigned char);
+static void userpan(boolean);
+static void overview(boolean);
+static void traditional(boolean);
+static void refresh(void);
extern struct WinDesc *wins[MAXWIN]; /* from wintty.c */
extern boolean inmap; /* from video.c */
*
*/
boolean
-pckeys(scancode, shift)
-unsigned char scancode;
-unsigned char shift;
+pckeys(unsigned char scancode, unsigned char shift)
{
boolean opening_dialog;
}
static void
-userpan(on)
-boolean on;
+userpan(boolean on)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
}
static void
-overview(on)
-boolean on;
+overview(boolean on)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
}
static void
-traditional(on)
-boolean on;
+traditional(boolean on)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
}
static void
-refresh()
+refresh(void)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
*
*/
int
-ReadTileFileHeader(tibhdr, filestyle)
-struct tibhdr_struct *tibhdr;
-boolean filestyle;
+ReadTileFileHeader(struct tibhdr_struct *tibhdr, boolean filestyle)
{
FILE *x;
x = filestyle ? tilefile_O : tilefile;
*
*/
int
-OpenTileFile(tilefilename, filestyle)
-char *tilefilename;
-boolean filestyle;
+OpenTileFile(char *tilefilename, boolean filestyle)
{
#ifdef TILES_IN_RAM
int k;
}
void
-CloseTileFile(filestyle)
-boolean filestyle;
+CloseTileFile(boolean filestyle)
{
fclose(filestyle ? tilefile_O : tilefile);
#ifdef TILES_IN_RAM
*/
#ifdef PLANAR_FILE
int
-ReadPlanarTileFile(tilenum, gp)
-int tilenum;
-struct planar_cell_struct **gp;
+ReadPlanarTileFile(int tilenum, struct planar_cell_struct **gp)
{
long fpos;
return 0;
}
int
-ReadPlanarTileFile_O(tilenum, gp)
-int tilenum;
-struct overview_planar_cell_struct **gp;
+ReadPlanarTileFile_O(int tilenum, struct overview_planar_cell_struct **gp)
{
long fpos;
#ifdef PACKED_FILE
int
-ReadPackedTileFile(tilenum, pta)
-int tilenum;
-char (*pta)[TILE_X];
+ReadPackedTileFile(int tilenum, char (*pta)[TILE_X])
{
long fpos;
* char packtile[TILE_Y][TILE_X];
*/
-extern void FDECL(CloseTileFile, (BOOLEAN_P));
-extern int FDECL(OpenTileFile, (char *, BOOLEAN_P));
-extern int FDECL(ReadTileFileHeader, (struct tibhdr_struct *, BOOLEAN_P));
+extern void CloseTileFile(boolean);
+extern int OpenTileFile(char *, boolean);
+extern int ReadTileFileHeader(struct tibhdr_struct *, boolean);
#ifdef PLANAR_FILE
#ifdef SCREEN_VGA
-extern int FDECL(ReadPlanarTileFile, (int, struct planar_cell_struct **));
-extern int FDECL(ReadPlanarTileFile_O,
- (int, struct overview_planar_cell_struct **));
+extern int ReadPlanarTileFile(int, struct planar_cell_struct **);
+extern int ReadPlanarTileFile_O(int, struct overview_planar_cell_struct **);
#endif
#endif
#ifdef PACKED_FILE
-extern int FDECL(ReadPackedTileFile, (int, char (*)[TILE_X]));
+extern int ReadPackedTileFile(int, char (*)[TILE_X]);
#endif
extern short glyph2tile[MAX_GLYPH]; /* in tile.c (made from tilemap.c) */
#endif
#ifdef SCREEN_DJGPPFAST
-/*# define MONO_CHECK /* djgpp should be able to do check */
+/*# define MONO_CHECK */ /* djgpp should be able to do check */
#endif
/*
* VGA Specific Stuff
*/
#ifdef SCREEN_VGA
-/* #define HW_PANNING /* Hardware panning enabled */
+/* #define HW_PANNING */ /* Hardware panning enabled */
#define USHORT unsigned short
#define MODE640x480 0x0012 /* Switch to VGA 640 x 480 Graphics mode */
#define MODETEXT 0x0003 /* Switch to Text mode 3 */
#ifdef HW_PANNING
#define PIXELINC 16 /* How much to increment by when panning */
-/*#define PIXELINC 1 /* How much to increment by when panning */
+/*#define PIXELINC 1 */ /* How much to increment by when panning */
#define SCREENBYTES 128
#define CharRows 30
#define VERT_RETRACE \
*
*/
-#define E extern
-
/* ### video.c ### */
#ifdef SIMULATE_CURSOR
-E void NDECL(DrawCursor);
-E void NDECL(HideCursor);
+extern void DrawCursor(void);
+extern void HideCursor(void);
#endif
/* ### vidtxt.c ### */
#ifdef NO_TERMS
-E void NDECL(txt_backsp);
-E void NDECL(txt_clear_screen);
-E void FDECL(txt_cl_end, (int, int));
-E void NDECL(txt_cl_eos);
-E void NDECL(txt_get_scr_size);
-E void FDECL(txt_gotoxy, (int, int));
-E int NDECL(txt_monoadapt_check);
-E void NDECL(txt_nhbell);
-E void FDECL(txt_startup, (int *, int *));
-E void FDECL(txt_xputs, (const char *, int, int));
-E void FDECL(txt_xputc, (CHAR_P, int));
+extern void txt_backsp(void);
+extern void txt_clear_screen(void);
+extern void txt_cl_end(int, int);
+extern void txt_cl_eos(void);
+extern void txt_get_scr_size(void);
+extern void txt_gotoxy(int, int);
+extern int txt_monoadapt_check(void);
+extern void txt_nhbell(void);
+extern void txt_startup(int *, int *);
+extern void txt_xputs(const char *, int, int);
+extern void txt_xputc(char, int);
/* ### vidvga.c ### */
enum vga_pan_direction { pan_left, pan_up, pan_right, pan_down };
#ifdef SCREEN_VGA
-E void NDECL(vga_backsp);
-E void FDECL(vga_clear_screen, (int));
-E void FDECL(vga_cl_end, (int, int));
-E void FDECL(vga_cl_eos, (int));
-E int NDECL(vga_detect);
+extern void vga_backsp(void);
+extern void vga_clear_screen(int);
+extern void vga_cl_end(int, int);
+extern void vga_cl_eos(int);
+extern int vga_detect(void);
#ifdef SIMULATE_CURSOR
-E void NDECL(vga_DrawCursor);
+extern void vga_DrawCursor(void);
#endif
-E void NDECL(vga_Finish);
-E char __far *NDECL(vga_FontPtrs);
-E void NDECL(vga_get_scr_size);
-E void FDECL(vga_gotoloc, (int, int));
+extern void vga_Finish(void);
+extern char __far *vga_FontPtrs(void);
+extern void vga_get_scr_size(void);
+extern void vga_gotoloc(int, int);
#ifdef POSITIONBAR
-E void FDECL(vga_update_positionbar, (char *));
+extern void vga_update_positionbar(char *);
#endif
#ifdef SIMULATE_CURSOR
-E void NDECL(vga_HideCursor);
+extern void vga_HideCursor(void);
#endif
-E void NDECL(vga_Init);
-E void NDECL(vga_tty_end_screen);
-E void FDECL(vga_tty_startup, (int *, int *));
-E void FDECL(vga_xputs, (const char *, int, int));
-E void FDECL(vga_xputc, (CHAR_P, int));
-E void FDECL(vga_xputg, (int, int, unsigned));
-E void FDECL(vga_userpan, (enum vga_pan_direction));
-E void FDECL(vga_overview, (BOOLEAN_P));
-E void FDECL(vga_traditional, (BOOLEAN_P));
-E void NDECL(vga_refresh);
+extern void vga_Init(void);
+extern void vga_tty_end_screen(void);
+extern void vga_tty_startup(int *, int *);
+extern void vga_xputs(const char *, int, int);
+extern void vga_xputc(char, int);
+extern void vga_xputg(int, int, unsigned);
+extern void vga_userpan(enum vga_pan_direction);
+extern void vga_overview(boolean);
+extern void vga_traditional(boolean);
+extern void vga_refresh(void);
#endif /* SCREEN_VGA */
#ifdef SCREEN_VESA
-E void NDECL(vesa_backsp);
-E void FDECL(vesa_clear_screen, (int));
-E void FDECL(vesa_cl_end, (int, int));
-E void FDECL(vesa_cl_eos, (int));
-E int NDECL(vesa_detect);
+extern void vesa_backsp(void);
+extern void vesa_clear_screen(int);
+extern void vesa_cl_end(int, int);
+extern void vesa_cl_eos(int);
+extern int vesa_detect(void);
#ifdef SIMULATE_CURSOR
-E void NDECL(vesa_DrawCursor);
+extern void vesa_DrawCursor(void);
#endif
-E void NDECL(vesa_Finish);
-E void NDECL(vesa_get_scr_size);
-E void FDECL(vesa_gotoloc, (int, int));
+extern void vesa_Finish(void);
+extern void vesa_get_scr_size(void);
+extern void vesa_gotoloc(int, int);
#ifdef POSITIONBAR
-E void FDECL(vesa_update_positionbar, (char *));
+extern void vesa_update_positionbar(char *);
#endif
#ifdef SIMULATE_CURSOR
-E void NDECL(vesa_HideCursor);
+extern void vesa_HideCursor(void);
#endif
-E void NDECL(vesa_Init);
-E void NDECL(vesa_tty_end_screen);
-E void FDECL(vesa_tty_startup, (int *, int *));
-E void FDECL(vesa_xputs, (const char *, int, int));
-E void FDECL(vesa_xputc, (CHAR_P, int));
-E void FDECL(vesa_xputg, (int, int, unsigned));
-E void FDECL(vesa_userpan, (enum vga_pan_direction));
-E void FDECL(vesa_overview, (BOOLEAN_P));
-E void FDECL(vesa_traditional, (BOOLEAN_P));
-E void NDECL(vesa_refresh);
-E void NDECL(vesa_flush_text);
+extern void vesa_Init(void);
+extern void vesa_tty_end_screen(void);
+extern void vesa_tty_startup(int *, int *);
+extern void vesa_xputs(const char *, int, int);
+extern void vesa_xputc(char, int);
+extern void vesa_xputg(int, int, unsigned);
+extern void vesa_userpan(enum vga_pan_direction);
+extern void vesa_overview(boolean);
+extern void vesa_traditional(boolean);
+extern void vesa_refresh(void);
+extern void vesa_flush_text(void);
#endif /* SCREEN_VESA */
#endif /* NO_TERMS */
-#undef E
-
#endif /* PCVIDEO_H */
/* pcvideo.h */
#undef PACKED_FILE
#endif
-extern char *FDECL(tilename, (int, int));
+extern char *tilename(int, int);
#ifdef PLANAR_FILE
char masktable[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
pixel pixels[TILE_Y][TILE_X];
struct tibhdr_struct tibheader;
-static void FDECL(write_tibtile, (int));
-static void FDECL(write_tibheader, (FILE *, struct tibhdr_struct *));
-static void FDECL(build_tibtile, (pixel(*) [TILE_X], BOOLEAN_P));
-static void NDECL(remap_colors);
+static void write_tibtile(int);
+static void write_tibheader(FILE *, struct tibhdr_struct *);
+static void build_tibtile(pixel(*) [TILE_X], boolean);
+static void remap_colors(void);
#ifndef OVERVIEW_FILE
char *tilefiles[] = { "../win/share/monsters.txt", "../win/share/objects.txt",
int paletteflag;
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
int i;
struct tm *newtime;
}
static void
-write_tibheader(fileptr, tibhdr)
-FILE *fileptr;
-struct tibhdr_struct *tibhdr;
+write_tibheader(FILE *fileptr, struct tibhdr_struct *tibhdr)
{
if (fseek(fileptr, 0L, SEEK_SET)) {
Fprintf(stderr, "Error writing header to tile file\n");
}
static void
-build_tibtile(pixels, statues)
-pixel (*pixels)[TILE_X];
-boolean statues;
+build_tibtile(pixel (*pixels)[TILE_X], boolean statues)
{
static int graymappings[] = {
/* . A B C D E F G H I J K L M N O P */
}
static void
-write_tibtile(recnum)
-int recnum;
+write_tibtile(int recnum)
{
long fpos;
}
static void
-remap_colors()
+remap_colors(void)
{
char swap;
*/
void
-get_scr_size()
+get_scr_size(void)
{
#ifdef SCREEN_VGA
if (iflags.usevga) {
#endif
#ifdef SCREEN_BIOS
-void FDECL(get_cursor, (int *, int *));
+void get_cursor(int *, int *);
#endif
-void FDECL(adjust_cursor_flags, (struct WinDesc *));
-void FDECL(cmov, (int, int));
-void FDECL(nocmov, (int, int));
-static void NDECL(init_ttycolor);
+void adjust_cursor_flags(struct WinDesc *);
+void cmov(int, int);
+void nocmov(int, int);
+static void init_ttycolor(void);
int savevmode; /* store the original video mode in here */
int curcol, currow; /* graphics mode current cursor locations */
#endif /* TEXTCOLOR */
void
-backsp()
+backsp(void)
{
if (!iflags.grmode) {
txt_backsp();
}
void
-clear_screen()
+clear_screen(void)
{
if (!iflags.grmode) {
txt_clear_screen();
}
}
-void cl_end() /* clear to end of line */
+void cl_end(void) /* clear to end of line */
{
int col, row;
tty_curs(BASE_WINDOW, (int) ttyDisplay->curx + 1, (int) ttyDisplay->cury);
}
-void cl_eos() /* clear to end of screen */
+void cl_eos(void) /* clear to end of screen */
{
int cy = (int) ttyDisplay->cury + 1;
}
void
-cmov(col, row)
-register int col, row;
+cmov(int col, int row)
{
ttyDisplay->cury = (uchar) row;
ttyDisplay->curx = (uchar) col;
#endif
void
-home()
+home(void)
{
tty_curs(BASE_WINDOW, 1, 0);
ttyDisplay->curx = ttyDisplay->cury = (uchar) 0;
}
void
-nocmov(col, row)
-int col, row;
+nocmov(int col, int row)
{
if (!iflags.grmode) {
txt_gotoxy(col, row);
}
void
-standoutbeg()
+standoutbeg(void)
{
g_attribute = iflags.grmode ? attrib_gr_intense : attrib_text_intense;
}
void
-standoutend()
+standoutend(void)
{
g_attribute = iflags.grmode ? attrib_gr_normal : attrib_text_normal;
}
}
void
-tty_delay_output()
+tty_delay_output(void)
{
#ifdef TIMED_DELAY
if (flags.nap) {
}
void
-tty_end_screen()
+tty_end_screen(void)
{
if (!iflags.grmode) {
txt_clear_screen();
}
void
-tty_nhbell()
+tty_nhbell(void)
{
txt_nhbell();
}
void
-tty_number_pad(state)
-int state;
+tty_number_pad(int state)
{
++state; /* prevents compiler warning (unref. param) */
}
void
-tty_startup(wid, hgt)
-int *wid, *hgt;
+tty_startup(int *wid, int *hgt)
{
/* code to sense display adapter is required here - MJA */
}
void
-tty_start_screen()
+tty_start_screen(void)
{
#ifdef PC9800
fputs("\033[>1h", stdout);
}
void
-gr_init()
+gr_init(void)
{
#ifdef SCREEN_VGA
if (iflags.usevga) {
}
void
-gr_finish()
+gr_finish(void)
{
if (iflags.grmode) {
#ifdef SCREEN_VGA
*/
void
-xputs(s)
-const char *s;
+xputs(const char *s)
{
int col, row;
/* same signature as 'putchar()' with potential failure result ignored */
int
-xputc(ch) /* write out character (and attribute) */
-int ch;
+xputc(int ch) /* write out character (and attribute) */
{
int i;
char attribute;
}
/* write out a glyph picture at current location */
-void xputg(glyphnum, ch, special)
-int glyphnum;
-int ch;
-unsigned special;
+void xputg(int glyphnum, int ch, unsigned special)
{
if (!iflags.grmode || !iflags.tile_view) {
(void) xputc((char) ch);
#ifdef POSITIONBAR
void
-video_update_positionbar(posbar)
-char *posbar;
+video_update_positionbar(char *posbar)
{
if (!iflags.grmode)
return;
#endif
void
-adjust_cursor_flags(cw)
-struct WinDesc *cw;
+adjust_cursor_flags(struct WinDesc *cw)
{
#ifdef SIMULATE_CURSOR
#if 0
/* The check for iflags.grmode is made BEFORE calling these. */
void
-DrawCursor()
+DrawCursor(void)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
}
void
-HideCursor()
+HideCursor(void)
{
#ifdef SCREEN_VGA
if (iflags.usevga)
int shadeflag; /* shades are initialized */
int colorflag; /* colors are initialized */
-char *schoice[3] = { "dark", "normal", "light" };
-char *shade[3];
+const char *schoice[3] = { "dark", "normal", "light" };
+const char *shade[3];
#endif /* VIDEOSHADES */
static void
-init_ttycolor()
+init_ttycolor(void)
{
#ifdef VIDEOSHADES
if (!shadeflag) {
#endif
}
-static int FDECL(convert_uchars, (char *, uchar *, int));
+static int convert_uchars(char *, uchar *, int);
#ifdef VIDEOSHADES
int
assign_videoshades(char *choiceptr)
}
static int
-convert_uchars(bufp, list, size)
-char *bufp; /* current pointer */
-uchar *list; /* return list */
-int size;
+convert_uchars(char *bufp, /* current pointer */
+ uchar *list, /* return list */
+ int size)
{
unsigned int num = 0;
int count = 0;
* vga (use vga adapter code)
*/
int
-assign_video(sopt)
-char *sopt;
+assign_video(char *sopt)
{
/*
* debug
}
void
-tileview(enable)
-boolean enable;
+tileview(boolean enable)
{
#ifdef SCREEN_VGA
if (iflags.grmode && iflags.usevga)
#else /* STUBVIDEO */
void
-tileview(enable)
-boolean enable;
+tileview(boolean enable)
{
}
#endif /* STUBVIDEO */
#if _MSC_VER >= 700
#pragma warning(disable : 4018) /* signed/unsigned mismatch */
#pragma warning(disable : 4127) /* conditional expression is constant */
-#pragma warning(disable : 4131) /* old style declarator */
+/* #pragma warning(disable : 4131) */ /* old style declarator */
#pragma warning(disable : 4305) /* prevents complaints with MK_FP */
#pragma warning(disable : 4309) /* initializing */
#pragma warning(disable : 4759) /* prevents complaints with MK_FP */
#endif
#endif
-/* void FDECL(txt_xputc,(char, int)); */ /* write out character (and
+/* void txt_xputc(char, int);*/ /* write out character (and
attribute) */
extern int attrib_text_normal; /* text mode normal attribute */
extern int attrib_gr_intense; /* graphics mode intense attribute */
void
-txt_get_scr_size()
+txt_get_scr_size(void)
{
union REGS regs;
#include <unistd.h>
#endif
-void FDECL(txt_gotoxy, (int, int));
+void txt_gotoxy(int, int);
#if defined(SCREEN_BIOS) && !defined(PC9800)
-void FDECL(txt_get_cursor, (int *, int *));
+void txt_get_cursor(int *, int *);
#endif
#ifdef SCREEN_DJGPPFAST
extern int monoflag; /* 0 = not monochrome, else monochrome */
void
-txt_backsp()
+txt_backsp(void)
{
#ifdef PC9800
union REGS regs;
}
void
-txt_nhbell()
+txt_nhbell(void)
{
union REGS regs;
}
void
-txt_clear_screen()
+txt_clear_screen(void)
/* djgpp provides ScreenClear(), but in version 1.09 it is broken
* so for now we just use the BIOS Routines
*/
#endif
}
-void txt_cl_end(col, row) /* clear to end of line */
-int col, row;
+/* clear to end of line */
+void txt_cl_end(int col, int row)
{
union REGS regs;
#ifndef PC9800
#endif
}
-void txt_cl_eos() /* clear to end of screen */
+void txt_cl_eos(void) /* clear to end of screen */
{
union REGS regs;
#ifndef PC9800
}
void
-txt_startup(wid, hgt)
-int *wid, *hgt;
+txt_startup(int *wid, int *hgt)
{
txt_get_scr_size();
*wid = CO;
*/
void
-txt_xputs(s, col, row)
-const char *s;
-int col, row;
+txt_xputs(const char *s, int col, int row)
{
char c;
}
}
-void txt_xputc(ch, attr) /* write out character (and attribute) */
-char ch;
-int attr;
+/* write out character (and attribute) */
+void txt_xputc(char ch, int attr)
{
#ifdef PC9800
union REGS regs;
#if defined(SCREEN_BIOS) && !defined(PC9800)
/*
+ * get cursor position
+ *
* This is implemented as a macro under DJGPPFAST.
*/
-void txt_get_cursor(x, y) /* get cursor position */
-int *x, *y;
+void txt_get_cursor(int *x, int *y)
{
union REGS regs;
#endif /* SCREEN_BIOS && !PC9800 */
void
-txt_gotoxy(x, y)
-int x, y;
+txt_gotoxy(int x, int y)
{
#ifdef SCREEN_BIOS
union REGS regs;
#ifdef MONO_CHECK
int
-txt_monoadapt_check()
+txt_monoadapt_check(void)
{
union REGS regs;
int chr;
};
-static unsigned long FDECL(vesa_SetWindow, (int window, unsigned long offset));
-static unsigned long FDECL(vesa_ReadPixel32, (unsigned x, unsigned y));
-static void FDECL(vesa_WritePixel32, (unsigned x, unsigned y,
- unsigned long color));
-static void FDECL(vesa_WritePixel, (unsigned x, unsigned y, unsigned color));
-static void FDECL(vesa_WritePixelRow, (unsigned long offset,
- unsigned char const *p_row, unsigned p_row_size));
-static unsigned long FDECL(vesa_MakeColor, (struct Pixel));
-static void FDECL(vesa_FillRect, (
- unsigned left, unsigned top,
- unsigned width, unsigned height,
- unsigned color));
-
-static void NDECL(vesa_redrawmap);
-static void FDECL(vesa_cliparound, (int, int));
+static unsigned long vesa_SetWindow(int window, unsigned long offset);
+static unsigned long vesa_ReadPixel32(unsigned x, unsigned y);
+static void vesa_WritePixel32(unsigned x, unsigned y, unsigned long color);
+static void vesa_WritePixel(unsigned x, unsigned y, unsigned color);
+static void vesa_WritePixelRow(unsigned long offset,
+ unsigned char const *p_row, unsigned p_row_size);
+static unsigned long vesa_MakeColor(struct Pixel);
+static void vesa_FillRect(unsigned left, unsigned top, unsigned width,
+ unsigned height, unsigned color);
+
+static void vesa_redrawmap(void);
+static void vesa_cliparound(int, int);
#if 0
-static void FDECL(decal_packed, (const struct TileImage *tile, unsigned special));
+static void decal_packed(const struct TileImage *tile, unsigned special);
#endif
-static void FDECL(vesa_SwitchMode, (unsigned mode));
-static void NDECL(vesa_SetViewPort);
-static boolean FDECL(vesa_SetPalette, (const struct Pixel *));
-static boolean FDECL(vesa_SetHardPalette, (const struct Pixel *));
-static boolean FDECL(vesa_SetSoftPalette, (const struct Pixel *));
-static void FDECL(vesa_DisplayCell, (int, int, int));
-static unsigned FDECL(vesa_FindMode, (unsigned long mode_addr, unsigned bits));
-static void FDECL(vesa_WriteChar, (int, int, int, int));
-static void FDECL(vesa_WriteCharXY, (int, int, int, int));
-static void FDECL(vesa_WriteCharTransparent, (int, int, int, int));
-static void FDECL(vesa_WriteTextRow, (int pixx, int pixy,
- struct VesaCharacter const *t_row, unsigned t_row_width));
-static boolean FDECL(vesa_GetCharPixel, (int, unsigned, unsigned));
-static unsigned char FDECL(vesa_GetCharPixelRow, (int, unsigned, unsigned));
-static unsigned long FDECL(vesa_DoublePixels, (unsigned long));
-static unsigned long FDECL(vesa_TriplePixels, (unsigned long));
-static void FDECL(vesa_WriteStr, (const char *, int, int, int, int));
-static unsigned char __far *NDECL(vesa_FontPtrs);
-static void FDECL(vesa_process_tile, (struct TileImage *tile));
+static void vesa_SwitchMode(unsigned mode);
+static void vesa_SetViewPort(void);
+static boolean vesa_SetPalette(const struct Pixel *);
+static boolean vesa_SetHardPalette(const struct Pixel *);
+static boolean vesa_SetSoftPalette(const struct Pixel *);
+static void vesa_DisplayCell(int, int, int);
+static unsigned vesa_FindMode(unsigned long mode_addr, unsigned bits);
+static void vesa_WriteChar(int, int, int, int);
+static void vesa_WriteCharXY(int, int, int, int);
+static void vesa_WriteCharTransparent(int, int, int, int);
+static void vesa_WriteTextRow(int pixx, int pixy,
+ struct VesaCharacter const *t_row, unsigned t_row_width);
+static boolean vesa_GetCharPixel(int, unsigned, unsigned);
+static unsigned char vesa_GetCharPixelRow(int, unsigned, unsigned);
+static unsigned long vesa_DoublePixels(unsigned long);
+static unsigned long vesa_TriplePixels(unsigned long);
+static void vesa_WriteStr(const char *, int, int, int, int);
+static unsigned char __far *vesa_FontPtrs(void);
+/* static void vesa_process_tile(struct TileImage *tile); */
#ifdef POSITIONBAR
-static void NDECL(positionbar);
+static void positionbar(void);
#endif
extern int clipx, clipxmax; /* current clipping column from wintty.c */
/* Retrieve the mode info block */
static boolean
-vesa_GetModeInfo(mode, info)
-unsigned mode;
-struct ModeInfoBlock *info;
+vesa_GetModeInfo(unsigned mode, struct ModeInfoBlock *info)
{
int mode_info_sel = -1; /* custodial */
int mode_info_seg;
/* Set the memory window and return the offset */
static unsigned long
-vesa_SetWindow(window, offset)
-int window;
-unsigned long offset;
+vesa_SetWindow(int window, unsigned long offset)
{
/* If the desired offset is already within the window, leave the window
as it is and return the address based on the current window position.
}
static unsigned long
-vesa_ReadPixel32(x, y)
-unsigned x, y;
+vesa_ReadPixel32(unsigned x, unsigned y)
{
unsigned long offset = y * vesa_scan_line + x * vesa_pixel_bytes;
unsigned long addr, color;
}
static void
-vesa_WritePixel32(x, y, color)
-unsigned x, y;
-unsigned long color;
+vesa_WritePixel32(unsigned x, unsigned y, unsigned long color)
{
unsigned long offset = y * vesa_scan_line + x * vesa_pixel_bytes;
unsigned long addr;
}
static void
-vesa_WritePixel(x, y, color)
-unsigned x, y;
-unsigned color;
+vesa_WritePixel(unsigned x, unsigned y, unsigned color)
{
if (vesa_pixel_size == 8) {
vesa_WritePixel32(x, y, color);
}
static void
-vesa_WritePixelRow(offset, p_row, p_row_size)
-unsigned long offset;
-unsigned char const *p_row;
-unsigned p_row_size;
+vesa_WritePixelRow(unsigned long offset,
+ unsigned char const *p_row, unsigned p_row_size)
{
if (vesa_segment != 0) {
/* Linear frame buffer in use */
}
static unsigned long
-vesa_MakeColor(p)
-struct Pixel p;
+vesa_MakeColor(struct Pixel p)
{
unsigned long r = p.r >> vesa_red_shift;
- unsigned long g = p.g >> vesa_green_shift;
+ unsigned long gr = p.g >> vesa_green_shift;
unsigned long b = p.b >> vesa_blue_shift;
return (r << vesa_red_pos)
- | (g << vesa_green_pos)
+ | (gr << vesa_green_pos)
| (b << vesa_blue_pos);
}
static void
-vesa_FillRect(left, top, width, height, color)
-unsigned left, top, width, height, color;
+vesa_FillRect(unsigned left, unsigned top, unsigned width,
+ unsigned height, unsigned color)
{
unsigned p_row_size = width * vesa_pixel_bytes;
unsigned char *p_row = (unsigned char *) alloc(p_row_size);
}
void
-vesa_get_scr_size()
+vesa_get_scr_size(void)
{
CO = vesa_x_res / vesa_char_width;
LI = vesa_y_res / vesa_char_height - 1;
}
void
-vesa_backsp()
+vesa_backsp(void)
{
int col, row;
}
void
-vesa_clear_screen(colour)
-int colour;
+vesa_clear_screen(int colour)
{
vesa_FillRect(0, 0, vesa_x_res, vesa_y_res, colour);
if (iflags.tile_view)
/* clear to end of line */
void
-vesa_cl_end(col, row)
-int col, row;
+vesa_cl_end(int col, int row)
{
unsigned left = vesa_x_center + col * vesa_char_width;
unsigned top = vesa_y_center + row * vesa_char_height;
/* clear to end of screen */
void
-vesa_cl_eos(cy)
-int cy;
+vesa_cl_eos(int cy)
{
cl_end();
if (cy < LI - 1) {
}
void
-vesa_tty_end_screen()
+vesa_tty_end_screen(void)
{
vesa_clear_screen(BACKGROUND_VESA_COLOR);
vesa_SwitchMode(MODETEXT);
}
void
-vesa_tty_startup(wid, hgt)
-int *wid, *hgt;
+vesa_tty_startup(int *wid, int *hgt)
{
/* code to sense display adapter is required here - MJA */
*/
void
-vesa_xputs(s, col, row)
-const char *s;
-int col, row;
+vesa_xputs(const char *s, int col, int row)
{
if (s != NULL) {
vesa_WriteStr(s, strlen(s), col, row, g_attribute);
/* write out character (and attribute) */
void
-vesa_xputc(ch, attr)
-char ch;
-int attr;
+vesa_xputc(char ch, int attr)
{
int col, row;
#if defined(USE_TILES)
/* Place tile represent. a glyph at current location */
void
-vesa_xputg(glyphnum, ch,
- special)
-int glyphnum;
-int ch;
-unsigned special; /* special feature: corpse, invis, detected, pet, ridden -
- hack.h */
+vesa_xputg(int glyphnum, int ch,
+ unsigned special) /* special feature: corpse, invis, detected, pet, ridden -
+ hack.h */
{
int col, row;
int attr;
*/
void
-vesa_gotoloc(col, row)
-int col, row;
+vesa_gotoloc(int col, int row)
{
curcol = min(col, CO - 1); /* protection from callers */
currow = min(row, LI - 1);
#if defined(USE_TILES) && defined(CLIPPING)
static void
-vesa_cliparound(x, y)
-int x, y;
+vesa_cliparound(int x, int y)
{
int oldx = clipx, oldy = clipy;
}
static void
-vesa_redrawmap()
+vesa_redrawmap(void)
{
unsigned y_top = TOP_MAP_ROW * vesa_char_height;
unsigned y_bottom = vesa_y_res - 5 * vesa_char_height;
- unsigned x, y, cx, cy, px, py;
- unsigned long color;
+ unsigned x, y, cx, cy, py /*, px */ ;
+ /* unsigned long color; */
unsigned long offset = y_top * (unsigned long) vesa_scan_line;
unsigned char *p_row = NULL;
unsigned p_row_width;
if (iflags.traditional_view) {
/* Text mode */
y = y_top;
- for (cy = clipy; cy <= clipymax && cy < ROWNO; ++cy) {
+ for (cy = clipy; cy <= (unsigned) clipymax && cy < ROWNO; ++cy) {
struct VesaCharacter t_row[COLNO];
- for (cx = clipx; cx <= clipxmax && cx < COLNO; ++cx) {
+ for (cx = clipx; cx <= (unsigned) clipxmax && cx < COLNO; ++cx) {
t_row[cx].chr = map[cy][cx].ch;
t_row[cx].colour = map[cy][cx].attr;
}
p_row_width = iflags.wc_tile_width * vesa_pixel_bytes;
y = y_top;
- for (cy = clipy; cy <= clipymax && cy < ROWNO; ++cy) {
- for (py = 0; py < iflags.wc_tile_height; ++py) {
- for (cx = clipx; cx <= clipxmax && cx < COLNO; ++cx) {
+ for (cy = clipy; cy <= (unsigned) clipymax && cy < ROWNO; ++cy) {
+ for (py = 0; py < (unsigned) iflags.wc_tile_height; ++py) {
+ for (cx = clipx; cx <= (unsigned) clipxmax && cx < COLNO; ++cx) {
tile = vesa_tiles[glyph2tile[map[cy][cx].glyph]];
vesa_WritePixelRow(offset + p_row_width * (cx - clipx), tile + p_row_width * py, p_row_width);
}
#endif /* USE_TILES && CLIPPING */
void
-vesa_userpan(pan)
-enum vga_pan_direction pan;
+vesa_userpan(enum vga_pan_direction pan)
{
/* pline("Into userpan"); */
if (iflags.over_view || iflags.traditional_view)
}
void
-vesa_overview(on)
-boolean on;
+vesa_overview(boolean on)
{
/* vesa_HideCursor(); */
if (on) {
}
void
-vesa_traditional(on)
-boolean on;
+vesa_traditional(boolean on)
{
/* vesa_HideCursor(); */
if (on) {
}
void
-vesa_refresh()
+vesa_refresh(void)
{
positionbar();
vesa_redrawmap();
#if 0
static void
-decal_packed(gp, special)
-const struct TileImage *gp;
-unsigned special;
+decal_packed(const struct TileImage *gp, unsigned special)
{
/* FIXME: the tile array is fixed in memory and should not be changed;
if we ever implement this, we'll have to copy the pixels */
/* Set the size of the tiles for the overview mode */
vesa_oview_width = vesa_x_res / COLNO;
- if (vesa_oview_width > iflags.wc_tile_width) {
- vesa_oview_width = iflags.wc_tile_width;
+ if (vesa_oview_width > (unsigned) iflags.wc_tile_width) {
+ vesa_oview_width = (unsigned) iflags.wc_tile_width;
}
vesa_oview_height = (vesa_y_res - (TOP_MAP_ROW + 4) * vesa_char_height)
/ ROWNO;
- if (vesa_oview_height > iflags.wc_tile_height) {
- vesa_oview_height = iflags.wc_tile_height;
+ if (vesa_oview_height > (unsigned) iflags.wc_tile_height) {
+ vesa_oview_height = (unsigned) iflags.wc_tile_height;
}
/* Use the map font size to set the font size */
num_pixels = iflags.wc_tile_width * iflags.wc_tile_height;
num_oview_pixels = vesa_oview_width * vesa_oview_height;
set_tile_type(vesa_pixel_size > 8);
- for (i = 0; i < total_tiles_used; ++i) {
+ for (i = 0; i < (unsigned) total_tiles_used; ++i) {
const struct TileImage *tile = get_tile(i);
struct TileImage *ov_tile = stretch_tile(tile, vesa_oview_width, vesa_oview_height);
unsigned j;
/* Set the size of the map viewport */
static void
-vesa_SetViewPort()
+vesa_SetViewPort(void)
{
unsigned y_reserved = (TOP_MAP_ROW + 5) * vesa_char_height;
unsigned y_map = vesa_y_res - y_reserved;
*
*/
static void
-vesa_SwitchMode(mode)
-unsigned mode;
+vesa_SwitchMode(unsigned mode)
{
__dpmi_regs regs;
* returns a VbeInfoBlock describing the features of the VESA BIOS.
*/
int
-vesa_detect()
+vesa_detect(void)
{
int vbe_info_sel = -1; /* custodial */
int vbe_info_seg;
}
static unsigned
-vesa_FindMode(mode_addr, bits)
-unsigned long mode_addr;
-unsigned bits;
+vesa_FindMode(unsigned long mode_addr, unsigned bits)
{
unsigned selected_mode;
struct ModeInfoBlock mode_info0, mode_info;
*
*/
static void
-vesa_WriteChar(chr, col, row, colour)
-int chr, col, row, colour;
+vesa_WriteChar(int chr, int col, int row, int colour)
{
int pixx, pixy;
* transparency
*/
static void
-vesa_WriteCharXY(chr, pixx, pixy, colour)
-int chr, pixx, pixy, colour;
+vesa_WriteCharXY(int chr, int pixx, int pixy, int colour)
{
/* Flush if cache is full or if not contiguous to the last character */
if (chr_cache_size >= SIZE(chr_cache)) {
vesa_flush_text();
}
- if (chr_cache_size != 0 && chr_cache_lastx + vesa_char_width != pixx) {
+ if (chr_cache_size != 0 && chr_cache_lastx + vesa_char_width != (unsigned) pixx) {
vesa_flush_text();
}
- if (chr_cache_size != 0 && chr_cache_pixy != pixy) {
+ if (chr_cache_size != 0 && chr_cache_pixy != (unsigned) pixy) {
vesa_flush_text();
}
/* Add to cache and write later */
* Don't bother cacheing; only the position bar and the cursor use this
*/
static void
-vesa_WriteCharTransparent(chr, pixx, pixy, colour)
-int chr, pixx, pixy, colour;
+vesa_WriteCharTransparent(int chr, int pixx, int pixy, int colour)
{
int px, py;
- for (py = 0; py < vesa_char_height; ++py) {
- for (px = 0; px < vesa_char_width; ++px) {
+ for (py = 0; py < (int) vesa_char_height; ++py) {
+ for (px = 0; px < (int) vesa_char_width; ++px) {
if (vesa_GetCharPixel(chr, px, py)) {
vesa_WritePixel(pixx + px, pixy + py, colour + FIRST_TEXT_COLOR);
}
}
void
-vesa_flush_text()
+vesa_flush_text(void)
{
if (chr_cache_size == 0) return;
}
static void
-vesa_WriteTextRow(pixx, pixy, t_row, t_row_width)
-int pixx, pixy;
-struct VesaCharacter const *t_row;
-unsigned t_row_width;
+vesa_WriteTextRow(int pixx, int pixy, struct VesaCharacter const *t_row,
+ unsigned t_row_width)
{
int x, px, py;
unsigned i;
}
/* First loop: draw one raster line of all row entries */
- for (py = 0; py < vesa_char_height; ++py) {
+ for (py = 0; py < (int) vesa_char_height; ++py) {
/* Second loop: draw one raster line of one character */
x = 0;
for (i = 0; i < t_row_width; ++i) {
fg[3] = (pix >> 24) & 0xFF;
}
/* Third loop: draw eight pixels */
- for (px = 0; px < vesa_char_width; px += 8) {
+ for (px = 0; px < (int) vesa_char_width; px += 8) {
/* Fourth loop: draw one pixel */
int px2;
unsigned char fnt = vesa_GetCharPixelRow(chr, px, py);
}
static boolean
-vesa_GetCharPixel(ch, x, y)
-int ch;
-unsigned x, y;
+vesa_GetCharPixel(int ch, unsigned x, unsigned y)
{
unsigned x2;
unsigned char fnt;
}
static unsigned char
-vesa_GetCharPixelRow(ch, x, y)
-int ch;
-unsigned x, y;
+vesa_GetCharPixelRow(int ch, unsigned x, unsigned y)
{
unsigned x1;
unsigned char fnt;
/* Scale font pixels horizontally */
static unsigned long
-vesa_DoublePixels(fnt)
-unsigned long fnt;
+vesa_DoublePixels(unsigned long fnt)
{
static const unsigned char double_bits[] = {
0x00, 0x03, 0x0C, 0x0F,
}
static unsigned long
-vesa_TriplePixels(fnt)
-unsigned long fnt;
+vesa_TriplePixels(unsigned long fnt)
{
static const unsigned short triple_bits[] = {
00000, 00007, 00070, 00077,
*
*/
static void
-vesa_DisplayCell(tilenum, col, row)
-int tilenum;
-int col, row;
+vesa_DisplayCell(int tilenum, int col, int row)
{
unsigned char const *tile;
unsigned t_width, t_height;
unsigned char const *tptr;
- int px, py, pixx, pixy;
+ int /* px, */ py, pixx, pixy;
unsigned long offset;
unsigned p_row_width;
offset = pixy * (unsigned long)vesa_scan_line + pixx * vesa_pixel_bytes;
tptr = tile;
- for (py = 0; py < t_height; ++py) {
+ for (py = 0; py < (int) t_height; ++py) {
vesa_WritePixelRow(offset, tptr, p_row_width);
offset += vesa_scan_line;
tptr += p_row_width;
*
*/
static void
-vesa_WriteStr(s, len, col, row, colour)
-const char *s;
-int len, col, row, colour;
+vesa_WriteStr(const char *s, int len, int col, int row, int colour)
{
const unsigned char *us;
int i = 0;
*
*/
static boolean
-vesa_SetPalette(palette)
-const struct Pixel *palette;
+vesa_SetPalette(const struct Pixel *palette)
{
if (vesa_pixel_size == 8) {
return vesa_SetHardPalette(palette);
}
static boolean
-vesa_SetHardPalette(palette)
-const struct Pixel *palette;
+vesa_SetHardPalette(const struct Pixel *palette)
{
int palette_sel = -1; /* custodial */
int palette_seg;
}
static boolean
-vesa_SetSoftPalette(palette)
-const struct Pixel *palette;
+vesa_SetSoftPalette(const struct Pixel *palette)
{
const struct Pixel *p;
unsigned i;
static unsigned char pbar[COLNO];
void
-vesa_update_positionbar(posbar)
-char *posbar;
+vesa_update_positionbar(char *posbar)
{
unsigned char *p = pbar;
if (posbar)
}
static void
-positionbar()
+positionbar(void)
{
unsigned char *posbar = pbar;
int feature, ucol;
#ifdef SIMULATE_CURSOR
void
-vesa_DrawCursor()
+vesa_DrawCursor(void)
{
static boolean last_inmap = FALSE;
unsigned x, y, left, top, right, bottom, width, height;
x = min(curcol, (CO - 1)); /* protection from callers */
y = min(currow, (LI - 1)); /* protection from callers */
if (!halfwidth
- && ((x < clipx) || (x > clipxmax) || (y < clipy) || (y > clipymax)))
+ && ((x < (unsigned) clipx) || (x > (unsigned) clipxmax)
+ || (y < (unsigned) clipy) || (y > (unsigned) clipymax)))
return;
if (inmap) {
x -= clipx;
}
void
-vesa_HideCursor()
+vesa_HideCursor(void)
{
unsigned x, y, left, top, width, height;
boolean isrogue = Is_rogue_level(&u.uz);
x = min(curcol, (CO - 1)); /* protection from callers */
y = min(currow, (LI - 1)); /* protection from callers */
if (!halfwidth
- && ((x < clipx) || (x > clipxmax) || (y < clipy) || (y > clipymax)))
+ && ((x < (unsigned) clipx) || (x > (unsigned) clipxmax)
+ || (y < (unsigned) clipy)
+ || (y > (unsigned) clipymax)))
return;
if (inmap) {
x -= clipx;
#if _MSC_VER >= 700
#pragma warning(disable : 4018) /* signed/unsigned mismatch */
#pragma warning(disable : 4127) /* conditional expression is constant */
-#pragma warning(disable : 4131) /* old style declarator */
+/* #pragma warning(disable : 4131) */ /* old style declarator */
#pragma warning(disable : 4305) /* prevents complaints with MK_FP */
#pragma warning(disable : 4309) /* initializing */
#if _MSC_VER > 700
extern short glyph2tile[];
-/* static void FDECL(vga_NoBorder, (int)); */
-void FDECL(vga_gotoloc, (int, int)); /* This should be made a macro */
-void NDECL(vga_backsp);
+/* static void vga_NoBorder(int); */
+void vga_gotoloc(int, int); /* This should be made a macro */
+void vga_backsp(void);
+
#ifdef SCROLLMAP
-static void FDECL(vga_scrollmap, (BOOLEAN_P));
+static void vga_scrollmap(boolean);
#endif
-static void FDECL(vga_redrawmap, (BOOLEAN_P));
-static void FDECL(vga_cliparound, (int, int));
-static void FDECL(decal_planar, (struct planar_cell_struct *, unsigned));
+static void vga_redrawmap(boolean);
+static void vga_cliparound(int, int);
+static void decal_planar(struct planar_cell_struct *, unsigned);
#ifdef POSITIONBAR
-static void NDECL(positionbar);
-static void FDECL(vga_special, (int, int, int));
+static void positionbar(void);
+static void vga_special(int, int, int);
#endif
-static void FDECL(vga_DisplayCell, (struct planar_cell_struct *, int, int));
-static void FDECL(vga_DisplayCell_O,
- (struct overview_planar_cell_struct *, int, int));
-static void FDECL(vga_SwitchMode, (unsigned int));
-static void FDECL(vga_SetPalette, (const struct Pixel *));
-static void FDECL(vga_WriteChar, (int, int, int, int));
-static void FDECL(vga_WriteStr, (char *, int, int, int, int));
+static void vga_DisplayCell(struct planar_cell_struct *, int, int);
+static void vga_DisplayCell_O(struct overview_planar_cell_struct *, int,
+ int);
+static void vga_SwitchMode(unsigned int);
+static void vga_SetPalette(const struct Pixel *);
+static void vga_WriteChar(int, int, int, int);
+static void vga_WriteStr(char *, int, int, int, int);
-static void FDECL(read_planar_tile, (unsigned, struct planar_cell_struct *));
-static void FDECL(read_planar_tile_O,
- (unsigned, struct overview_planar_cell_struct *));
-static void FDECL(read_tile_indexes, (unsigned, unsigned char (*)[TILE_X]));
+static void read_planar_tile(unsigned, struct planar_cell_struct *);
+static void read_planar_tile_O(unsigned,
+ struct overview_planar_cell_struct *);
+static void read_tile_indexes(unsigned, unsigned char (*)[TILE_X]);
extern int clipx, clipxmax; /* current clipping column from wintty.c */
extern boolean clipping; /* clipping on? from wintty.c */
/* static int g_attribute; */ /* Current attribute to use */
void
-vga_get_scr_size()
+vga_get_scr_size(void)
{
CO = 80;
LI = 29;
}
void
-vga_backsp()
+vga_backsp(void)
{
int col, row;
}
void
-vga_clear_screen(colour)
-int colour;
+vga_clear_screen(int colour)
{
unsigned long __far *pch;
unsigned j;
vga_gotoloc(0, 0); /* is this needed? */
}
-void vga_cl_end(col, row) /* clear to end of line */
-int col, row;
+/* clear to end of line */
+void vga_cl_end(int col, int row)
{
int count;
}
}
-void vga_cl_eos(cy) /* clear to end of screen */
-int cy;
+/* clear to end of screen */
+void vga_cl_eos(int cy)
{
int count;
}
void
-vga_tty_end_screen()
+vga_tty_end_screen(void)
{
vga_clear_screen(BACKGROUND_VGA_COLOR);
vga_SwitchMode(MODETEXT);
}
void
-vga_tty_startup(wid, hgt)
-int *wid, *hgt;
+vga_tty_startup(int *wid, int *hgt)
{
/* code to sense display adapter is required here - MJA */
*/
void
-vga_xputs(s, col, row)
-const char *s;
-int col, row;
+vga_xputs(const char *s, int col, int row)
{
if (s != (char *) 0) {
vga_WriteStr((char *) s, strlen(s), col, row, g_attribute);
}
}
-void vga_xputc(ch, attr) /* write out character (and attribute) */
-char ch;
-int attr;
+/* write out character (and attribute) */
+void vga_xputc(char ch, int attr)
{
int col, row;
}
#if defined(USE_TILES)
+/* Place tile represent. a glyph at current location */
void
-vga_xputg(glyphnum, ch,
- special) /* Place tile represent. a glyph at current location */
-int glyphnum;
-int ch;
-unsigned special; /* special feature: corpse, invis, detected, pet, ridden -
- hack.h */
+vga_xputg(int glyphnum, int ch,
+ unsigned special) /* special feature: corpse, invis, detected, pet, ridden -
+ hack.h */
{
int col, row;
int attr;
*/
void
-vga_gotoloc(col, row)
-int col, row;
+vga_gotoloc(int col, int row)
{
curcol = min(col, CO - 1); /* protection from callers */
currow = min(row, LI - 1);
#if defined(USE_TILES) && defined(CLIPPING)
static void
-vga_cliparound(x, y)
-int x, y;
+vga_cliparound(int x, int y UNUSED)
{
int oldx = clipx;
}
static void
-vga_redrawmap(clearfirst)
-boolean clearfirst;
+vga_redrawmap(boolean clearfirst)
{
int x, y, t;
unsigned long __far *pch;
#endif /* USE_TILES && CLIPPING */
void
-vga_userpan(pan)
-enum vga_pan_direction pan;
+vga_userpan(enum vga_pan_direction pan)
{
int x;
}
void
-vga_overview(on)
-boolean on;
+vga_overview(boolean on)
{
/* vga_HideCursor(); */
if (on) {
}
void
-vga_traditional(on)
-boolean on;
+vga_traditional(boolean on)
{
/* vga_HideCursor(); */
if (on) {
}
void
-vga_refresh()
+vga_refresh(void)
{
positionbar();
vga_redrawmap(1);
#endif /* SCROLLMAP */
static void
-read_planar_tile(glyph, cell)
-unsigned glyph;
-struct planar_cell_struct *cell;
+read_planar_tile(unsigned glyph, struct planar_cell_struct *cell)
{
unsigned char indexes[TILE_Y][TILE_X];
unsigned plane, y, byte, bit;
}
static void
-read_planar_tile_O(glyph, cell)
-unsigned glyph;
-struct overview_planar_cell_struct *cell;
+read_planar_tile_O(unsigned glyph, struct overview_planar_cell_struct *cell)
{
unsigned char indexes[TILE_Y][TILE_X];
unsigned plane, y, bit;
}
static void
-read_tile_indexes(glyph, indexes)
-unsigned glyph;
-unsigned char (*indexes)[TILE_X];
+read_tile_indexes(unsigned glyph, unsigned char (*indexes)[TILE_X])
{
const struct TileImage *tile;
unsigned x, y;
tile = get_tile(tilenum);
/* Map to a 16 bit palette; assume colors laid out as in default tileset */
- memset(indexes, 0, sizeof(indexes));
for (y = 0; y < TILE_Y && y < tile->height; ++y) {
for (x = 0; x < TILE_X && x < tile->width; ++x) {
unsigned i = tile->indexes[y * tile->width + x];
}
static void
-decal_planar(gp, special)
-struct planar_cell_struct *gp;
-unsigned special;
+decal_planar(struct planar_cell_struct *gp UNUSED, unsigned special)
{
if (special & MG_CORPSE) {
} else if (special & MG_INVIS) {
#endif
vga_SetPalette(paletteptr);
g_attribute = attrib_gr_normal;
- font = vga_FontPtrs();
+ font = (unsigned char __far *) vga_FontPtrs();
clear_screen();
clipx = 0;
clipxmax = clipx + (viewport_size - 1);
* 0xB=MCGA(mono-monitor), 0xC=MCGA(color-monitor), 0xFF=unknown)
*/
int
-vga_detect()
+vga_detect(void)
{
union REGS regs;
*
*/
static void
-vga_WriteChar(chr, col, row, colour)
-int chr, col, row, colour;
+vga_WriteChar(int chr, int col, int row, int colour)
{
int i;
int x, pixy;
*
*/
static void
-vga_DisplayCell(gp, col, row)
-struct planar_cell_struct *gp;
-int col, row;
+vga_DisplayCell(struct planar_cell_struct *gp, int col, int row)
{
int i, pixx, pixy;
char __far *tmp_s; /* source pointer */
}
static void
-vga_DisplayCell_O(gp, col, row)
-struct overview_planar_cell_struct *gp;
-int col, row;
+vga_DisplayCell_O(struct overview_planar_cell_struct *gp, int col, int row)
{
int i, pixx, pixy;
char __far *tmp_s; /* source pointer */
*
*/
static void
-vga_WriteStr(s, len, col, row, colour)
-char *s;
-int len, col, row, colour;
+vga_WriteStr(char *s, int len, int col, int row, int colour)
{
unsigned char *us;
int i = 0;
*
*/
static void
-vga_SetPalette(p)
-const struct Pixel *p;
+vga_SetPalette(const struct Pixel *p)
{
union REGS regs;
int i;
static unsigned char pbar[COLNO];
void
-vga_update_positionbar(posbar)
-char *posbar;
+vga_update_positionbar(char *posbar)
{
- char *p = pbar;
+ char *p = (char *) pbar;
if (posbar)
while (*posbar)
*p++ = *posbar++;
*p = 0;
}
+#ifdef __DJGPP__
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
+#endif /* __DJGPP__ */
+
static void
-positionbar()
+positionbar(void)
{
- char *posbar = pbar;
+ char *posbar = (char *) pbar;
int feature, ucol;
int k, y, colour, row;
char __far *pch;
#endif
}
+#ifdef __DJGPP__
+#pragma GCC diagnostic pop
+#endif /* __DJGPP__ */
+
void
-vga_special(chr, col, color)
-int chr, col, color;
+vga_special(int chr, int col, int color)
{
int i, y, pixy;
char __far *tmp_d; /* destination pointer */
}
egawriteplane(15);
}
-
#endif /*POSITIONBAR*/
#ifdef SIMULATE_CURSOR
static struct planar_cell_struct cursor;
void
-vga_DrawCursor()
+vga_DrawCursor(void)
{
int i, pixx, pixy, x, y, p;
char __far *tmp1;
}
void
-vga_HideCursor()
+vga_HideCursor(void)
{
int i, pixx, pixy, x, y;
char __far *tmp1;
#endif
#ifdef _M_UNIX
-extern void NDECL(sco_mapon);
-extern void NDECL(sco_mapoff);
+extern void sco_mapon(void);
+extern void sco_mapoff(void);
#endif
#ifdef __linux__
-extern void NDECL(linux_mapon);
-extern void NDECL(linux_mapoff);
+extern void linux_mapon(void);
+extern void linux_mapoff(void);
#endif
#ifdef AUX
void
-catch_stp()
+catch_stp(void)
{
signal(SIGTSTP, SIG_DFL);
dosuspend();
#endif /* AUX */
void
-getwindowsz()
+getwindowsz(void)
{
#ifdef USE_WIN_IOCTL
/*
}
void
-getioctls()
+getioctls(void)
{
#ifdef BSD_JOB_CONTROL
(void) ioctl(fileno(stdin), (int) TIOCGLTC, (char *) <chars);
}
void
-setioctls()
+setioctls(void)
{
#ifdef BSD_JOB_CONTROL
(void) ioctl(fileno(stdin), (int) TIOCSLTC, (char *) <chars);
#ifdef SUSPEND /* No longer implies BSD */
int
-dosuspend()
+dosuspend(void)
{
#ifdef SYSCF
/* NB: check_user_string() is port-specific. */
#ifdef LAN_FEATURES
void
-init_lan_features()
+init_lan_features(void)
{
lan_username();
}
*/
char *
-lan_username()
+lan_username(void)
{
char *lu;
lu = get_username(&g.lusername_size);
#include <unistd.h> /* for getcwd() prototype */
#endif
+#if defined(MICRO) || defined(OS2)
+void nethack_exit(int) NORETURN;
+#else
+#define nethack_exit exit
+#endif
+
+char *exepath(char *);
char orgdir[PATHLEN]; /* also used in pcsys.c, amidos.c */
#ifdef TOS
#ifdef AMIGA
extern int bigscreen;
-void NDECL(preserve_icon);
+void preserve_icon(void);
#endif
-static void FDECL(process_options, (int argc, char **argv));
-static void NDECL(nhusage);
-
-#if defined(MICRO) || defined(OS2)
-extern void FDECL(nethack_exit, (int)) NORETURN;
-#else
-#define nethack_exit exit
-#endif
+static void process_options(int argc, char **argv);
+static void nhusage(void);
-#ifdef EXEPATH
-static char *FDECL(exepath, (char *));
-#endif
+#ifdef PORT_HELP
+#if defined(MSDOS)
+void port_help(void);
+#endif /* MSDOS */
+#endif /* PORT_HELP */
-int FDECL(main, (int, char **));
+int main(int, char **);
-extern boolean FDECL(pcmain, (int, char **));
+extern boolean pcmain(int, char **);
#if defined(__BORLANDC__)
-void NDECL(startup);
+void startup(void);
unsigned _stklen = STKSIZ;
#endif
*/
int
#ifndef __MINGW32__
-main(argc, argv)
+main(int argc, char *argv[])
#else
-mingw_main(argc, argv)
+mingw_main(int argc, char *argv[])
#endif
-int argc;
-char *argv[];
{
boolean resuming;
}
boolean
-pcmain(argc, argv)
-int argc;
-char *argv[];
+pcmain(int argc, char *argv[])
{
NHFILE *nhfp;
register char *dir;
* We'll return here if new game player_selection() renames the hero.
*/
attempt_restore:
- if ((nhfp = restore_saved_game()) > 0) {
+ if ((nhfp = restore_saved_game()) != 0) {
#ifndef NO_SIGNAL
(void) signal(SIGINT, (SIG_RET_TYPE) done1);
#endif
}
static void
-process_options(argc, argv)
-int argc;
-char *argv[];
+process_options(int argc, char *argv[])
{
int i;
}
static void
-nhusage()
+nhusage(void)
{
char buf1[BUFSZ], buf2[BUFSZ], *bufptr;
#ifdef CHDIR
void
-chdirx(dir, wr)
-char *dir;
-boolean wr;
+chdirx(char *dir, boolean wr)
{
#ifdef AMIGA
static char thisdir[] = "";
#ifdef PORT_HELP
#if defined(MSDOS)
void
-port_help()
+port_help(void)
{
/* display port specific help file */
display_file(PORT_HELP, 1);
/* validate wizard mode if player has requested access to it */
boolean
-authorize_wizard_mode()
+authorize_wizard_mode(void)
{
if (!strcmp(g.plname, WIZARD_NAME))
return TRUE;
char exepathbuf[EXEPATHBUFSZ];
char *
-exepath(str)
-char *str;
+exepath(char *str)
{
char *tmp, *tmp2;
- int bsize;
if (!str)
return (char *) 0;
- bsize = EXEPATHBUFSZ;
tmp = exepathbuf;
Strcpy(tmp, str);
tmp2 = strrchr(tmp, PATH_SEPARATOR);
}
unsigned long
-sys_random_seed()
+sys_random_seed(void)
{
unsigned long seed = 0L;
unsigned long pid = (unsigned long) getpid();
#endif
#if defined(MICRO) || defined(OS2)
-void FDECL(nethack_exit, (int)) NORETURN;
+void nethack_exit(int) NORETURN;
#else
#define nethack_exit exit
#endif
-static void NDECL(msexit);
+static void msexit(void);
#ifdef MOVERLAY
extern void __far __cdecl _movepause(void);
#define __MOVE_PAUSE_DISK 2 /* Represents the executable file */
#define __MOVE_PAUSE_CACHE 4 /* Represents the cache memory */
#endif /* MOVERLAY */
+FILE * fopenp(const char *name, const char *mode);
#if defined(MICRO)
void
-flushout()
+flushout(void)
{
(void) fflush(stdout);
return;
#ifdef SHELL
int
-dosh()
+dosh(void)
{
+#ifndef NOCWD_ASSUMPTIONS
extern char orgdir[];
+#endif
char *comspec;
#ifndef __GO32__
int spawnstat;
* be room for the \
*/
void
-append_slash(name)
-char *name;
+append_slash(char *name)
{
char *ptr;
}
void
-getreturn(str)
-const char *str;
+getreturn(const char *str)
{
#ifdef TOS
msmsg("Hit <Return> %s.", str);
#endif
FILE *
-fopenp(name, mode)
-const char *name, *mode;
+fopenp(const char *name, const char *mode)
{
char buf[BUFSIZ], *bp, *pp, lastch = 0;
FILE *fp;
#if defined(MICRO) || defined(OS2)
void
-nethack_exit(code)
-int code;
+nethack_exit(int code)
{
msexit();
exit(code);
#endif
static void
-msexit()
+msexit(void)
{
-#ifdef CHDIR
+#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
extern char orgdir[];
#endif
* Called by startup() in termcap.c and after returning from ! or ^Z
*/
void
-gettty()
+gettty(void)
{
erase_char = '\b';
kill_char = 21; /* cntl-U */
/* reset terminal to original state */
void
-settty(s)
-const char *s;
+settty(const char *s)
{
#if defined(MSDOS) && defined(NO_TERMS)
gr_finish();
/* called by init_nhwindows() and resume_nhwindows() */
void
-setftty()
+setftty(void)
{
start_screen();
}
#if defined(TIMED_DELAY) && defined(_MSC_VER)
void
-msleep(mseconds)
-unsigned mseconds;
+msleep(unsigned mseconds)
{
/* now uses clock() which is ANSI C */
clock_t goal;
#endif
#if defined(TTY_GRAPHICS)
-extern void NDECL(backsp);
-extern void NDECL(clear_screen);
+extern void backsp(void);
+extern void clear_screen(void);
#endif
#if 0
static struct stat hbuf;
#endif
-#ifdef PC_LOCKING
-static int NDECL(eraseoldlocks);
+#if defined(PC_LOCKING) && !defined(SELF_RECOVER)
+static int eraseoldlocks(void);
#endif
#if 0
int
-uptodate(fd)
-int fd;
+uptodate(int fd)
{
#ifdef WANT_GETHDATE
if(fstat(fd, &buf)) {
}
#endif
-#ifdef PC_LOCKING
+#if defined(PC_LOCKING)
+#if !defined(SELF_RECOVER)
static int
-eraseoldlocks()
+eraseoldlocks(void)
{
register int i;
return 0; /* cannot remove it */
return (1); /* success! */
}
+#endif /* SELF_RECOVER */
void
-getlock()
+getlock(void)
{
- register int fd, c, ci, ct, ern;
+ register int fd, c, ci, ct;
int fcmask = FCMASK;
char tbuf[BUFSZ];
const char *fq_lock;
gotlock:
fd = creat(fq_lock, fcmask);
- if (fd == -1)
- ern = errno;
unlock_file(HLOCK);
if (fd == -1) {
#if defined(CHDIR) && !defined(NOCWD_ASSUMPTIONS)
#endif /* PC_LOCKING */
void
-regularize(s)
+regularize(register char *s)
/*
* normalize file name - we don't like .'s, /'s, spaces, and
* lots of other things
*/
-register char *s;
{
register char *lp;
};
struct nhregex *
-regex_init()
+regex_init(void)
{
struct nhregex *re;
}
boolean
-regex_compile(s, re)
-const char *s;
-struct nhregex *re;
+regex_compile(const char *s, struct nhregex *re)
{
if (!re)
return FALSE;
}
const char *
-regex_error_desc(re)
-struct nhregex *re UNUSED;
+regex_error_desc(struct nhregex *re UNUSED)
{
return "pattern match compilation error";
}
boolean
-regex_match(s, re)
-const char *s;
-struct nhregex *re;
+regex_match(const char *s, struct nhregex *re)
{
if (!re || !re->pat || !s)
return FALSE;
}
void
-regex_free(re)
-struct nhregex *re;
+regex_free(struct nhregex *re)
{
if (re) {
if (re->pat)
};
struct nhregex *
-regex_init()
+regex_init(void)
{
return (struct nhregex *) alloc(sizeof(struct nhregex));
}
short ospeed;
/* exported routines */
-int FDECL(tgetent, (char *, const char *));
-int FDECL(tgetflag, (const char *));
-int FDECL(tgetnum, (const char *));
-char *FDECL(tgetstr, (const char *, char **));
-char *FDECL(tgoto, (const char *, int, int));
-char *FDECL(tparam, (const char *, char *, int, int, int, int, int));
-void FDECL(tputs, (const char *, int, int (*)(int)));
+int tgetent(char *, const char *);
+int tgetflag(const char *);
+int tgetnum(const char *);
+char *tgetstr(const char *, char **);
+char *tgoto(const char *, int, int);
+char *tparam(const char *, char *, int, int, int, int, int);
+void tputs(const char *, int, int (*)(int));
/* local support data */
static char *tc_entry;
#endif /* !NO_DELAY_PADDING */
/* local support code */
-static int FDECL(tc_store, (const char *, const char *));
-static char *FDECL(tc_find, (FILE *, const char *, char *, int));
-static char *FDECL(tc_name, (const char *, char *));
-static const char *FDECL(tc_field, (const char *, const char **));
+static int tc_store(const char *, const char *);
+static char *tc_find(FILE *, const char *, char *, int);
+static char *tc_name(const char *, char *);
+static const char *tc_field(const char *, const char **);
#ifndef min
#define min(a, b) ((a) < (b) ? (a) : (b))
/* retrieve the specified terminal entry and return it in `entbuf' */
int
-tgetent(entbuf, term)
-char *entbuf; /* size must be at least [TCBUFSIZ] */
-const char *term;
+tgetent(char *entbuf, /* size must be at least [TCBUFSIZ] */
+ const char *term)
{
int result;
FILE *fp;
/* copy the entry into the output buffer */
static int
-tc_store(trm, ent)
-const char *trm, *ent;
+tc_store(const char *trm, const char *ent)
{
const char *bar, *col;
char *s;
/* search for an entry in the termcap file */
static char *
-tc_find(fp, term, buffer, bufsiz)
-FILE *fp;
-const char *term;
-char *buffer;
-int bufsiz;
+tc_find(FILE *fp, const char *term, char *buffer, int bufsiz)
{
int in, len, first, skip;
char *ip, *op, *tc_fetch, tcbuf[TCBUFSIZ];
/* check whether `ent' contains `nam'; return start of field entries */
static char *
-tc_name(nam, ent)
-const char *nam;
-char *ent;
+tc_name(const char *nam, char *ent)
{
char *nxt, *lst, *p = ent;
size_t n = strlen(nam);
/* look up a numeric entry */
int
-tgetnum(which)
-const char *which;
+tgetnum(const char *which)
{
const char *q, *p = tc_field(which, &q);
char numbuf[32];
/* look up a boolean entry */
int
-tgetflag(which)
-const char *which;
+tgetflag(const char *which)
{
const char *p = tc_field(which, (const char **) 0);
/* look up a string entry; update `*outptr' */
char *
-tgetstr(which, outptr)
-const char *which;
-char **outptr;
+tgetstr(const char *which, char **outptr)
{
int n;
char c, *r, *result;
/* look for a particular field name */
static const char *
-tc_field(field, tc_end)
-const char *field;
-const char **tc_end;
+tc_field(const char *field, const char **tc_end)
{
const char *end, *q, *p = tc_entry;
/* produce a string which will position the cursor at <row,col> if output */
char *
-tgoto(cm, col, row)
-const char *cm;
-int col, row;
+tgoto(const char *cm, int col, int row)
{
return tparam(cm, cmbuf, (int) (sizeof cmbuf), row, col, 0, 0);
}
/* format a parameterized string, ala sprintf */
char *
-tparam(ctl, buf, buflen, row, col, row2, col2)
-const char *ctl; /* parameter control string */
-char *buf; /* output buffer */
-int buflen; /* ought to have been `size_t'... */
-int row, col, row2, col2;
+tparam(const char *ctl, /* parameter control string */
+ char *buf, /* output buffer */
+ int buflen, /* ought to have been `size_t'... */
+ int row, int col, int row2, int col2)
{
int atmp, ac, av[5];
char c, *r, *z, *bufend, numbuf[32];
/* send a string to the terminal, possibly padded with trailing NULs */
void
-tputs(string, range, output_func)
-const char *string; /* characters to output */
-int range; /* number of lines affected, used for `*' delays */
-int FDECL((*output_func),(int)); /* actual output routine;
+tputs(const char *string, /* characters to output */
+ int range, /* number of lines affected, used for `*' delays */
+ int (*output_func)(int)) /* actual output routine;
* return value ignored */
{
register int c, num = 0;
* used unconditionally because it conflicts with the 'bool' one.
*/
#ifdef NEED_HAS_COLORS_DECL
-int has_colors();
+int has_colors(void);
#endif
#if defined(TTY_GRAPHICS) && ((!defined(SYSV) && !defined(HPUX)) \
#ifdef POSIX_TYPES
static int
-speednum(speed)
-speed_t speed;
+speednum(speed_t speed)
{
switch (speed) {
case B0:
#endif
static void
-setctty()
+setctty(void)
{
if (STTY(&curttyb) < 0 || STTY2(&curttyb2) < 0)
perror("NetHack (setctty)");
* Called by startup() in termcap.c and after returning from ! or ^Z
*/
void
-gettty()
+gettty(void)
{
if (GTTY(&inittyb) < 0 || GTTY2(&inittyb2) < 0)
perror("NetHack (gettty)");
/* reset terminal to original state */
void
-settty(s)
-const char *s;
+settty(const char *s)
{
end_screen();
if (s)
}
void
-setftty()
+setftty(void)
{
unsigned ef, cf;
int change = 0;
start_screen();
}
-void intron() /* enable kbd interupts if enabled when game started */
+void intron(void) /* enable kbd interupts if enabled when game started */
{
#ifdef TTY_GRAPHICS
/* Ugly hack to keep from changing tty modes for non-tty games -dlc */
#endif
}
-void introff() /* disable kbd interrupts if required*/
+void introff(void) /* disable kbd interrupts if required*/
{
#ifdef TTY_GRAPHICS
/* Ugly hack to keep from changing tty modes for non-tty games -dlc */
int sco_map_valid = -1;
unsigned char sco_chanmap_buf[BSIZE];
-void NDECL(sco_mapon);
-void NDECL(sco_mapoff);
-void NDECL(check_sco_console);
-void NDECL(init_sco_cons);
+void sco_mapon(void);
+void sco_mapoff(void);
+void check_sco_console(void);
+void init_sco_cons(void);
void
-sco_mapon()
+sco_mapon(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && sco_flag_console) {
}
void
-sco_mapoff()
+sco_mapoff(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && sco_flag_console) {
}
void
-check_sco_console()
+check_sco_console(void)
{
if (isatty(0) && ioctl(0, CONS_GET, 0) != -1) {
sco_flag_console = 1;
}
void
-init_sco_cons()
+init_sco_cons(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && sco_flag_console) {
int linux_flag_console = 0;
-void NDECL(linux_mapon);
-void NDECL(linux_mapoff);
-void NDECL(check_linux_console);
-void NDECL(init_linux_cons);
+void linux_mapon(void);
+void linux_mapoff(void);
+void check_linux_console(void);
+void init_linux_cons(void);
void
-linux_mapon()
+linux_mapon(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && linux_flag_console) {
}
void
-linux_mapoff()
+linux_mapoff(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && linux_flag_console) {
}
void
-check_linux_console()
+check_linux_console(void)
{
struct vt_mode vtm;
}
void
-init_linux_cons()
+init_linux_cons(void)
{
#ifdef TTY_GRAPHICS
if (WINDOWPORT("tty") && linux_flag_console) {
#ifndef __begui__ /* the Be GUI will define its own error proc */
/* fatal error */
-/*VARARGS1*/
-void error
-VA_DECL(const char *, s)
+void
+error(const char *s, ...)
{
- VA_START(s);
- VA_INIT(s, const char *);
+ va_list the_args;
+ va_start(the_args, s);
if (iflags.window_inited)
exit_nhwindows((char *) 0); /* for tty, will call settty() */
if (settty_needed)
settty((char *) 0);
- Vprintf(s, VA_ARGS);
+ Vprintf(s, the_args);
(void) putchar('\n');
- VA_END();
+ va_end(the_args);
exit(EXIT_FAILURE);
}
#endif /* !__begui__ */
#define DEC(c) (((c) - ' ') & 077)
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
FILE *in, *out;
int mode;
* copy from in to out, decoding as you go along.
*/
void
-decode(in, out)
-FILE *in;
-FILE *out;
+decode(FILE *in, FILE *out)
{
char buf[80];
char *bp;
* output all of them at the end of the file.
*/
void
-outdec(p, f, n)
-char *p;
-FILE *f;
-int n;
+outdec(char *p, FILE *f, int n)
{
int c1, c2, c3;
# leave it out by default.
#CFLAGS+=-Wunreachable-code
#
-# Can't use these; NetHack uses old-style-definitions
-#CFLAGS+=-Wold-style-definition
-#CFLAGS+=-Wstrict-prototypes
+CFLAGS+=-Wold-style-definition
+CFLAGS+=-Wstrict-prototypes
#end of compiler.2020
#------------------------------------------------------------------------------
override TARGET_STUBEDIT = ../lib/djgpp/i586-pc-msdosdjgpp/bin/stubedit
override TARGET_CFLAGS = -c -O -I../include -I../sys/msdos -I../win/share \
$(LUAINCL) -DDLB $(PDCURSESDEF) \
- -DUSE_TILES -DCROSSCOMPILE -DCROSSCOMPILE_TARGET -DCROSS_TO_MSDOS
+ -DUSE_TILES -DCROSSCOMPILE -DCROSSCOMPILE_TARGET -DCROSS_TO_MSDOS \
+ -Wall -Wextra -Wno-missing-field-initializers -Wimplicit \
+ -Wreturn-type -Wunused -Wformat -Wswitch -Wshadow -Wwrite-strings \
+ -Wimplicit-function-declaration -Wimplicit-int \
+ -Wmissing-declarations -Wmissing-prototypes -Wmissing-parameter-type
override TARGET_CXXFLAGS = $(TARGET_CFLAGS)
override TARGET_LINK = $(TOOLTOP1)/i586-pc-msdosdjgpp-gcc
override TARGET_LFLAGS=
#if !defined(_BULL_SOURCE) && !defined(__sgi) && !defined(_M_UNIX)
#if !defined(SUNOS4) && !(defined(ULTRIX) && defined(__GNUC__))
#if defined(POSIX_TYPES) || defined(SVR4) || defined(HPUX)
-extern struct passwd *FDECL(getpwuid, (uid_t));
+extern struct passwd *getpwuid(uid_t);
#else
-extern struct passwd *FDECL(getpwuid, (int));
+extern struct passwd *getpwuid(int);
#endif
#endif
#endif
-extern struct passwd *FDECL(getpwnam, (const char *));
+extern struct passwd *getpwnam(const char *);
#ifdef CHDIR
-static void FDECL(chdirx, (const char *, BOOLEAN_P));
+static void chdirx(const char *, boolean);
#endif /* CHDIR */
-static boolean NDECL(whoami);
-static void FDECL(process_options, (int, char **));
+static boolean whoami(void);
+static void process_options(int, char **);
#ifdef _M_UNIX
-extern void NDECL(check_sco_console);
-extern void NDECL(init_sco_cons);
+extern void check_sco_console(void);
+extern void init_sco_cons(void);
#endif
#ifdef __linux__
-extern void NDECL(check_linux_console);
-extern void NDECL(init_linux_cons);
+extern void check_linux_console(void);
+extern void init_linux_cons(void);
#endif
-static void NDECL(wd_message);
+static void wd_message(void);
static boolean wiz_error_flag = FALSE;
-static struct passwd *NDECL(get_unix_pw);
+static struct passwd *get_unix_pw(void);
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
#ifdef CHDIR
register char *dir;
/* caveat: argv elements might be arbitrary long */
static void
-process_options(argc, argv)
-int argc;
-char *argv[];
+process_options(int argc, char *argv[])
{
int i, l;
#ifdef CHDIR
static void
-chdirx(dir, wr)
-const char *dir;
-boolean wr;
+chdirx(const char *dir, boolean wr)
{
if (dir /* User specified directory? */
#ifdef HACKDIR
/* returns True iff we set plname[] to username which contains a hyphen */
static boolean
-whoami()
+whoami(void)
{
/*
* Who am i? Algorithm: 1. Use name as specified in NETHACKOPTIONS
}
void
-sethanguphandler(handler)
-void FDECL((*handler), (int));
+sethanguphandler(void (*handler)(int))
{
#ifdef SA_RESTART
/* don't want reads to restart. If SA_RESTART is defined, we know
#ifdef PORT_HELP
void
-port_help()
+port_help(void)
{
/*
* Display unix-specific help. Just show contents of the helpfile
/* validate wizard mode if player has requested access to it */
boolean
-authorize_wizard_mode()
+authorize_wizard_mode(void)
{
struct passwd *pw = get_unix_pw();
}
static void
-wd_message()
+wd_message(void)
{
if (wiz_error_flag) {
if (sysopt.wizards && sysopt.wizards[0]) {
* be room for the /
*/
void
-append_slash(name)
-char *name;
+append_slash(char *name)
{
char *ptr;
}
boolean
-check_user_string(optstr)
-const char *optstr;
+check_user_string(const char *optstr)
{
struct passwd *pw;
int pwlen;
}
static struct passwd *
-get_unix_pw()
+get_unix_pw(void)
{
char *user;
unsigned uid;
}
char *
-get_login_name()
+get_login_name(void)
{
static char buf[BUFSZ];
struct passwd *pw = get_unix_pw();
extern int errno;
void
-port_insert_pastebuf(buf)
-char *buf;
+port_insert_pastebuf(char *buf)
{
/* This should be replaced when there is a Cocoa port. */
const char *errfmt;
#endif /* __APPLE__ */
unsigned long
-sys_random_seed()
+sys_random_seed(void)
{
unsigned long seed = 0L;
unsigned long pid = (unsigned long) getpid();
#include <dlfcn.h>
static int
-real_getresuid(ruid, euid, suid)
-uid_t *ruid, *euid, *suid;
+real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
{
int (*f)(uid_t *, uid_t *, uid_t *); /* getresuid signature */
}
static int
-real_getresgid(rgid, egid, sgid)
-gid_t *rgid, *egid, *sgid;
+real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
{
int (*f)(gid_t *, gid_t *, gid_t *); /* getresgid signature */
#ifdef SYS_getresuid
static int
-real_getresuid(ruid, euid, suid)
-uid_t *ruid, *euid, *suid;
+real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
{
return syscall(SYS_getresuid, ruid, euid, suid);
}
#endif /* SVR4 */
static int
-real_getresuid(ruid, euid, suid)
-uid_t *ruid, *euid, *suid;
+real_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
{
int retval;
int pfd[2];
#ifdef SYS_getresgid
static int
-real_getresgid(rgid, egid, sgid)
-gid_t *rgid, *egid, *sgid;
+real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
{
return syscall(SYS_getresgid, rgid, egid, sgid);
}
#else /* SYS_getresgid */
static int
-real_getresgid(rgid, egid, sgid)
-gid_t *rgid, *egid, *sgid;
+real_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
{
int retval;
int pfd[2];
*/
int
-hide_privileges(flag)
-boolean flag;
+hide_privileges(boolean flag)
{
if (flag)
hiding_privileges++;
}
int
-nh_getresuid(ruid, euid, suid)
-uid_t *ruid, *euid, *suid;
+nh_getresuid(uid_t *ruid, uid_t *euid, uid_t *suid)
{
int retval = real_getresuid(ruid, euid, suid);
}
uid_t
-nh_getuid()
+nh_getuid(void)
{
uid_t ruid, euid, suid;
}
uid_t
-nh_geteuid()
+nh_geteuid(void)
{
uid_t ruid, euid, suid;
}
int
-nh_getresgid(rgid, egid, sgid)
-gid_t *rgid, *egid, *sgid;
+nh_getresgid(gid_t *rgid, gid_t *egid, gid_t *sgid)
{
int retval = real_getresgid(rgid, egid, sgid);
}
gid_t
-nh_getgid()
+nh_getgid(void)
{
gid_t rgid, egid, sgid;
}
gid_t
-nh_getegid()
+nh_getegid(void)
{
gid_t rgid, egid, sgid;
#ifdef GNOME_GRAPHICS
int
-hide_privileges(flag)
-boolean flag;
+hide_privileges(boolean flag)
{
return 0;
}
#include <signal.h>
#ifdef _M_UNIX
-extern void NDECL(sco_mapon);
-extern void NDECL(sco_mapoff);
+extern void sco_mapon(void);
+extern void sco_mapoff(void);
#endif
#ifdef __linux__
-extern void NDECL(linux_mapon);
-extern void NDECL(linux_mapoff);
+extern void linux_mapon(void);
+extern void linux_mapoff(void);
#endif
#ifndef NHSTDC
/* see whether we should throw away this xlock file;
if yes, close it, otherwise leave it open */
static int
-veryold(fd)
-int fd;
+veryold(int fd)
{
time_t date;
}
static int
-eraseoldlocks()
+eraseoldlocks(void)
{
register int i;
}
void
-getlock()
+getlock(void)
{
register int i = 0, fd, c;
const char *fq_lock;
/* normalize file name - we don't like .'s, /'s, spaces */
void
-regularize(s)
-register char *s;
+regularize(char *s)
{
register char *lp;
#include <poll.h>
void
-msleep(msec)
-unsigned msec; /* milliseconds */
+msleep(unsigned msec) /* milliseconds */
{
struct pollfd unused;
int msecs = msec; /* poll API is signed */
#ifdef SHELL
int
-dosh()
+dosh(void)
{
char *str;
#if defined(SHELL) || defined(DEF_PAGER) || defined(DEF_MAILREADER)
int
-child(wt)
-int wt;
+child(int wt)
{
register int f;
#ifdef GETRES_SUPPORT
-extern int FDECL(nh_getresuid, (uid_t *, uid_t *, uid_t *));
-extern uid_t NDECL(nh_getuid);
-extern uid_t NDECL(nh_geteuid);
-extern int FDECL(nh_getresgid, (gid_t *, gid_t *, gid_t *));
-extern gid_t NDECL(nh_getgid);
-extern gid_t NDECL(nh_getegid);
+extern int nh_getresuid(uid_t *, uid_t *, uid_t *);
+extern uid_t nh_getuid(void);
+extern uid_t nh_geteuid(void);
+extern int nh_getresgid(gid_t *, gid_t *, gid_t *);
+extern gid_t nh_getgid(void);
+extern gid_t nh_getegid(void);
/* the following several functions assume __STDC__ where parentheses
around the name of a function-like macro prevent macro expansion */
-int (getresuid)(ruid, euid, suid)
-uid_t *ruid, *euid, *suid;
+int (getresuid)(uid_t *ruid, *euid, *suid)
{
return nh_getresuid(ruid, euid, suid);
}
-uid_t (getuid)()
+uid_t (getuid)(void)
{
return nh_getuid();
}
-uid_t (geteuid)()
+uid_t (geteuid)(void)
{
return nh_geteuid();
}
-int (getresgid)(rgid, egid, sgid)
-gid_t *rgid, *egid, *sgid;
+int (getresgid)(gid_t *rgid, *egid, *sgid)
{
return nh_getresgid(rgid, egid, sgid);
}
-gid_t (getgid)()
+gid_t (getgid)(void)
{
return nh_getgid();
}
-gid_t (getegid)()
+gid_t (getegid)(void)
{
return nh_getegid();
}
/* XXX should be ifdef PANICTRACE_GDB, but there's no such symbol yet */
#ifdef PANICTRACE
boolean
-file_exists(path)
-const char *path;
+file_exists(const char *path)
{
struct stat sb;
char dllname[512];
char *shortdllname;
-int FDECL(__declspec(dllexport) __stdcall ProcessKeystroke,
- (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid,
- BOOLEAN_P numberpad, int portdebug));
+int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn,
+ INPUT_RECORD *ir, boolean *valid, boolean numberpad, int portdebug);
int WINAPI
DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
#define inmap(x, vk) (((x) > 'A' && (x) < 'Z') || (vk) == 0xBF || (x) == '2')
-int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid,
- numberpad, portdebug)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-boolean *valid;
-boolean numberpad;
-int portdebug;
+int __declspec(dllexport) __stdcall
+ProcessKeystroke(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ boolean *valid,
+ boolean numberpad,
+ int portdebug)
{
- int metaflags = 0, k = 0;
int keycode, vk;
- unsigned char ch, pre_ch, mk = 0;
+ unsigned char ch, pre_ch;
unsigned short int scan;
unsigned long shiftstate;
int altseq = 0;
return ch;
}
-int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir)
-HANDLE hConIn;
-INPUT_RECORD *ir;
+int __declspec(dllexport) __stdcall
+NHkbhit(
+ HANDLE hConIn,
+ INPUT_RECORD *ir)
{
int done = 0; /* true = "stop searching" */
int retval; /* true = "we had a match" */
return retval;
}
-int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad,
- mode, mod, cc)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-DWORD *count;
-boolean numpad;
-int mode;
-int *mod;
-coord *cc;
+int __declspec(dllexport) __stdcall CheckInput(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ DWORD *count,
+ boolean numpad,
+ int mode,
+ int *mod,
+ coord *cc)
{
#if defined(SAFERHANGUP)
DWORD dwWait;
#endif
- int ch;
+ int ch = 0;
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
return mode ? 0 : ch;
}
-int __declspec(dllexport) __stdcall SourceWhere(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceWhere(char** buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall SourceAuthor(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceAuthor(char** buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall KeyHandlerName(buf, full)
-char **buf;
-int full;
+int __declspec(dllexport) __stdcall
+KeyHandlerName(char** buf, int full)
{
if (!buf)
return 0;
char dllname[512];
char *shortdllname;
-int FDECL(__declspec(dllexport) __stdcall ProcessKeystroke,
- (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid,
- BOOLEAN_P numberpad, int portdebug));
+int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn,
+ INPUT_RECORD *ir, boolean *valid, boolean numberpad, int portdebug);
int WINAPI
DllMain(HINSTANCE hInstance, DWORD fdwReason, PVOID pvReserved)
static BYTE KeyState[256];
-int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid,
- numberpad, portdebug)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-boolean *valid;
-boolean numberpad;
-int portdebug;
+int __declspec(dllexport) __stdcall
+ProcessKeystroke(
+ HANDLE hConIn,
+ INPUT_RECORD* ir,
+ boolean* valid,
+ boolean numberpad,
+ int portdebug)
{
- int metaflags = 0, k = 0;
+ int k = 0;
int keycode, vk;
- unsigned char ch, pre_ch, mk = 0;
+ unsigned char ch, pre_ch;
unsigned short int scan;
unsigned long shiftstate;
int altseq = 0;
return ch;
}
-int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir)
-HANDLE hConIn;
-INPUT_RECORD *ir;
+int __declspec(dllexport) __stdcall
+NHkbhit(HANDLE hConIn, INPUT_RECORD *ir)
{
int done = 0; /* true = "stop searching" */
int retval; /* true = "we had a match" */
return retval;
}
-int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad,
- mode, mod, cc)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-DWORD *count;
-boolean numpad;
-int mode;
-int *mod;
-coord *cc;
+int __declspec(dllexport) __stdcall
+CheckInput(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ DWORD* count,
+ boolean numpad,
+ int mode,
+ int *mod,
+ coord *cc)
{
#if defined(SAFERHANGUP)
DWORD dwWait;
#endif
- int ch;
+ int ch = 0;
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
return mode ? 0 : ch;
}
-int __declspec(dllexport) __stdcall SourceWhere(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceWhere(char** buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall SourceAuthor(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceAuthor(char **buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall KeyHandlerName(buf, full)
-char **buf;
-int full;
+int __declspec(dllexport) __stdcall
+KeyHandlerName(char **buf, int full)
{
if (!buf)
return 0;
char dllname[512];
char *shortdllname;
-int FDECL(__declspec(dllexport) __stdcall ProcessKeystroke,
- (HANDLE hConIn, INPUT_RECORD *ir, boolean *valid,
- BOOLEAN_P numberpad, int portdebug));
+int __declspec(dllexport) __stdcall ProcessKeystroke(HANDLE hConIn,
+ INPUT_RECORD *ir, boolean *valid, boolean numberpad, int portdebug);
static INPUT_RECORD bogus_key;
#define inmap(x, vk) (((x) > 'A' && (x) < 'Z') || (vk) == 0xBF || (x) == '2')
/* Use process_keystroke for key commands, process_keystroke2 for prompts */
-/* int FDECL(process_keystroke, (INPUT_RECORD *ir, boolean *valid, int
- * portdebug)); */
-int FDECL(process_keystroke2, (HANDLE, INPUT_RECORD *ir, boolean *valid));
-static int FDECL(is_altseq, (unsigned long shiftstate));
+/* int process_keystroke(INPUT_RECORD *ir, boolean *valid, int
+ * portdebug); */
+int process_keystroke2(HANDLE, INPUT_RECORD *ir, boolean *valid);
+static int is_altseq(unsigned long shiftstate);
static int
-is_altseq(shiftstate)
-unsigned long shiftstate;
+is_altseq(unsigned long shiftstate)
{
/* We need to distinguish the Alt keys from the AltGr key.
* On NT-based Windows, AltGr signals as right Alt and left Ctrl together;
}
}
-int __declspec(dllexport) __stdcall ProcessKeystroke(hConIn, ir, valid,
- numberpad, portdebug)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-boolean *valid;
-boolean numberpad;
-int portdebug;
+int __declspec(dllexport) __stdcall
+ProcessKeystroke(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ boolean *valid,
+ boolean numberpad,
+ int portdebug)
{
- int metaflags = 0, k = 0;
int keycode, vk;
- unsigned char ch, pre_ch, mk = 0;
+ unsigned char ch, pre_ch;
unsigned short int scan;
unsigned long shiftstate;
int altseq = 0;
}
int
-process_keystroke2(hConIn, ir, valid)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-boolean *valid;
+process_keystroke2(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ boolean *valid)
{
/* Use these values for the numeric keypad */
static const char keypad_nums[] = "789-456+1230.";
return ch;
}
-int __declspec(dllexport) __stdcall CheckInput(hConIn, ir, count, numpad,
- mode, mod, cc)
-HANDLE hConIn;
-INPUT_RECORD *ir;
-DWORD *count;
-int mode;
-int *mod;
-boolean numpad;
-coord *cc;
+int __declspec(dllexport) __stdcall
+CheckInput(
+ HANDLE hConIn,
+ INPUT_RECORD *ir,
+ DWORD *count,
+ boolean numpad,
+ int mode,
+ int *mod,
+ coord *cc)
{
#if defined(SAFERHANGUP)
DWORD dwWait;
#endif
- int ch;
+ int ch = 0;
boolean valid = 0, done = 0;
#ifdef QWERTZ_SUPPORT
return ch;
}
-int __declspec(dllexport) __stdcall NHkbhit(hConIn, ir)
-HANDLE hConIn;
-INPUT_RECORD *ir;
+int __declspec(dllexport) __stdcall NHkbhit(
+ HANDLE hConIn,
+ INPUT_RECORD *ir)
{
int done = 0; /* true = "stop searching" */
int retval; /* true = "we had a match" */
return retval;
}
-int __declspec(dllexport) __stdcall SourceWhere(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceWhere(char** buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall SourceAuthor(buf)
-char **buf;
+int __declspec(dllexport) __stdcall
+SourceAuthor(char** buf)
{
if (!buf)
return 0;
return 1;
}
-int __declspec(dllexport) __stdcall KeyHandlerName(buf, full)
-char **buf;
-int full;
+int __declspec(dllexport) __stdcall KeyHandlerName(
+ char **buf,
+ int full)
{
if (!buf)
return 0;
#ifdef USER_SOUNDS
void
-play_usersound(filename, volume)
-const char *filename;
-int volume;
+play_usersound(const char* filename, int volume)
{
/* pline("play_usersound: %s (%d).", filename, volume); */
(void) sndPlaySound(filename, SND_ASYNC | SND_NODEFAULT);
* GetConsoleOutputCP
*/
-static BOOL FDECL(CtrlHandler, (DWORD));
-static void FDECL(xputc_core, (char));
-void FDECL(cmov, (int, int));
-void FDECL(nocmov, (int, int));
-int FDECL(process_keystroke,
- (INPUT_RECORD *, boolean *, BOOLEAN_P numberpad, int portdebug));
-static void NDECL(init_ttycolor);
-static void NDECL(really_move_cursor);
-static void NDECL(check_and_set_font);
-static boolean NDECL(check_font_widths);
-static void NDECL(set_known_good_console_font);
-static void NDECL(restore_original_console_font);
-extern void NDECL(safe_routines);
+static BOOL CtrlHandler(DWORD);
+static void xputc_core(char);
+void cmov(int, int);
+void nocmov(int, int);
+int process_keystroke(INPUT_RECORD *, boolean *, boolean numberpad,
+ int portdebug);
+static void init_ttycolor(void);
+static void really_move_cursor(void);
+static void check_and_set_font(void);
+static boolean check_font_widths(void);
+static void set_known_good_console_font(void);
+static void restore_original_console_font(void);
+extern void safe_routines(void);
/* Win32 Screen buffer,coordinate,console I/O information */
COORD ntcoord;
static boolean display_cursor_info = FALSE;
#endif
#ifdef CHANGE_COLOR
-static void NDECL(adjust_palette);
-static int FDECL(match_color_name, (const char *));
+static void adjust_palette(void);
+static int match_color_name(const char *);
typedef HWND(WINAPI *GETCONSOLEWINDOW)();
static HWND GetConsoleHandle(void);
static HWND GetConsoleHwnd(void);
/* dynamic keystroke handling .DLL support */
typedef int(__stdcall *PROCESS_KEYSTROKE)(HANDLE, INPUT_RECORD *, boolean *,
- BOOLEAN_P, int);
+ boolean, int);
typedef int(__stdcall *NHKBHIT)(HANDLE, INPUT_RECORD *);
-typedef int(__stdcall *CHECKINPUT)(HANDLE, INPUT_RECORD *, DWORD *, BOOLEAN_P,
+typedef int(__stdcall *CHECKINPUT)(HANDLE, INPUT_RECORD *, DWORD *, boolean,
int, int *, coord *);
typedef int(__stdcall *SOURCEWHERE)(char **);
/* reset terminal to original state */
void
-settty(s)
-const char *s;
+settty(const char* s)
{
cmov(ttyDisplay->curx, ttyDisplay->cury);
end_screen();
}
void
-tty_startup(wid, hgt)
-int *wid, *hgt;
+tty_startup(int *wid, int *hgt)
{
*wid = console.width;
*hgt = console.height;
}
void
-tty_number_pad(state)
-int state;
+tty_number_pad(int state)
{
// do nothing
}
}
static BOOL
-CtrlHandler(ctrltype)
-DWORD ctrltype;
+CtrlHandler(DWORD ctrltype)
{
switch (ctrltype) {
/* case CTRL_C_EVENT: */
/* called by pcmain() and process_options() */
void
-nttty_open(mode)
-int mode; // unused
+nttty_open(int mode)
{
DWORD cmode;
}
int
-process_keystroke(ir, valid, numberpad, portdebug)
-INPUT_RECORD *ir;
-boolean *valid;
-boolean numberpad;
-int portdebug;
+process_keystroke(
+ INPUT_RECORD *ir,
+ boolean *valid,
+ boolean numberpad,
+ int portdebug)
{
int ch;
}
int
-ntposkey(x, y, mod)
-int *x, *y, *mod;
+ntposkey(int *x, int *y, int *mod)
{
int ch;
- coord cc;
+ coord cc = { 0, 0 };
DWORD count;
boolean numpad = iflags.num_pad;
}
void
-cmov(x, y)
-register int x, y;
+cmov(int x, int y)
{
ttyDisplay->cury = y;
ttyDisplay->curx = x;
}
void
-nocmov(x, y)
-int x, y;
+nocmov(int x, int y)
{
ttyDisplay->curx = x;
ttyDisplay->cury = y;
/* same signature as 'putchar()' with potential failure result ignored */
int
-xputc(ch)
-int ch;
+xputc(int ch)
{
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
xputc_core((char) ch);
}
void
-xputs(s)
-const char *s;
+xputs(const char* s)
{
int k;
int slen = (int) strlen(s);
* on the display.
*/
void
-xputc_core(ch)
-char ch;
+xputc_core(char ch)
{
nhassert(console.cursor.X >= 0 && console.cursor.X < console.width);
nhassert(console.cursor.Y >= 0 && console.cursor.Y < console.height);
*/
void
-g_putch(in_ch)
-int in_ch;
+g_putch(int in_ch)
{
boolean inverse = FALSE;
unsigned char ch = (unsigned char) in_ch;
}
void
-cl_end()
+cl_end(void)
{
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
buffer_clear_to_end_of_line(console.back_buffer, console.cursor.X,
}
void
-raw_clear_screen()
+raw_clear_screen(void)
{
if (WINDOWPORT("tty")) {
cell_t * back = console.back_buffer;
}
void
-clear_screen()
+clear_screen(void)
{
buffer_fill_to_end(console.back_buffer, &clear_cell, 0, 0);
home();
}
void
-home()
+home(void)
{
ttyDisplay->curx = ttyDisplay->cury = 0;
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
}
void
-backsp()
+backsp(void)
{
set_console_cursor(ttyDisplay->curx, ttyDisplay->cury);
xputc_core('\b');
}
void
-cl_eos()
+cl_eos(void)
{
buffer_fill_to_end(console.back_buffer, &clear_cell, ttyDisplay->curx,
ttyDisplay->cury);
}
void
-tty_nhbell()
+tty_nhbell(void)
{
if (flags.silent || iflags.debug_fuzzer)
return;
volatile int junk; /* prevent optimizer from eliminating loop below */
void
-tty_delay_output()
+tty_delay_output(void)
{
/* delay 50 ms - uses ANSI C clock() function now */
clock_t goal;
*/
static void
-init_ttycolor()
+init_ttycolor(void)
{
#ifdef TEXTCOLOR
ttycolors[CLR_BLACK] = FOREGROUND_INTENSITY; /* fix by Quietust */
}
void
-standoutbeg()
+standoutbeg(void)
{
term_start_attr(ATR_BOLD);
}
void
-standoutend()
+standoutend(void)
{
term_end_attr(ATR_BOLD);
}
#ifndef NO_MOUSE_ALLOWED
void
-toggle_mouse_support()
+toggle_mouse_support(void)
{
static int qeinit = 0;
DWORD cmode;
/* handle tty options updates here */
void
-nttty_preference_update(pref)
-const char *pref;
+nttty_preference_update(const char* pref)
{
if (stricmp(pref, "mouse_support") == 0) {
#ifndef NO_MOUSE_ALLOWED
#ifdef PORT_DEBUG
void
-win32con_debug_keystrokes()
+win32con_debug_keystrokes(void)
{
DWORD count;
boolean valid = 0;
- int ch;
+ int ch = 0;
xputs("\n");
while (!valid || ch != 27) {
nocmov(ttyDisplay->curx, ttyDisplay->cury);
(void) doredraw();
}
void
-win32con_handler_info()
+win32con_handler_info(void)
{
char *buf;
int ci;
}
void
-win32con_toggle_cursor_info()
+win32con_toggle_cursor_info(void)
{
display_cursor_info = !display_cursor_info;
}
#endif
void
-map_subkeyvalue(op)
-register char *op;
+map_subkeyvalue(char* op)
{
char digits[] = "0123456789";
int length, i, idx, val;
key_overrides[idx] = val;
}
-void unload_keyboard_handler()
+void unload_keyboard_handler(void)
{
nhassert(keyboard_handler.hLibrary != NULL);
}
void
-synch_cursor()
+synch_cursor(void)
{
really_move_cursor();
}
VOID WINAPI SetConsolePalette(COLORREF crPalette[16]);
void
-adjust_palette(VOID_ARGS)
+adjust_palette(void)
{
SetConsolePalette(UserDefinedColors);
altered_palette = 0;
/* select font */
HGDIOBJ saved_font = SelectObject(hDC, console_font);
+ /* measure the set of used glyphs to ensure they fit */
+ boolean all_glyphs_fit = FALSE;
+
/* determine whether it is a true type font */
TEXTMETRICA tm;
success = GetTextMetricsA(hDC, &tm);
if (used[i])
wcUsed[wcUsedCount++] = cp437[i];
- /* measure the set of used glyphs to ensure they fit */
- boolean all_glyphs_fit = TRUE;
+ all_glyphs_fit = TRUE;
for (int i = 0; i < wcUsedCount; i++) {
int width;
/* grow the size of the console buffer if it is not wide enough */
if (console.origcsbi.dwSize.X < console.width) {
- COORD size = {
- size.Y = console.origcsbi.dwSize.Y,
- size.X = console.width
+ COORD screen_size = {
+ screen_size.Y = console.origcsbi.dwSize.Y,
+ screen_size.X = console.width
};
- SetConsoleScreenBufferSize(console.hConOut, size);
+ SetConsoleScreenBufferSize(console.hConOut, screen_size);
}
/* setup front and back buffers */
int qt_tilewidth, qt_tileheight, qt_fontsize, qt_compact_mode;
#endif
void
-mswin_destroy_reg()
+mswin_destroy_reg(void)
{
return;
}
void
-mswin_raw_print_flush()
+mswin_raw_print_flush(void)
{
}
extern int mingw_main(int argc, char **argv);
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
boolean resuming;
#endif
void
-win_tty_init(dir)
-int dir;
+win_tty_init(int dir)
{
return;
}
void
-nttty_open(mode)
-int mode;
+nttty_open(int mode)
{
return;
}
int
-xputc(ch)
-int ch;
+xputc(int ch)
{
return 0;
}
void
-xputs(s)
-const char *s;
+xputs(const char *s)
{
return;
}
void
-raw_clear_screen()
+raw_clear_screen(void)
{
return;
}
void
-clear_screen()
+clear_screen(void)
{
return;
}
void
-backsp()
+backsp(void)
{
return;
}
#ifndef NO_MOUSE_ALLOWED
void
-toggle_mouse_support()
+toggle_mouse_support(void)
{
return;
}
#ifdef PORT_DEBUG
void
-win32con_debug_keystrokes()
+win32con_debug_keystrokes(void)
{
return;
}
void
-win32con_handler_info()
+win32con_handler_info(void)
{
return;
}
#endif
void
-map_subkeyvalue(op)
-register char *op;
+map_subkeyvalue(char *op)
{
return;
}
#ifdef TTY_GRAPHICS
void
-synch_cursor()
+synch_cursor(void)
{
return;
}
#endif
void
-more()
+more(void)
{
return;
}
void
-nethack_enter_nttty()
+nethack_enter_nttty(void)
{
return;
}
#if defined(USER_SOUNDS) && defined(TTY_SOUND_ESCCODES)
void
-play_usersound_via_idx(idx, volume)
-int idx, volume;
+play_usersound_via_idx(int idx, int volume)
{
}
#endif /* USER_SOUNDS && TTY_SOUND_ESCCODES */
Win10 gWin10 = { 0 };
-void win10_init()
+void win10_init(void)
{
if (IsWindows10OrGreater())
{
}
BOOL
-win10_is_desktop_bridge_application()
+win10_is_desktop_bridge_application(void)
{
if (gWin10.Valid) {
UINT32 length = 0;
#error You must #define SAFEPROCS to build windmain.c
#endif
-#define E extern
-static void FDECL(process_options, (int argc, char **argv));
-static void NDECL(nhusage);
-static char *NDECL(get_executable_path);
-char *FDECL(translate_path_variables, (const char *, char *));
-char *NDECL(exename);
-boolean NDECL(fakeconsole);
-void NDECL(freefakeconsole);
-E void FDECL(nethack_exit, (int)) NORETURN;
+static void process_options(int argc, char **argv);
+static void nhusage(void);
+static char *get_executable_path(void);
+char *translate_path_variables(const char *, char *);
+char *exename(void);
+boolean fakeconsole(void);
+void freefakeconsole(void);
+extern void nethack_exit(int) NORETURN;
#if defined(MSWIN_GRAPHICS)
-E void NDECL(mswin_destroy_reg);
+extern void mswin_destroy_reg(void);
#endif
#ifdef TTY_GRAPHICS
-extern void NDECL(backsp);
+extern void backsp(void);
#endif
-extern void NDECL(clear_screen);
-#undef E
+extern void clear_screen(void);
#ifdef _MSC_VER
#ifdef kbhit
#endif
#ifdef PC_LOCKING
-static int NDECL(eraseoldlocks);
+static int eraseoldlocks(void);
#endif
-int NDECL(windows_nhgetch);
-void NDECL(windows_nhbell);
-int FDECL(windows_nh_poskey, (int *, int *, int *));
-void FDECL(windows_raw_print, (const char *));
-char FDECL(windows_yn_function, (const char *, const char *, CHAR_P));
-static void FDECL(windows_getlin, (const char *, char *));
-extern int NDECL(windows_console_custom_nhgetch);
-void NDECL(safe_routines);
-int NDECL(tty_self_recover_prompt);
-int NDECL(other_self_recover_prompt);
+int windows_nhgetch(void);
+void windows_nhbell(void);
+int windows_nh_poskey(int *, int *, int *);
+void windows_raw_print(const char *);
+char windows_yn_function(const char *, const char *, char);
+static void windows_getlin(const char *, char *);
+extern int windows_console_custom_nhgetch(void);
+void safe_routines(void);
+int tty_self_recover_prompt(void);
+int other_self_recover_prompt(void);
char orgdir[PATHLEN];
boolean getreturn_enabled;
void
set_default_prefix_locations(const char *programPath)
{
- char *envp = NULL;
- char *sptr = NULL;
-
static char executable_path[MAX_PATH];
static char profile_path[MAX_PATH];
static char versioned_profile_path[MAX_PATH];
*/
int
#ifndef __MINGW32__
-main(argc, argv)
+main(int argc, char *argv[])
#else
-mingw_main(argc, argv)
+mingw_main(int argc, char *argv[])
#endif
-int argc;
-char *argv[];
{
boolean resuming = FALSE; /* assume new game */
NHFILE *nhfp;
char *windowtype = NULL;
- char *envp = NULL;
- char *sptr = NULL;
char fnamebuf[BUFSZ], encodedfnamebuf[BUFSZ];
char failbuf[BUFSZ];
}
static void
-process_options(argc, argv)
-int argc;
-char *argv[];
+process_options(int argc, char * argv[])
{
int i;
}
static void
-nhusage()
+nhusage(void)
{
char buf1[BUFSZ], buf2[BUFSZ], *bufptr;
}
void
-safe_routines(VOID_ARGS)
+safe_routines(void)
{
/*
* Get a set of valid safe windowport function
#ifdef PORT_HELP
void
-port_help()
+port_help(void)
{
/* display port specific help file */
display_file(PORT_HELP, 1);
/* validate wizard mode if player has requested access to it */
boolean
-authorize_wizard_mode()
+authorize_wizard_mode(void)
{
if (!strcmp(g.plname, WIZARD_NAME))
return TRUE;
boolean has_fakeconsole;
char *
-exename()
+exename(void)
{
int bsize = PATHLEN;
char *tmp = exenamebuf, *tmp2;
#endif
char *
-get_executable_path()
+get_executable_path(void)
{
static char path_buffer[MAX_PATH];
}
char *
-translate_path_variables(str, buf)
-const char *str;
-char *buf;
+translate_path_variables(const char* str, char* buf)
{
const char *src;
char evar[BUFSZ], *dest, *envp, *eptr = (char *) 0;
/*ARGSUSED*/
void
-windows_raw_print(str)
-const char *str;
+windows_raw_print(const char* str)
{
if (str)
fprintf(stdout, "%s\n", str);
/*ARGSUSED*/
void
-windows_raw_print_bold(str)
-const char *str;
+windows_raw_print_bold(const char* str)
{
windows_raw_print(str);
return;
}
int
-windows_nhgetch()
+windows_nhgetch(void)
{
return getchar();
}
void
-windows_nhbell()
+windows_nhbell(void)
{
return;
}
/*ARGSUSED*/
int
-windows_nh_poskey(x, y, mod)
-int *x, *y, *mod;
+windows_nh_poskey(int *x, int *y, int *mod)
{
return '\033';
}
/*ARGSUSED*/
char
-windows_yn_function(query, resp, def)
-const char *query;
-const char *resp;
-char def;
+windows_yn_function(const char* query, const char* resp, char def)
{
return '\033';
}
/*ARGSUSED*/
static void
-windows_getlin(prompt, outbuf)
-const char *prompt UNUSED;
-char *outbuf;
+windows_getlin(const char* prompt UNUSED, char* outbuf)
{
Strcpy(outbuf, "\033");
}
#ifdef PC_LOCKING
static int
-eraseoldlocks()
+eraseoldlocks(void)
{
register int i;
}
int
-getlock()
+getlock(void)
{
- register int fd, ern, prompt_result = 0;
+ int fd, ern = 0, prompt_result = 0;
int fcmask = FCMASK;
#ifndef SELF_RECOVER
char tbuf[BUFSZ];
#endif /* PC_LOCKING */
boolean
-file_exists(path)
-const char *path;
+file_exists(const char* path)
{
struct stat sb;
does not exist, it returns TRUE.
*/
boolean
-file_newer(a_path, b_path)
-const char * a_path;
-const char * b_path;
+file_newer(const char* a_path, const char* b_path)
{
struct stat a_sb;
struct stat b_sb;
* -1 if old game should be destroyed, allowing new game to proceed.
*/
int
-tty_self_recover_prompt()
+tty_self_recover_prompt(void)
{
register int c, ci, ct, pl, retval = 0;
/* for saving/replacing functions, if needed */
}
int
-other_self_recover_prompt()
+other_self_recover_prompt(void)
{
register int c, ci, ct, pl, retval = 0;
boolean ismswin = WINDOWPORT("mswin"),
static HWND GetConsoleHandle(void);
static HWND GetConsoleHwnd(void);
#if !defined(TTY_GRAPHICS)
-extern void NDECL(backsp);
+extern void backsp(void);
#endif
-int NDECL(windows_console_custom_nhgetch);
-extern void NDECL(safe_routines);
+int windows_console_custom_nhgetch(void);
+extern void safe_routines(void);
/* The function pointer nt_kbhit contains a kbhit() equivalent
* which varies depending on which window port is active.
int (*nt_kbhit)() = def_kbhit;
char
-switchar()
+switchar(void)
{
/* Could not locate a WIN32 API call for this- MJA */
return '-';
}
long
-freediskspace(path)
-char *path;
+freediskspace(char* path)
{
char tmppath[4];
DWORD SectorsPerCluster = 0;
* Functions to get filenames using wildcards
*/
int
-findfirst(path)
-char *path;
+findfirst(char* path)
{
if (ffhandle) {
FindClose(ffhandle);
}
int
-findnext()
+findnext(void)
{
return FindNextFile(ffhandle, &ffd) ? 1 : 0;
}
char *
-foundfile_buffer()
+foundfile_buffer(void)
{
return &ffd.cFileName[0];
}
long
-filesize(file)
-char *file;
+filesize(char* file)
{
if (findfirst(file)) {
return ((long) ffd.nFileSizeLow);
* Chdrive() changes the default drive.
*/
void
-chdrive(str)
-char *str;
+chdrive(char* str)
{
char *ptr;
char drive;
}
static int
-max_filename()
+max_filename(void)
{
DWORD maxflen;
int status = 0;
}
int
-def_kbhit()
+def_kbhit(void)
{
return 0;
}
* Strip out troublesome file system characters.
*/
-void nt_regularize(s) /* normalize file name */
-register char *s;
+void nt_regularize(char* s) /* normalize file name */
{
- register unsigned char *lp;
+ unsigned char *lp;
- for (lp = s; *lp; lp++)
+ for (lp = (unsigned char *) s; *lp; lp++)
if (*lp == '?' || *lp == '"' || *lp == '\\' || *lp == '/'
|| *lp == '>' || *lp == '<' || *lp == '*' || *lp == '|'
|| *lp == ':' || (*lp > 127))
* This is used in nhlan.c to implement some of the LAN_FEATURES.
*/
char *
-get_username(lan_username_size)
-int *lan_username_size;
+get_username(int *lan_username_size)
{
static TCHAR username_buffer[BUFSZ];
DWORD i = BUFSZ - 1;
}
#if 0
-char *getxxx()
+char *getxxx(void)
{
char szFullPath[MAX_PATH] = "";
HMODULE hInst = NULL; /* NULL gets the filename of this module */
}
#endif
-extern void NDECL(mswin_raw_print_flush);
-extern void FDECL(mswin_raw_print, (const char *));
+extern void mswin_raw_print_flush(void);
+extern void mswin_raw_print(const char *);
/* fatal error */
/*VARARGS1*/
}
void
-win32_abort()
+win32_abort(void)
{
int c;
static int interjection[INTERJECTION_TYPES];
void
-interject_assistance(num, interjection_type, ptr1, ptr2)
-int num;
-int interjection_type;
-genericptr_t ptr1;
-genericptr_t ptr2;
+interject_assistance(int num, int interjection_type, genericptr_t ptr1, genericptr_t ptr2)
{
switch (num) {
case 1: {
}
void
-interject(interjection_type)
-int interjection_type;
+interject(int interjection_type)
{
if (interjection_type >= 0 && interjection_type < INTERJECTION_TYPES)
msmsg(interjection_buf[interjection_type]);
#ifdef RUNTIME_PASTEBUF_SUPPORT
-void port_insert_pastebuf(buf)
-char *buf;
+void port_insert_pastebuf(char *buf)
{
/* This implementation will utilize the windows clipboard
* to accomplish this.
*/
- char *tmp = buf;
HGLOBAL hglbCopy;
WCHAR *w, w2[2];
int cc, rc, abytes;
#endif
char *
-get_port_id(buf)
-char *buf;
+get_port_id(char *buf)
{
Strcpy(buf, TARGET_PORT);
return buf;
#endif /* RUNTIME_PORT_ID */
void
-nethack_exit(code)
-int code;
+nethack_exit(int code)
{
/* Only if we started from the GUI, not the command prompt,
* we need to get one last return, so the score board does
#include <conio.h>
int
-windows_console_custom_nhgetch(VOID_ARGS)
+windows_console_custom_nhgetch(void)
{
return _getch();
}
void
-getreturn(str)
-const char *str;
+getreturn(const char *str)
{
static boolean in_getreturn = FALSE;
char buf[BUFSZ];
/* nethack_enter_winnt() is called from main immediately after
initializing the window port */
-void nethack_enter_winnt()
+void nethack_enter_winnt(void)
{
if (WINDOWPORT("tty"))
nethack_enter_nttty();
}
int
-windows_early_options(window_opt)
-const char *window_opt;
+windows_early_options(const char *window_opt)
{
/*
* If you return 2, the game will exit before it begins.
* be room for the \
*/
void
-append_slash(name)
-char *name;
+append_slash(char *name)
{
char *ptr;
#endif
unsigned long
-sys_random_seed(VOID_ARGS)
+sys_random_seed(void)
{
unsigned long ourseed = 0UL;
BCRYPT_ALG_HANDLE hRa = (BCRYPT_ALG_HANDLE) 0;
/* nt_assert_failed is called when an nhassert's condition is false */
void
-nt_assert_failed(expression, filepath, line)
- const char * expression;
- const char * filepath;
- int line;
+nt_assert_failed(const char *expression, const char *filepath, int line)
{
const char * filename;
#include <string.h>
#endif
-static void FDECL(grow_ld, (libdir **, int *, int));
-static void FDECL(xexit, (int)) NORETURN;
+static void grow_ld(libdir **, int *, int);
+static void xexit(int) NORETURN;
#ifdef DLB
#ifdef DLBLIB
#define LIBLISTFILE "dlb.lst" /* default list file */
/* library functions (from dlb.c) */
-extern boolean FDECL(open_library, (const char *, library *));
-extern void FDECL(close_library, (library *));
+extern boolean open_library(const char *, library *);
+extern void close_library(library *);
-char *FDECL(eos, (char *)); /* also used by dlb.c */
-FILE *FDECL(fopen_datafile, (const char *, const char *));
+char *eos(char *); /* also used by dlb.c */
+FILE *fopen_datafile(const char *, const char *);
-static void FDECL(Write, (int, char *, long));
-static void NDECL(usage) NORETURN;
-static void NDECL(verbose_help) NORETURN;
-static void FDECL(write_dlb_directory, (int, int, libdir *, long, long, long));
+static void Write(int, char *, long);
+static void usage(void) NORETURN;
+static void verbose_help(void) NORETURN;
+static void write_dlb_directory(int, int, libdir *, long, long, long);
static char default_progname[] = "dlb";
static char *progname = default_progname;
*/
static void
-usage()
+usage(void)
{
(void) printf("Usage: %s [ctxCIfv] arguments... [files...]\n", progname);
(void) printf(" default library is %s\n", library_file);
}
static void
-verbose_help()
+verbose_help(void)
{
static const char *const long_help[] = {
"", "dlb COMMANDoptions args... files...", " commands:",
}
static void
-Write(out, buf, len)
-int out;
-char *buf;
-long len;
+Write(int out, char *buf, long len)
{
#if defined(MSDOS) && !defined(__DJGPP__)
unsigned short slen;
}
char *
-eos(s)
-char *s;
+eos(char *s)
{
while (*s)
s++;
/* open_library(dlb.c) needs this (which normally comes from src/files.c) */
FILE *
-fopen_datafile(filename, mode)
-const char *filename, *mode;
+fopen_datafile(const char *filename, const char *mode)
{
return fopen(filename, mode);
}
#endif /* DLB */
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char **argv)
{
#ifdef DLB
#ifdef DLBLIB
#ifdef DLBLIB
static void
-grow_ld(ld_p, ldlimit_p, alloc_incr)
-libdir **ld_p;
-int *ldlimit_p;
-int alloc_incr;
+grow_ld(libdir **ld_p, int *ldlimit_p, int alloc_incr)
{
static libdir zerolibdir;
int i = 0, newlimit = *ldlimit_p + alloc_incr;
}
static void
-write_dlb_directory(out, nfiles, ld, slen, dir_size, flen)
-int out, nfiles;
-libdir *ld;
-long slen, dir_size, flen;
+write_dlb_directory(int out, int nfiles, libdir *ld,
+ long slen, long dir_size, long flen)
{
char buf[BUFSIZ];
int i;
#endif /* DLB */
static void
-xexit(retcd)
-int retcd;
+xexit(int retcd)
{
#ifdef DLB
#ifdef AMIGA
#endif
#ifdef MACsansMPWTOOL
-int FDECL(main, (void));
+int main(void);
#else
-int FDECL(main, (int, char **));
+int main(int, char **);
#endif
-void FDECL(do_makedefs, (char *));
-void NDECL(do_objs);
-void NDECL(do_data);
-void NDECL(do_dungeon);
-void NDECL(do_options);
-void NDECL(do_monstr);
-void NDECL(do_permonst);
-void NDECL(do_questtxt);
-void NDECL(do_rumors);
-void NDECL(do_oracles);
-void NDECL(do_date);
-
-extern void NDECL(monst_globals_init); /* monst.c */
-extern void NDECL(objects_globals_init); /* objects.c */
-
-static char *FDECL(name_file, (const char *, const char *));
-static FILE *FDECL(getfp, (const char *, const char *, const char *, int));
-static void FDECL(do_ext_makedefs, (int, char **));
-static char *FDECL(xcrypt, (const char *));
-static unsigned long FDECL(read_rumors_file,
- (const char *, int *, long *, unsigned long));
-static void FDECL(do_rnd_access_file, (const char *, const char *));
-static boolean FDECL(d_filter, (char *));
-static boolean FDECL(h_filter, (char *));
-static void FDECL(opt_out_words, (char *, int *));
-
-static char *FDECL(fgetline, (FILE*));
-static char *FDECL(tmpdup, (const char *));
-static char *FDECL(limit, (char *, int));
-static void NDECL(windowing_sanity);
-static boolean FDECL(get_gitinfo, (char *, char *));
+void do_makedefs(char *);
+void do_objs(void);
+void do_data(void);
+void do_dungeon(void);
+void do_options(void);
+void do_monstr(void);
+void do_permonst(void);
+void do_questtxt(void);
+void do_rumors(void);
+void do_oracles(void);
+void do_date(void);
+
+extern void monst_globals_init(void); /* monst.c */
+extern void objects_globals_init(void); /* objects.c */
+
+static char *name_file(const char *, const char *);
+static FILE *getfp(const char *, const char *, const char *, int);
+static void do_ext_makedefs(int, char **);
+static char *xcrypt(const char *);
+static unsigned long read_rumors_file(const char *, int *,
+ long *, unsigned long);
+static void do_rnd_access_file(const char *, const char *);
+static boolean d_filter(char *);
+static boolean h_filter(char *);
+static void opt_out_words(char *, int *);
+
+static char *fgetline(FILE*);
+static char *tmpdup(const char *);
+static char *limit(char *, int);
+static void windowing_sanity(void);
+static boolean get_gitinfo(char *, char *);
/* input, output, tmp */
static FILE *ifp, *ofp, *tfp;
-static boolean use_enum =
-#ifdef ENUM_PM
- TRUE;
-#else
- FALSE;
-#endif
+static boolean use_enum = TRUE;
#if defined(__BORLANDC__) && !defined(_WIN32)
extern unsigned _stklen = STKSIZ;
#else /* ! MAC */
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
if ((argc == 1) ||
((argc != 2)
#endif
void
-do_makedefs(options)
-char *options;
+do_makedefs(char *options)
{
boolean more_than_one;
static char namebuf[1000];
static char *
-name_file(template, tag)
-const char *template;
-const char *tag;
+name_file(const char* template, const char* tag)
{
Sprintf(namebuf, template, tag);
return namebuf;
}
#ifdef HAS_NO_MKSTEMP
-static void FDECL(delete_file, (const char *template, const char *));
+static void delete_file(const char *template, const char *);
static void
-delete_file(template, tag)
-const char *template;
-const char *tag;
+delete_file(const char *template, const char *tag)
{
char *name = name_file(template, tag);
#endif
static FILE *
-getfp(template, tag, mode, flg)
-const char *template;
-const char *tag;
-const char *mode;
-#ifndef HAS_NO_MKSTEMP
-int flg;
-#else
-int flg UNUSED;
-#endif
+getfp(const char* template, const char* tag, const char* mode, int flg)
{
char *name = name_file(template, tag);
FILE *rv = (FILE *) 0;
rv = fdopen(tmpfd, WRTMODE); /* temp file is always read+write */
Unlink(tmpfbuf);
}
- } else
+ }
+ else
+#else
+ flg; // unused
#endif
rv = fopen(name, mode);
if (!rv) {
/* struct grep_var grep_vars[] and TODO_* constants in include file: */
#include "mdgrep.h"
-static void NDECL(do_grep_showvars);
-static struct grep_var *FDECL(grepsearch, (const char *));
-static int FDECL(grep_check_id, (const char *));
-static void FDECL(grep_show_wstack, (const char *));
-static char *FDECL(do_grep_control, (char *));
-static void NDECL(do_grep);
-static void FDECL(grep0, (FILE *, FILE *, int));
+static void do_grep_showvars(void);
+static struct grep_var *grepsearch(const char *);
+static int grep_check_id(const char *);
+static void grep_show_wstack(const char *);
+static char *do_grep_control(char *);
+static void do_grep(void);
+static void grep0(FILE *, FILE *, int);
static int grep_trace = 0;
static int grep_lineno = 0;
static void
-do_grep_showvars()
+do_grep_showvars(void)
{
int x;
}
static struct grep_var *
-grepsearch(name)
-const char *name;
+grepsearch(const char* name)
{
/* XXX make into binary search */
int x = 0;
}
static int
-grep_check_id(id)
-const char *id;
+grep_check_id(const char* id)
{
struct grep_var *rv;
}
static void
-grep_show_wstack(tag)
-const char *tag;
+grep_show_wstack(const char* tag)
{
int x;
}
static char *
-do_grep_control(buf)
-char *buf;
+do_grep_control(char *buf)
{
int isif = 1;
char *buf0 = buf;
static void grep0(FILE *, FILE *, int);
static void
-do_grep()
+do_grep(void)
{
if (!inputfp) {
Fprintf(stderr, "--grep requires --input\n");
}
static void
-grep0(inputfp0, outputfp0, flg)
-FILE *inputfp0;
-FILE *outputfp0;
-#ifndef HAS_NO_MKSTEMP
-int flg;
-#else
-int flg UNUSED;
-#endif
+grep0(FILE *inputfp0, FILE* outputfp0, int flg)
{
#ifndef HAS_NO_MKSTEMP
/* if grep0 is passed FLG_TEMPFILE flag, it will
The caller will have to take care of calling
fclose() when it is done with the file */
boolean istemp = (flg & FLG_TEMPFILE) != 0;
+#else
+ flg; // unused
#endif
char buf[16384]; /* looong, just in case */
/* trivial text encryption routine which can't be broken with `tr' */
static char *
-xcrypt(str)
-const char *str;
+xcrypt(const char* str)
{ /* duplicated in src/hacklib.c */
static char buf[BUFSZ];
register const char *p;
#define PAD_RUMORS_TO 60
/* common code for do_rumors(). Return 0 on error. */
static unsigned long
-read_rumors_file(file_ext, rumor_count, rumor_size, old_rumor_offset)
-const char *file_ext;
-int *rumor_count;
-long *rumor_size;
-unsigned long old_rumor_offset;
+read_rumors_file(const char* file_ext, int* rumor_count,
+ long* rumor_size, unsigned long old_rumor_offset)
{
char infile[MAXFNAMELEN];
char *line;
}
static void
-do_rnd_access_file(fname, deflt_content)
-const char *fname;
-const char *deflt_content;
+do_rnd_access_file(const char* fname, const char* deflt_content)
{
char *line, buf[BUFSZ];
}
void
-do_rumors()
+do_rumors(void)
{
char *line;
static const char rumors_header[] =
}
void
-do_date()
+do_date(void)
{
#ifdef KR1ED
long clocktim = 0;
}
static boolean
-get_gitinfo(githash, gitbranch)
-char *githash, *gitbranch;
+get_gitinfo(char *githash, char *gitbranch)
{
FILE *gifp;
size_t len;
}
void
-do_options()
+do_options(void)
{
const char *optline;
int infocontext = 0;
}
static void
-windowing_sanity()
+windowing_sanity(void)
{
#ifndef DEFAULT_WINDOW_SYS
/* pre-standard compilers didn't support #error; wait til run-time */
/* routine to decide whether to discard something from data.base */
static boolean
-d_filter(line)
-char *line;
+d_filter(char *line)
{
if (*line == '#')
return TRUE; /* ignore comment lines */
*/
void
-do_data()
+do_data(void)
{
char infile[60], tempfile[60];
boolean ok;
/* routine to decide whether to discard something from oracles.txt */
static boolean
-h_filter(line)
-char *line;
+h_filter(char *line)
{
static boolean skip = FALSE;
char *tag;
*/
void
-do_oracles()
+do_oracles(void)
{
char infile[60], tempfile[60];
boolean in_oracle, ok;
}
void
-do_dungeon()
+do_dungeon(void)
{
char *line;
* transfer relevant generated monstr values to src/monst.c;
* delete src/monstr.c.
*/
-static int FDECL(mstrength, (struct permonst *));
-static boolean FDECL(ranged_attk, (struct permonst *));
+static int mstrength(struct permonst *);
+static boolean ranged_attk(struct permonst *);
/*
* This routine is designed to return an integer value which represents
* determination as "experience()" to arrive at the strength.
*/
static int
-mstrength(ptr)
-struct permonst *ptr;
+mstrength(struct permonst* ptr)
{
int i, tmp2, n, tmp = ptr->mlevel;
/* returns True if monster can attack at range */
static boolean
-ranged_attk(ptr)
-register struct permonst *ptr;
+ranged_attk(register struct permonst* ptr)
{
register int i, j;
register int atk_mask = (1 << AT_BREA) | (1 << AT_SPIT) | (1 << AT_GAZE);
}
void
-do_monstr()
+do_monstr(void)
{
struct permonst *ptr;
int i;
}
Fprintf(ofp, " *\n */\n\n");
- Fprintf(ofp, "\nvoid NDECL(monstr_init);\n");
+ Fprintf(ofp, "\nvoid monstr_init(void);\n");
Fprintf(ofp, "\nvoid\n");
- Fprintf(ofp, "monstr_init()\n");
+ Fprintf(ofp, "monstr_init(void)\n");
Fprintf(ofp, "{\n");
Fprintf(ofp, " return;\n");
Fprintf(ofp, "}\n");
}
void
-do_permonst()
+do_permonst(void)
{
int i;
char *c, *nam;
/* Start of Quest text file processing. */
void
-do_questtxt()
+do_questtxt(void)
{
printf("DEPRECATION WARNINGS:\n");
printf("'makedefs -q' is no longer required. Remove all references\n");
static char temp[32];
-static char *limit(name, pref) /* limit a name to 30 characters length */
-char *name;
-int pref;
+static char *limit(char* name, int pref) /* limit a name to 30 characters length */
{
(void) strncpy(temp, name, pref ? 26 : 30);
temp[pref ? 26 : 30] = 0;
}
void
-do_objs()
+do_objs(void)
{
int i, sum = 0;
char *c, *objnam;
* null pointer if no characters were read.
*/
static char *
-fgetline(fd)
-FILE *fd;
+fgetline(FILE *fd)
{
static const int inc = 256;
int len = inc;
}
static char *
-tmpdup(str)
-const char *str;
+tmpdup(const char* str)
{
static char buf[128];
#define abort() exit()
#endif
#ifdef VMS
-extern void NDECL(vms_abort);
+extern void vms_abort(void);
#endif
/*VARARGS1*/
boolean panicking;
-void VDECL(panic, (const char *, ...));
+void panic(const char *, ...);
void panic
VA_DECL(const char *, str)
* systems, but they should either use yacc or get a real alloca routine.
*/
long *
-alloca(cnt)
-unsigned cnt;
+alloca(unsigned int cnt)
{
return cnt ? alloc(cnt) : (long *) 0;
}
#endif
#ifdef VMS
-extern int FDECL(vms_creat, (const char *, unsigned));
-extern int FDECL(vms_open, (const char *, int, unsigned));
+extern int vms_creat(const char *, unsigned);
+extern int vms_open(const char *, int, unsigned);
#endif /* VMS */
-int FDECL(restore_savefile, (char *));
-void FDECL(set_levelfile_name, (int));
-int FDECL(open_levelfile, (int));
-int NDECL(create_savefile);
-void FDECL(copy_bytes, (int, int));
-static void FDECL(store_formatindicator, (int));
+int restore_savefile(char *);
+void set_levelfile_name(int);
+int open_levelfile(int);
+int create_savefile(void);
+void copy_bytes(int, int);
+static void store_formatindicator(int);
#ifndef WIN_CE
#define Fprintf (void) fprintf
#define Close (void) close
#if defined(EXEPATH)
-char *FDECL(exepath, (char *));
+char *exepath(char *);
#endif
#if defined(__BORLANDC__) && !defined(_WIN32)
char savename[SAVESIZE]; /* holds relative path of save file from playground */
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
int argno;
const char *dir = (char *) 0;
static char lock[256];
void
-set_levelfile_name(lev)
-int lev;
+set_levelfile_name(int lev)
{
char *tf;
}
int
-open_levelfile(lev)
-int lev;
+open_levelfile(int lev)
{
int fd;
}
int
-create_savefile()
+create_savefile(void)
{
int fd;
}
void
-copy_bytes(ifd, ofd)
-int ifd, ofd;
+copy_bytes(int ifd, int ofd)
{
char buf[BUFSIZ];
int nfrom, nto;
}
int
-restore_savefile(basename)
-char *basename;
+restore_savefile(char *basename)
{
int gfd, lfd, sfd;
int res = 0, lev, savelev, hpid, pltmpsiz, filecmc;
}
static void
-store_formatindicator(fd)
-int fd;
+store_formatindicator(int fd)
{
char indicate = 'h'; /* historical */
int cmc = 0;
char exepathbuf[EXEPATHBUFSZ];
char *
-exepath(str)
-char *str;
+exepath(char *str)
{
char *tmp, *tmp2;
int bsize;
window->Clear();
}
-void NetHackQtBind::qt_display_nhwindow(winid wid, BOOLEAN_P block)
+void NetHackQtBind::qt_display_nhwindow(winid wid, boolean block)
{
NetHackQtWindow* window=id_to_window[(int)wid];
if (window)
window->PutStr(attr,text);
}
-void NetHackQtBind::qt_display_file(const char *filename, BOOLEAN_P must_exist)
+void NetHackQtBind::qt_display_file(const char *filename, boolean must_exist)
{
NetHackQtTextWindow* window=new NetHackQtTextWindow(mainWidget());
bool complain = false;
}
void NetHackQtBind::qt_add_menu(winid wid, const glyph_info *glyphinfo,
- const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
+ const ANY_P * identifier, char ch, char gch, int attr,
const char *str, unsigned itemflags)
{
NetHackQtWindow* window=id_to_window[(int)wid];
NetHackQtWindow* window=id_to_window[(int)wid];
window->ClipAround(x,y);
}
-void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,
+void NetHackQtBind::qt_print_glyph(winid wid,xchar x,xchar y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED)
{
}
char NetHackQtBind::qt_yn_function(const char *question_,
- const char *choices, CHAR_P def)
+ const char *choices, char def)
{
QString question(QString::fromLatin1(question_));
QString message;
#endif
}
-char *NetHackQtBind::qt_getmsghistory(BOOLEAN_P init)
+char *NetHackQtBind::qt_getmsghistory(boolean init)
{
NetHackQtMessageWindow *window = main->GetMessageWindow();
if (window)
return NULL;
}
-void NetHackQtBind::qt_putmsghistory(const char *msg, BOOLEAN_P is_restoring)
+void NetHackQtBind::qt_putmsghistory(const char *msg, boolean is_restoring)
{
NetHackQtMessageWindow *window = main->GetMessageWindow();
if (!window)
static void qt_resume_nhwindows();
static winid qt_create_nhwindow(int type);
static void qt_clear_nhwindow(winid wid);
- static void qt_display_nhwindow(winid wid, BOOLEAN_P block);
+ static void qt_display_nhwindow(winid wid, boolean block);
static void qt_destroy_nhwindow(winid wid);
static void qt_curs(winid wid, int x, int y);
static void qt_putstr(winid wid, int attr, const char *text);
static void qt_putstr(winid wid, int attr, const std::string& text);
static void qt_putstr(winid wid, int attr, const QString& text);
- static void qt_display_file(const char *filename, BOOLEAN_P must_exist);
+ static void qt_display_file(const char *filename, boolean must_exist);
static void qt_start_menu(winid wid, unsigned long mbehavior);
static void qt_add_menu(winid wid, const glyph_info *glyphinfo,
- const ANY_P * identifier, CHAR_P ch, CHAR_P gch, int attr,
+ const ANY_P * identifier, char ch, char gch, int attr,
const char *str, unsigned int itemflags);
static void qt_end_menu(winid wid, const char *prompt);
static int qt_select_menu(winid wid, int how, MENU_ITEM_P **menu_list);
static void qt_cliparound(int x, int y);
static void qt_cliparound_window(winid wid, int x, int y);
- static void qt_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
+ static void qt_print_glyph(winid wid, xchar x, xchar y,
const glyph_info *glyphingo,
const glyph_info *bkglyphinfo);
static void qt_raw_print(const char *str);
static int qt_doprev_message();
static char qt_more();
static char qt_yn_function(const char *question,
- const char *choices, CHAR_P def);
+ const char *choices, char def);
static void qt_getlin(const char *prompt, char *line);
static int qt_get_ext_cmd();
static void qt_number_pad(int);
static void qt_end_screen();
static void qt_preference_update(const char *optname);
- static char *qt_getmsghistory(BOOLEAN_P init);
- static void qt_putmsghistory(const char *msg, BOOLEAN_P is_restoring);
+ static char *qt_getmsghistory(boolean init);
+ static void qt_putmsghistory(const char *msg, boolean is_restoring);
static void qt_outrip(winid wid, int how, time_t when);
static int qt_kbhit();
QMenu* menu;
const char* name;
int flags;
- int NDECL((*funct));
+ int (*funct)(void);
} item[] = {
{ game, 0, 3},
{ game, "Version", 3, doversion},
// add a toolbar button to invoke command 'name' via function '(*func)()'
void NetHackQtMainWindow::AddToolButton(QToolBar *toolbar, QSignalMapper *sm,
- const char *name, int NDECL((*func)),
+ const char *name, int (*func)(void),
QPixmap xpm)
{
char actchar[2];
}
// queue up the command name for a function, as if user had typed it
-void NetHackQtMainWindow::FuncAsCommand(int NDECL((*func)))
+void NetHackQtMainWindow::FuncAsCommand(int (*func)(void))
{
char cmdbuf[32];
Strcpy(cmdbuf, "#");
void fadeHighlighting(bool before_key);
- void FuncAsCommand(int NDECL((*func)));
+ void FuncAsCommand(int (*func)(void));
// this is unconditional in case qt_main.h comes before qt_set.h
void resizePaperDoll(bool); // ENHANCED_PAPERDOLL
#ifdef DYNAMIC_STATUSLINES
private:
void ShowIfReady();
void AddToolButton(QToolBar *toolbar, QSignalMapper *sm,
- const char *name, int NDECL((*func)), QPixmap xpm);
+ const char *name, int (*func)(void), QPixmap xpm);
#ifdef KDE
KMenuBar* menubar;
/* ARGSUSED */
static void
-no_op(w, event, params, num_params)
-Widget w; /* unused */
-XEvent *event; /* unused */
-String *params; /* unused */
-Cardinal *num_params; /* unused */
+no_op(Widget w, /* unused */
+ XEvent *event, /* unused */
+ String *params, /* unused */
+ Cardinal *num_params) /* unused */
{
nhUse(w);
nhUse(event);
/* ARGSUSED */
static void
-Redisplay(w, event, region)
-Widget w;
-XEvent *event;
-Region region; /* unused */
+Redisplay(Widget w, XEvent *event, Region region /* unused */)
{
nhUse(region);
/* ARGSUSED */
static void
-Resize(w)
-Widget w;
+Resize(Widget w)
{
XtCallCallbacks(w, XtNresizeCallback, (XtPointer) 0);
}
WidgetClass windowWidgetClass = (WidgetClass) &windowClassRec;
Font
-WindowFont(w)
-Widget w;
+WindowFont(Widget w)
{
return ((WindowWidget) w)->window.font->fid;
}
XFontStruct *
-WindowFontStruct(w)
-Widget w;
+WindowFontStruct(Widget w)
{
return ((WindowWidget) w)->window.font;
}
* an optional cancel button
*/
Widget
-CreateDialog(parent, name, okay_callback, cancel_callback)
-Widget parent;
-String name;
-XtCallbackProc okay_callback;
-XtCallbackProc cancel_callback;
+CreateDialog(Widget parent, String name, XtCallbackProc okay_callback,
+ XtCallbackProc cancel_callback)
{
Widget form, prompt, response, okay, cancel;
Arg args[20];
/* get the prompt from the dialog box. Used a startup time to
* save away the initial prompt */
String
-GetDialogPrompt(w)
- Widget w;
+GetDialogPrompt(Widget w)
{
Arg args[1];
Widget label;
/* set the prompt. This is used to put error information in the prompt */
void
-SetDialogPrompt(w, newprompt)
-Widget w;
-String newprompt;
+SetDialogPrompt(Widget w, String newprompt)
{
Arg args[1];
Widget label;
/* get what the user typed; caller must free the response */
String
-GetDialogResponse(w)
-Widget w;
+GetDialogResponse(Widget w)
{
Arg args[1];
Widget response;
/* set the default reponse */
void
-SetDialogResponse(w, s, ln)
-Widget w;
-String s;
-unsigned ln;
+SetDialogResponse(Widget w, String s, unsigned ln)
{
Arg args[4];
Widget response;
#if 0
/* clear the response */
void
-ClearDialogResponse(w)
- Widget w;
+ClearDialogResponse(Widget w)
{
Arg args[2];
Widget response;
/* position popup window under the cursor */
void
-positionpopup(w, bottom)
-Widget w;
-boolean bottom; /* position y on bottom? */
+positionpopup(Widget w, boolean bottom) /* position y on bottom? */
{
Arg args[3];
Cardinal num_args;
unsigned char *curr_tb = tile_bytes;
unsigned char x11_colormap[MAXCOLORMAPSIZE][3];
-extern void NDECL(monst_globals_init);
-extern void NDECL(objects_globals_init);
+extern void monst_globals_init(void);
+extern void objects_globals_init(void);
/* Look up the given pixel and return its colormap index. */
static unsigned char
-pix_to_colormap(pix)
-pixel pix;
+pix_to_colormap(pixel pix)
{
unsigned long i;
/* Convert the tiles in the file to our format of bytes. */
static unsigned long
-convert_tiles(tb_ptr, total)
-unsigned char **tb_ptr; /* pointer to a tile byte pointer */
-unsigned long total; /* total tiles so far */
+convert_tiles(unsigned char **tb_ptr, /* pointer to a tile byte pointer */
+ unsigned long total) /* total tiles so far */
{
unsigned char *tb = *tb_ptr;
unsigned long count = 0;
/* Merge the current text colormap (ColorMap) with ours (x11_colormap). */
static void
-merge_text_colormap()
+merge_text_colormap(void)
{
unsigned i, j;
/* Open the given file, read & merge the colormap, convert the tiles. */
static void
-process_file(fname)
-char *fname;
+process_file(char *fname)
{
unsigned long count;
#ifdef USE_XPM
static int
-xpm_write(fp)
-FILE *fp;
+xpm_write(FILE *fp)
{
unsigned long i, j;
unsigned n;
#endif /* USE_XPM */
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char *argv[])
{
FILE *fp;
int i;
*/
struct xwindow window_list[MAX_WINDOWS];
AppResources appResources;
-void FDECL((*input_func), (Widget, XEvent *, String *, Cardinal *));
+void (*input_func)(Widget, XEvent *, String *, Cardinal *);
int click_x, click_y, click_button; /* Click position on a map window */
/* (filled by set_button_values()). */
int updated_inventory;
/*
* Local functions.
*/
-static winid NDECL(find_free_window);
+static winid find_free_window(void);
#ifdef TEXTCOLOR
-static void FDECL(nhFreePixel, (XtAppContext, XrmValuePtr, XtPointer,
- XrmValuePtr, Cardinal *));
+static void nhFreePixel(XtAppContext, XrmValuePtr, XtPointer, XrmValuePtr,
+ Cardinal *);
#endif
-static boolean FDECL(new_resource_macro, (String, unsigned));
-static void NDECL(load_default_resources);
-static void NDECL(release_default_resources);
-static int FDECL(panic_on_error, (Display *, XErrorEvent *));
+static boolean new_resource_macro(String, unsigned);
+static void load_default_resources(void);
+static void release_default_resources(void);
+static int panic_on_error(Display *, XErrorEvent *);
#ifdef X11_HANGUP_SIGNAL
-static void FDECL(X11_sig, (int));
-static void FDECL(X11_sig_cb, (XtPointer, XtSignalId *));
+static void X11_sig(int);
+static void X11_sig_cb(XtPointer, XtSignalId *);
#endif
-static void FDECL(d_timeout, (XtPointer, XtIntervalId *));
-static void FDECL(X11_hangup, (Widget, XEvent *, String *, Cardinal *));
-static void FDECL(X11_bail, (const char *));
-static void FDECL(askname_delete, (Widget, XEvent *, String *, Cardinal *));
-static void FDECL(askname_done, (Widget, XtPointer, XtPointer));
-static void FDECL(done_button, (Widget, XtPointer, XtPointer));
-static void FDECL(getline_delete, (Widget, XEvent *, String *, Cardinal *));
-static void FDECL(abort_button, (Widget, XtPointer, XtPointer));
-static void NDECL(release_getline_widgets);
-static void FDECL(yn_delete, (Widget, XEvent *, String *, Cardinal *));
-static void FDECL(yn_key, (Widget, XEvent *, String *, Cardinal *));
-static void NDECL(release_yn_widgets);
-static int FDECL(input_event, (int));
-static void FDECL(win_visible, (Widget, XtPointer, XEvent *, Boolean *));
-static void NDECL(init_standard_windows);
+static void d_timeout(XtPointer, XtIntervalId *);
+static void X11_hangup(Widget, XEvent *, String *, Cardinal *);
+static void X11_bail(const char *);
+static void askname_delete(Widget, XEvent *, String *, Cardinal *);
+static void askname_done(Widget, XtPointer, XtPointer);
+static void done_button(Widget, XtPointer, XtPointer);
+static void getline_delete(Widget, XEvent *, String *, Cardinal *);
+static void abort_button(Widget, XtPointer, XtPointer);
+static void release_getline_widgets(void);
+static void yn_delete(Widget, XEvent *, String *, Cardinal *);
+static void yn_key(Widget, XEvent *, String *, Cardinal *);
+static void release_yn_widgets(void);
+static int input_event(int);
+static void win_visible(Widget, XtPointer, XEvent *, Boolean *);
+static void init_standard_windows(void);
/*
* Local variables.
static Pixmap icon_pixmap = None; /* Pixmap for icon. */
void
-X11_putmsghistory(msg, is_restoring)
-const char *msg;
-boolean is_restoring;
+X11_putmsghistory(const char *msg, boolean is_restoring)
{
if (WIN_MESSAGE != WIN_ERR) {
struct xwindow *wp = &window_list[WIN_MESSAGE];
}
char *
-X11_getmsghistory(init)
-boolean init;
+X11_getmsghistory(boolean init)
{
if (WIN_MESSAGE != WIN_ERR) {
static struct line_element *curr = (struct line_element *) 0;
* that this is not the popup widget, nor the viewport, but the child.
*/
struct xwindow *
-find_widget(w)
-Widget w;
+find_widget(Widget w)
{
int windex;
struct xwindow *wp;
* Find a free window slot for use.
*/
static winid
-find_free_window()
+find_free_window(void)
{
int windex;
struct xwindow *wp;
XColor
-get_nhcolor(wp, clr)
-struct xwindow *wp;
-int clr;
+get_nhcolor(struct xwindow *wp, int clr)
{
init_menu_nhcolors(wp);
/* FIXME: init_menu_nhcolors may fail */
}
void
-init_menu_nhcolors(wp)
-struct xwindow *wp;
+init_menu_nhcolors(struct xwindow *wp)
{
static const char *mapCLR_to_res[CLR_MAX] = {
XtNblack,
* Return True if something close was found.
*/
Boolean
-nhApproxColor(screen, colormap, str, color)
-Screen *screen; /* screen to use */
-Colormap colormap; /* the colormap to use */
-char *str; /* color name */
-XColor *color; /* the X color structure; changed only if successful */
+nhApproxColor(Screen *screen, /* screen to use */
+ Colormap colormap, /* the colormap to use */
+ char *str, /* color name */
+ XColor *color) /* the X color structure; changed only if successful */
{
int ncells;
long cdiff = 16777216; /* 2^24; hopefully our map is smaller */
}
Boolean
-nhCvtStringToPixel(dpy, args, num_args, fromVal, toVal, closure_ret)
-Display *dpy;
-XrmValuePtr args;
-Cardinal *num_args;
-XrmValuePtr fromVal;
-XrmValuePtr toVal;
-XtPointer *closure_ret;
+nhCvtStringToPixel(Display *dpy, XrmValuePtr args, Cardinal *num_args,
+ XrmValuePtr fromVal, XrmValuePtr toVal,
+ XtPointer *closure_ret)
{
String str = (String) fromVal->addr;
XColor screenColor;
/* Ask the WM for window frame size */
void
-get_window_frame_extents(w, top, bottom, left, right)
-Widget w;
-long *top, *bottom, *left, *right;
+get_window_frame_extents(Widget w, long *top, long *bottom, long *left, long *right)
{
XEvent event;
Display *dpy = XtDisplay(w);
}
void
-get_widget_window_geometry(w, x,y, width, height)
-Widget w;
-int *x, *y, *width, *height;
+get_widget_window_geometry(Widget w, int *x, int *y, int *width, int *height)
{
long top, bottom, left, right;
Arg args[5];
/* Change the full font name string so the weight is "bold" */
char *
-fontname_boldify(fontname)
-const char *fontname;
+fontname_boldify(const char *fontname)
{
static char buf[BUFSZ];
char *bufp = buf;
}
void
-load_boldfont(wp, w)
-struct xwindow *wp;
-Widget w;
+load_boldfont(struct xwindow *wp, Widget w)
{
Arg args[1];
XFontStruct *fs;
#ifdef TEXTCOLOR
/* ARGSUSED */
static void
-nhFreePixel(app, toVal, closure, args, num_args)
-XtAppContext app;
-XrmValuePtr toVal;
-XtPointer closure;
-XrmValuePtr args;
-Cardinal *num_args;
+nhFreePixel(XtAppContext app,
+ XrmValuePtr toVal,
+ XtPointer closure,
+ XrmValuePtr args,
+ Cardinal *num_args)
{
Screen *screen;
Colormap colormap;
* assumption of ascent + descent is not always valid.
*/
Dimension
-nhFontHeight(w)
-Widget w;
+nhFontHeight(Widget w)
{
#ifdef _XawTextSink_h
Widget sink;
/* caller found "#define"; parse into macro name and its expansion value */
static boolean
-new_resource_macro(inbuf, numdefs)
-String inbuf; /* points past '#define' rather than to start of buffer */
-unsigned numdefs; /* array slot to fill */
+new_resource_macro(String inbuf, /* points past '#define' rather than to start of buffer */
+ unsigned numdefs) /* array slot to fill */
{
String p, q;
/* read the template NetHack.ad into default_resource_data[] to supply
fallback resources to XtAppInitialize() */
static void
-load_default_resources()
+load_default_resources(void)
{
FILE *fp;
String inbuf;
}
static void
-release_default_resources()
+release_default_resources(void)
{
if (default_resource_data) {
unsigned idx;
/* Global Functions ======================================================= */
void
-X11_raw_print(str)
-const char *str;
+X11_raw_print(const char *str)
{
(void) puts(str);
}
void
-X11_raw_print_bold(str)
-const char *str;
+X11_raw_print_bold(const char *str)
{
(void) puts(str);
}
void
-X11_curs(window, x, y)
-winid window;
-int x, y;
+X11_curs(winid window, int x, int y)
{
check_winid(window);
}
void
-X11_putstr(window, attr, str)
-winid window;
-int attr;
-const char *str;
+X11_putstr(winid window, int attr, const char *str)
{
winid new_win;
struct xwindow *wp;
/* We do event processing as a callback, so this is a null routine. */
void
-X11_get_nh_event()
+X11_get_nh_event(void)
{
return;
}
int
-X11_nhgetch()
+X11_nhgetch(void)
{
return input_event(EXIT_ON_KEY_PRESS);
}
int
-X11_nh_poskey(x, y, mod)
-int *x, *y, *mod;
+X11_nh_poskey(int *x, int *y, int *mod)
{
int val = input_event(EXIT_ON_KEY_OR_BUTTON_PRESS);
}
winid
-X11_create_nhwindow(type)
-int type;
+X11_create_nhwindow(int type)
{
winid window;
struct xwindow *wp;
}
void
-X11_clear_nhwindow(window)
-winid window;
+X11_clear_nhwindow(winid window)
{
struct xwindow *wp;
}
void
-X11_display_nhwindow(window, blocking)
-winid window;
-boolean blocking;
+X11_display_nhwindow(winid window, boolean blocking)
{
struct xwindow *wp;
}
void
-X11_destroy_nhwindow(window)
-winid window;
+X11_destroy_nhwindow(winid window)
{
struct xwindow *wp;
}
void
-X11_update_inventory()
+X11_update_inventory(void)
{
if (x_inited && window_list[WIN_INVEN].menu_information->is_up) {
updated_inventory = 1; /* hack to avoid mapping&raising window */
/* The current implementation has all of the saved lines on the screen. */
int
-X11_doprev_message()
+X11_doprev_message(void)
{
return 0;
}
void
-X11_nhbell()
+X11_nhbell(void)
{
/* We can't use XBell until toplevel has been initialized. */
if (x_inited)
}
void
-X11_mark_synch()
+X11_mark_synch(void)
{
if (x_inited) {
/*
}
void
-X11_wait_synch()
+X11_wait_synch(void)
{
if (x_inited)
XFlush(XtDisplay(toplevel));
/* Both resume_ and suspend_ are called from ioctl.c and unixunix.c. */
void
-X11_resume_nhwindows()
+X11_resume_nhwindows(void)
{
return;
}
/* ARGSUSED */
void
-X11_suspend_nhwindows(str)
-const char *str;
+X11_suspend_nhwindows(const char *str)
{
nhUse(str);
/* Under X, we don't need to initialize the number pad. */
/* ARGSUSED */
void
-X11_number_pad(state) /* called from options.c */
-int state;
+X11_number_pad(int state) /* called from options.c */
{
nhUse(state);
/* called from setftty() in unixtty.c */
void
-X11_start_screen()
+X11_start_screen(void)
{
return;
}
/* called from settty() in unixtty.c */
void
-X11_end_screen()
+X11_end_screen(void)
{
return;
}
#ifdef GRAPHIC_TOMBSTONE
void
-X11_outrip(window, how, when)
-winid window;
-int how;
-time_t when;
+X11_outrip(winid window, int how, time_t when)
{
struct xwindow *wp;
FILE *rip_fp = 0;
};
static int
-panic_on_error(display, error)
-Display *display;
-XErrorEvent *error;
+panic_on_error(Display *display, XErrorEvent *error)
{
char buf[BUFSZ];
XGetErrorText(display, error->error_code, buf, BUFSZ);
}
void
-X11_init_nhwindows(argcp, argv)
-int *argcp;
-char **argv;
+X11_init_nhwindows(int *argcp, char **argv)
{
int i;
Cardinal num_args;
*/
/* ARGSUSED */
void
-X11_exit_nhwindows(dummy)
-const char *dummy;
+X11_exit_nhwindows(const char *dummy)
{
extern Pixmap tile_pixmap; /* from winmap.c */
#ifdef X11_HANGUP_SIGNAL
static void
-X11_sig(sig) /* Unix signal handler */
-int sig;
+X11_sig(int sig) /* Unix signal handler */
{
XtNoticeSignal(X11_sig_id);
hangup(sig);
}
static void
-X11_sig_cb(not_used, id)
-XtPointer not_used;
-XtSignalId *id;
+X11_sig_cb(XtPointer not_used, XtSignalId *id)
{
XEvent event;
XClientMessageEvent *mesg;
*/
/* ARGSUSED */
static void
-d_timeout(client_data, id)
-XtPointer client_data;
-XtIntervalId *id;
+d_timeout(XtPointer client_data, XtIntervalId *id)
{
XEvent event;
XClientMessageEvent *mesg;
* for a sent event.
*/
void
-X11_delay_output()
+X11_delay_output(void)
{
if (!x_inited)
return;
/* X11_hangup ------------------------------------------------------------- */
/* ARGSUSED */
static void
-X11_hangup(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+X11_hangup(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(w);
nhUse(event);
/* X11_bail --------------------------------------------------------------- */
/* clean up and quit */
static void
-X11_bail(mesg)
-const char *mesg;
+X11_bail(const char *mesg)
{
g.program_state.something_worth_saving = 0;
clearlocks();
/* askname ---------------------------------------------------------------- */
/* ARGSUSED */
static void
-askname_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+askname_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(event);
nhUse(params);
/* Callback for askname dialog widget. */
/* ARGSUSED */
static void
-askname_done(w, client_data, call_data)
-Widget w;
-XtPointer client_data;
-XtPointer call_data;
+askname_done(Widget w, XtPointer client_data, XtPointer call_data)
{
unsigned len;
char *s;
/* ask player for character's name to replace generic name "player" (or other
values; see config.h) after 'nethack -u player' or OPTIONS=name:player */
void
-X11_askname()
+X11_askname(void)
{
Widget popup, dialog;
Arg args[1];
/* Callback for getline dialog widget. */
/* ARGSUSED */
static void
-done_button(w, client_data, call_data)
-Widget w;
-XtPointer client_data;
-XtPointer call_data;
+done_button(Widget w, XtPointer client_data, XtPointer call_data)
{
int len;
char *s;
/* ARGSUSED */
static void
-getline_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+getline_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(event);
nhUse(params);
/* Callback for getline dialog widget. */
/* ARGSUSED */
static void
-abort_button(w, client_data, call_data)
-Widget w;
-XtPointer client_data;
-XtPointer call_data;
+abort_button(Widget w, XtPointer client_data, XtPointer call_data)
{
Widget dialog = (Widget) client_data;
}
static void
-release_getline_widgets()
+release_getline_widgets(void)
{
if (getline_dialog)
XtDestroyWidget(getline_dialog), getline_dialog = (Widget) 0;
}
void
-X11_getlin(question, input)
-const char *question;
-char *input;
+X11_getlin(const char *question, char *input)
{
getline_input = input;
/* uses a menu (with no selectors specified) rather than a text window
to allow previous_page and first_menu actions to move backwards */
void
-X11_display_file(str, complain)
-const char *str;
-boolean complain;
+X11_display_file(const char *str, boolean complain)
{
dlb *fp;
winid newwin;
* no conversion (i.e. just the CTRL key hit) a NUL is returned.
*/
char
-key_event_to_char(key)
-XKeyEvent *key;
+key_event_to_char(XKeyEvent *key)
{
char keystring[MAX_KEY_STRING];
int nbytes;
*/
/* ARGSUSED */
static void
-yn_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+yn_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(w);
nhUse(event);
*/
/* ARGSUSED */
static void
-yn_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+yn_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch;
/* called at exit time */
static void
-release_yn_widgets()
+release_yn_widgets(void)
{
if (yn_label)
XtDestroyWidget(yn_label), yn_label = (Widget) 0;
/* X11-specific edition of yn_function(), the routine called by the core
to show a prompt and get a single keystroke answer, often 'y' vs 'n' */
char
-X11_yn_function(ques, choices, def)
-const char *ques;
-const char *choices; /* string of possible response chars; any char if Null */
-char def; /* default response if user hits <space> or <return> */
+X11_yn_function(const char *ques,
+ const char *choices, /* string of possible response chars; any char if Null */
+ char def) /* default response if user hits <space> or <return> */
{
char buf[BUFSZ];
Arg args[4];
/* used when processing window-capability-specific run-time options;
we support toggling tiles on and off via iflags.wc_tiled_map */
void
-X11_preference_update(pref)
-const char *pref;
+X11_preference_update(const char *pref)
{
if (!strcmp(pref, "tiled_map")) {
if (WIN_MAP != WIN_ERR)
* do some pre-processing.
*/
static int
-input_event(exit_condition)
-int exit_condition;
+input_event(int exit_condition)
{
if (appResources.fancy_status && WIN_STATUS != WIN_ERR)
check_turn_events(); /* hilighting on the fancy status window */
/*ARGSUSED*/
void
-msgkey(w, data, event)
-Widget w;
-XtPointer data;
-XEvent *event;
+msgkey(Widget w, XtPointer data, XEvent *event)
{
Cardinal num = 0;
/* only called for autofocus */
/*ARGSUSED*/
static void
-win_visible(w, data, event, flag)
-Widget w;
-XtPointer data; /* client_data not used */
-XEvent *event;
-Boolean *flag; /* continue_to_dispatch flag not used */
+win_visible(Widget w, XtPointer data, /* client_data not used */
+ XEvent *event,
+ Boolean *flag) /* continue_to_dispatch flag not used */
{
XVisibilityEvent *vis_event = (XVisibilityEvent *) event;
part of the map when idle or to invert background and foreground when
a prompt is active */
void
-highlight_yn(init)
-boolean init;
+highlight_yn(boolean init)
{
struct xwindow *xmap;
* than using a popup.
*/
static void
-init_standard_windows()
+init_standard_windows(void)
{
Widget form, message_viewport, map_viewport, status;
Arg args[8];
}
void
-nh_XtPopup(w, grb, childwid)
-Widget w; /* widget */
-int grb; /* type of grab */
-Widget childwid; /* child to receive focus (can be None) */
+nh_XtPopup(Widget w, /* widget */
+ int grb, /* type of grab */
+ Widget childwid) /* child to receive focus (can be None) */
{
XtPopup(w, (XtGrabKind) grb);
XSetWMProtocols(XtDisplay(w), XtWindow(w), &wm_delete_window, 1);
}
void
-nh_XtPopdown(w)
-Widget w;
+nh_XtPopdown(Widget w)
{
XtPopdown(w);
if (appResources.autofocus)
}
void
-win_X11_init(dir)
-int dir;
+win_X11_init(int dir)
{
if (dir != WININIT)
return;
}
void
-find_scrollbars(w, horiz, vert)
-Widget w;
-Widget *horiz, *vert;
+find_scrollbars(Widget w, Widget *horiz, Widget *vert)
{
if (w) {
do {
*/
/*ARGSUSED*/
void
-nh_keyscroll(viewport, event, params, num_params)
-Widget viewport;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+nh_keyscroll(Widget viewport, XEvent *event, String *params,
+ Cardinal *num_params)
{
Arg arg[2];
Widget horiz_sb = (Widget) 0, vert_sb = (Widget) 0;
#define COL0_OFFSET 1 /* change to 0 to revert to displaying unused column 0 */
-static boolean FDECL(init_tiles, (struct xwindow *));
-static void FDECL(set_button_values, (Widget, int, int, unsigned));
-static void FDECL(map_check_size_change, (struct xwindow *));
-static void FDECL(map_update, (struct xwindow *, int, int, int, int,
- BOOLEAN_P));
-static void FDECL(init_text, (struct xwindow *));
-static void FDECL(map_exposed, (Widget, XtPointer, XtPointer));
-static void FDECL(set_gc, (Widget, Font, const char *, Pixel, GC *, GC *));
-static void FDECL(get_text_gc, (struct xwindow *, Font));
-static void FDECL(map_all_unexplored, (struct map_info_t *));
-static void FDECL(get_char_info, (struct xwindow *));
-static void FDECL(display_cursor, (struct xwindow *));
+static boolean init_tiles(struct xwindow *);
+static void set_button_values(Widget, int, int, unsigned);
+static void map_check_size_change(struct xwindow *);
+static void map_update(struct xwindow *, int, int, int, int, boolean);
+static void init_text(struct xwindow *);
+static void map_exposed(Widget, XtPointer, XtPointer);
+static void set_gc(Widget, Font, const char *, Pixel, GC *, GC *);
+static void get_text_gc(struct xwindow *, Font);
+static void map_all_unexplored(struct map_info_t *);
+static void get_char_info(struct xwindow *);
+static void display_cursor(struct xwindow *);
/* Global functions ======================================================= */
void
-X11_print_glyph(window, x, y, glyphinfo, bkglyphinfo)
-winid window;
-xchar x, y;
-const glyph_info *glyphinfo;
-const glyph_info *bkglyphinfo UNUSED;
+X11_print_glyph(winid window, xchar x, xchar y, const glyph_info *glyphinfo,
+ const glyph_info *bkglyphinfo UNUSED)
{
struct map_info_t *map_info;
boolean update_bbox = FALSE;
*/
/*ARGSUSED*/
void
-X11_cliparound(x, y)
-int x UNUSED;
-int y UNUSED;
+X11_cliparound(int x UNUSED, int y UNUSED)
{
return;
}
static struct tile_annotation pile_annotation;
static void
-init_annotation(annotation, filename, colorpixel)
-struct tile_annotation *annotation;
-char *filename;
-Pixel colorpixel;
+init_annotation(struct tile_annotation *annotation, char *filename, Pixel colorpixel)
{
Display *dpy = XtDisplay(toplevel);
* map viewport.
*/
void
-post_process_tiles()
+post_process_tiles(void)
{
Display *dpy = XtDisplay(toplevel);
unsigned int width, height;
* Return FALSE otherwise.
*/
static boolean
-init_tiles(wp)
-struct xwindow *wp;
+init_tiles(struct xwindow *wp)
{
#ifdef USE_XPM
XpmAttributes attributes;
* Make sure the map's cursor is always visible.
*/
void
-check_cursor_visibility(wp)
-struct xwindow *wp;
+check_cursor_visibility(struct xwindow *wp)
{
Arg arg[2];
Widget viewport, horiz_sb, vert_sb;
* on the screen when the user resizes the nethack window.
*/
static void
-map_check_size_change(wp)
-struct xwindow *wp;
+map_check_size_change(struct xwindow *wp)
{
struct map_info_t *map_info = wp->map_information;
Arg arg[2];
* by querying the widget with the resource name.
*/
static void
-set_gc(w, font, resource_name, bgpixel, regular, inverse)
-Widget w;
-Font font;
-const char *resource_name;
-Pixel bgpixel;
-GC *regular, *inverse;
+set_gc(Widget w, Font font, const char *resource_name, Pixel bgpixel,
+ GC *regular, GC *inverse)
{
XGCValues values;
XtGCMask mask = GCFunction | GCForeground | GCBackground | GCFont;
* background colors on the current GC as needed.
*/
static void
-get_text_gc(wp, font)
-struct xwindow *wp;
-Font font;
+get_text_gc(struct xwindow *wp, Font font)
{
struct map_info_t *map_info = wp->map_information;
Pixel bgpixel;
* Display the cursor on the map window.
*/
static void
-display_cursor(wp)
-struct xwindow *wp;
+display_cursor(struct xwindow *wp)
{
/* Redisplay the cursor location inverted. */
map_update(wp, wp->cursy, wp->cursy, wp->cursx, wp->cursx, TRUE);
* the screen.
*/
void
-display_map_window(wp)
-struct xwindow *wp;
+display_map_window(struct xwindow *wp)
{
register int row;
struct map_info_t *map_info = wp->map_information;
* (Actually, column 0 is set to S_nothing and 1..COLNO-1 to S_unexplored.)
*/
static void
-map_all_unexplored(map_info) /* [was map_all_stone()] */
-struct map_info_t *map_info;
+map_all_unexplored(struct map_info_t *map_info) /* [was map_all_stone()] */
{
int x, y;
/* unsigned short g_stone = cmap_to_glyph(S_stone); */
* display_map_window().
*/
void
-clear_map_window(wp)
-struct xwindow *wp;
+clear_map_window(struct xwindow *wp)
{
struct map_info_t *map_info = wp->map_information;
* that are used when updating it.
*/
static void
-get_char_info(wp)
-struct xwindow *wp;
+get_char_info(struct xwindow *wp)
{
XFontStruct *fs;
struct map_info_t *map_info = wp->map_information;
* Keyboard and button event handler for map window.
*/
void
-map_input(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+map_input(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
XKeyEvent *key;
XButtonEvent *button;
}
static void
-set_button_values(w, x, y, button)
-Widget w;
-int x;
-int y;
-unsigned int button;
+set_button_values(Widget w, int x, int y, unsigned int button)
{
struct xwindow *wp;
struct map_info_t *map_info;
*/
/*ARGSUSED*/
static void
-map_exposed(w, client_data, widget_data)
-Widget w;
-XtPointer client_data; /* unused */
-XtPointer widget_data; /* expose event from Window widget */
+map_exposed(Widget w, XtPointer client_data, /* unused */
+ XtPointer widget_data) /* expose event from Window widget */
{
int x, y;
struct xwindow *wp;
* The start and stop columns are *inclusive*.
*/
static void
-map_update(wp, start_row, stop_row, start_col, stop_col, inverted)
-struct xwindow *wp;
-int start_row, stop_row, start_col, stop_col;
-boolean inverted;
+map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int stop_col, boolean inverted)
{
int win_start_row, win_start_col;
struct map_info_t *map_info = wp->map_information;
/* Adjust the number of rows and columns on the given map window */
void
-set_map_size(wp, cols, rows)
-struct xwindow *wp;
-Dimension cols, rows;
+set_map_size(struct xwindow *wp, Dimension cols, Dimension rows)
{
Arg args[4];
Cardinal num_args;
}
static void
-init_text(wp)
-struct xwindow *wp;
+init_text(struct xwindow *wp)
{
struct map_info_t *map_info = wp->map_information;
* The map window creation routine.
*/
void
-create_map_window(wp, create_popup, parent)
-struct xwindow *wp;
-boolean create_popup; /* parent is a popup shell that we create */
-Widget parent;
+create_map_window(struct xwindow *wp,
+ boolean create_popup, /* parent is a popup shell that we create */
+ Widget parent)
{
struct map_info_t *map_info; /* map info pointer */
Widget map, viewport;
* Destroy this map window.
*/
void
-destroy_map_window(wp)
-struct xwindow *wp;
+destroy_map_window(struct xwindow *wp)
{
struct map_info_t *map_info = wp->map_information;
#if 0 /*******/
void
-pkey(k)
-int k;
+pkey(int k)
{
printf("key = '%s%c'\n", (k < 32) ? "^" : "", (k < 32) ? '@' + k : k);
}
* under certain circumstances.
*/
int
-x_event(exit_condition)
-int exit_condition;
+x_event(int exit_condition)
{
XEvent event;
int retval = 0;
#include "hack.h"
#include "winX.h"
-static void FDECL(menu_size_change_handler, (Widget, XtPointer,
- XEvent *, Boolean *));
-static void FDECL(menu_select, (Widget, XtPointer, XtPointer));
-static void FDECL(invert_line, (struct xwindow *, x11_menu_item *, int, long));
-static void FDECL(menu_ok, (Widget, XtPointer, XtPointer));
-static void FDECL(menu_cancel, (Widget, XtPointer, XtPointer));
-static void FDECL(menu_all, (Widget, XtPointer, XtPointer));
-static void FDECL(menu_none, (Widget, XtPointer, XtPointer));
-static void FDECL(menu_invert, (Widget, XtPointer, XtPointer));
-static void FDECL(menu_search, (Widget, XtPointer, XtPointer));
-static void FDECL(search_menu, (struct xwindow *));
-static void FDECL(select_all, (struct xwindow *));
-static void FDECL(select_none, (struct xwindow *));
-static void FDECL(select_match, (struct xwindow *, char *));
-static void FDECL(invert_all, (struct xwindow *));
-static void FDECL(invert_match, (struct xwindow *, char *));
-static void FDECL(menu_popdown, (struct xwindow *));
-static Widget FDECL(menu_create_buttons, (struct xwindow *, Widget, Widget));
-static void FDECL(menu_create_entries, (struct xwindow *, struct menu *));
-static void FDECL(destroy_menu_entry_widgets, (struct xwindow *));
-static void NDECL(create_menu_translation_tables);
-
-static void FDECL(move_menu, (struct menu *, struct menu *));
-static void FDECL(free_menu_line_entries, (struct menu *));
-static void FDECL(free_menu, (struct menu *));
-static void FDECL(reset_menu_to_default, (struct menu *));
-static void FDECL(clear_old_menu, (struct xwindow *));
-static char *FDECL(copy_of, (const char *));
+static void menu_size_change_handler(Widget, XtPointer, XEvent *,
+ Boolean *);
+static void menu_select(Widget, XtPointer, XtPointer);
+static void invert_line(struct xwindow *, x11_menu_item *, int, long);
+static void menu_ok(Widget, XtPointer, XtPointer);
+static void menu_cancel(Widget, XtPointer, XtPointer);
+static void menu_all(Widget, XtPointer, XtPointer);
+static void menu_none(Widget, XtPointer, XtPointer);
+static void menu_invert(Widget, XtPointer, XtPointer);
+static void menu_search(Widget, XtPointer, XtPointer);
+static void search_menu(struct xwindow *);
+static void select_all(struct xwindow *);
+static void select_none(struct xwindow *);
+static void select_match(struct xwindow *, char *);
+static void invert_all(struct xwindow *);
+static void invert_match(struct xwindow *, char *);
+static void menu_popdown(struct xwindow *);
+static Widget menu_create_buttons(struct xwindow *, Widget, Widget);
+static void menu_create_entries(struct xwindow *, struct menu *);
+static void destroy_menu_entry_widgets(struct xwindow *);
+static void create_menu_translation_tables(void);
+
+static void move_menu(struct menu *, struct menu *);
+static void free_menu_line_entries(struct menu *);
+static void free_menu(struct menu *);
+static void reset_menu_to_default(struct menu *);
+static void clear_old_menu(struct xwindow *);
+static char *copy_of(const char *);
#define reset_menu_count(mi) ((mi)->counting = FALSE, (mi)->menu_count = 0L)
XtTranslations menu_del_translation_table = (XtTranslations) 0;
static void
-create_menu_translation_tables()
+create_menu_translation_tables(void)
{
if (!menu_translation_table) {
menu_translation_table = XtParseTranslationTable(menu_translations);
/*ARGSUSED*/
static void
-menu_size_change_handler(w, ptr, event, flag)
-Widget w;
-XtPointer ptr;
-XEvent *event;
-Boolean *flag;
+menu_size_change_handler(Widget w, XtPointer ptr, XEvent *event, Boolean *flag)
{
struct xwindow *wp = (struct xwindow *) ptr;
*/
/* ARGSUSED */
static void
-menu_select(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_select(Widget w, XtPointer client_data, XtPointer call_data)
{
struct menu_info_t *menu_info;
long how_many;
*/
/* ARGSUSED */
void
-menu_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+menu_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(event);
nhUse(params);
*/
/*ARGSUSED*/
static void
-invert_line(wp, curr, which, how_many)
-struct xwindow *wp;
-x11_menu_item *curr;
-int which;
-long how_many;
+invert_line(struct xwindow *wp, x11_menu_item *curr, int which, long how_many)
{
Arg args[2];
*/
/* ARGSUSED */
void
-menu_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+menu_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
struct menu_info_t *menu_info;
x11_menu_item *curr;
/* ARGSUSED */
static void
-menu_ok(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_ok(Widget w, XtPointer client_data, XtPointer call_data)
{
struct xwindow *wp = (struct xwindow *) client_data;
/* ARGSUSED */
static void
-menu_cancel(w, client_data, call_data)
-Widget w; /* don't use - may be None */
-XtPointer client_data, call_data;
+menu_cancel(Widget w, /* don't use - may be None */
+ XtPointer client_data, XtPointer call_data)
{
struct xwindow *wp = (struct xwindow *) client_data;
/* ARGSUSED */
static void
-menu_all(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_all(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(call_data);
/* ARGSUSED */
static void
-menu_none(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_none(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(call_data);
/* ARGSUSED */
static void
-menu_invert(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_invert(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(call_data);
/* ARGSUSED */
static void
-menu_search(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+menu_search(Widget w, XtPointer client_data, XtPointer call_data)
{
struct xwindow *wp = (struct xwindow *) client_data;
struct menu_info_t *menu_info = wp->menu_information;
/* common to menu_search and menu_key */
static void
-search_menu(wp)
-struct xwindow *wp;
+search_menu(struct xwindow *wp)
{
char *pat, buf[BUFSZ + 2]; /* room for '*' + BUFSZ-1 + '*' + '\0' */
struct menu_info_t *menu_info = wp->menu_information;
}
static void
-select_all(wp)
-struct xwindow *wp;
+select_all(struct xwindow *wp)
{
x11_menu_item *curr;
int count;
}
static void
-select_none(wp)
-struct xwindow *wp;
+select_none(struct xwindow *wp)
{
x11_menu_item *curr;
int count;
}
static void
-invert_all(wp)
-struct xwindow *wp;
+invert_all(struct xwindow *wp)
{
x11_menu_item *curr;
int count;
}
static void
-invert_match(wp, match)
-struct xwindow *wp;
-char *match; /* wildcard pattern for pmatch() */
+invert_match(struct xwindow *wp,
+ char *match) /* wildcard pattern for pmatch() */
{
x11_menu_item *curr;
int count;
}
static void
-select_match(wp, match)
-struct xwindow *wp;
-char *match; /* wildcard pattern for pmatch() */
+select_match(struct xwindow *wp,
+ char *match) /* wildcard pattern for pmatch() */
{
x11_menu_item *curr, *found = 0;
int count;
}
static void
-menu_popdown(wp)
-struct xwindow *wp;
+menu_popdown(struct xwindow *wp)
{
nh_XtPopdown(wp->popup); /* remove the event grab */
XtDestroyWidget(wp->popup);
/* Global functions ======================================================= */
void
-X11_start_menu(window, mbehavior)
-winid window;
-unsigned long mbehavior UNUSED;
+X11_start_menu(winid window, unsigned long mbehavior UNUSED)
{
struct xwindow *wp;
check_winid(window);
/*ARGSUSED*/
void
-X11_add_menu(window, glyphinfo, identifier, ch, gch, attr, str, itemflags)
-winid window;
-const glyph_info *glyphinfo UNUSED;
-const anything *identifier;
-char ch;
-char gch; /* group accelerator (0 = no group) */
-int attr;
-const char *str;
-unsigned itemflags;
+X11_add_menu(winid window,
+ const glyph_info *glyphinfo UNUSED,
+ const anything *identifier,
+ char ch,
+ char gch, /* group accelerator (0 = no group) */
+ int attr,
+ const char *str, unsigned itemflags)
{
x11_menu_item *item;
struct menu_info_t *menu_info;
}
void
-X11_end_menu(window, query)
-winid window;
-const char *query;
+X11_end_menu(winid window, const char *query)
{
struct menu_info_t *menu_info;
}
int
-X11_select_menu(window, how, menu_list)
-winid window;
-int how;
-menu_item **menu_list;
+X11_select_menu(winid window, int how, menu_item **menu_list)
{
x11_menu_item *curr;
struct xwindow *wp;
* zero length.
*/
static char *
-copy_of(s)
-const char *s;
+copy_of(const char *s)
{
if (!s)
s = "";
* Create ok, cancel, all, none, invert, and search buttons.
*/
static Widget
-menu_create_buttons(wp, form, under)
-struct xwindow *wp;
-Widget form,under;
+menu_create_buttons(struct xwindow *wp, Widget form, Widget under)
{
Arg args[15];
Cardinal num_args;
}
static void
-menu_create_entries(wp, curr_menu)
-struct xwindow *wp;
-struct menu *curr_menu;
+menu_create_entries(struct xwindow *wp, struct menu *curr_menu)
{
x11_menu_item *curr;
int menulineidx = 0;
}
static void
-destroy_menu_entry_widgets(wp)
-struct xwindow *wp;
+destroy_menu_entry_widgets(struct xwindow *wp)
{
WidgetList wlist;
Cardinal numchild;
}
static void
-move_menu(src_menu, dest_menu)
-struct menu *src_menu, *dest_menu;
+move_menu(struct menu *src_menu, struct menu *dest_menu)
{
free_menu(dest_menu); /* toss old menu */
*dest_menu = *src_menu; /* make new menu current */
}
static void
-free_menu_line_entries(mp)
-struct menu *mp;
+free_menu_line_entries(struct menu *mp)
{
/* We're not freeing menu entry widgets here, but let XtDestroyWidget()
on the parent widget take care of that */
}
static void
-free_menu(mp)
-struct menu *mp;
+free_menu(struct menu *mp)
{
free_menu_line_entries(mp);
if (mp->query)
}
static void
-reset_menu_to_default(mp)
-struct menu *mp;
+reset_menu_to_default(struct menu *mp)
{
mp->base = mp->last = (x11_menu_item *) 0;
mp->query = (const char *) 0;
}
static void
-clear_old_menu(wp)
-struct xwindow *wp;
+clear_old_menu(struct xwindow *wp)
{
struct menu_info_t *menu_info = wp->menu_information;
}
void
-create_menu_window(wp)
-struct xwindow *wp;
+create_menu_window(struct xwindow *wp)
{
wp->type = NHW_MENU;
wp->menu_information =
}
void
-destroy_menu_window(wp)
-struct xwindow *wp;
+destroy_menu_window(struct xwindow *wp)
{
clear_old_menu(wp); /* this will also destroy the widgets */
free((genericptr_t) wp->menu_information);
#include "hack.h"
#include "winX.h"
-static struct line_element *FDECL(get_previous, (struct line_element *));
-static void FDECL(set_circle_buf, (struct mesg_info_t *, int));
-static char *FDECL(split, (char *, XFontStruct *, DIMENSION_P));
-static void FDECL(add_line, (struct mesg_info_t *, const char *));
-static void FDECL(redraw_message_window, (struct xwindow *));
-static void FDECL(mesg_check_size_change, (struct xwindow *));
-static void FDECL(mesg_exposed, (Widget, XtPointer, XtPointer));
-static void FDECL(get_gc, (Widget, struct mesg_info_t *));
-static void FDECL(mesg_resized, (Widget, XtPointer, XtPointer));
+static struct line_element *get_previous(struct line_element *);
+static void set_circle_buf(struct mesg_info_t *, int);
+static char *split(char *, XFontStruct *, Dimension);
+static void add_line(struct mesg_info_t *, const char *);
+static void redraw_message_window(struct xwindow *);
+static void mesg_check_size_change(struct xwindow *);
+static void mesg_exposed(Widget, XtPointer, XtPointer);
+static void get_gc(Widget, struct mesg_info_t *);
+static void mesg_resized(Widget, XtPointer, XtPointer);
static char mesg_translations[] = "#override\n\
<Key>Left: scroll(4)\n\
/* Move the message window's vertical scrollbar's slider to the bottom. */
void
-set_message_slider(wp)
-struct xwindow *wp;
+set_message_slider(struct xwindow *wp)
{
Widget scrollbar;
float top;
}
void
-create_message_window(wp, create_popup, parent)
-struct xwindow *wp; /* window pointer */
-boolean create_popup;
-Widget parent;
+create_message_window(struct xwindow *wp, /* window pointer */
+ boolean create_popup, Widget parent)
{
Arg args[8];
Cardinal num_args;
}
void
-destroy_message_window(wp)
-struct xwindow *wp;
+destroy_message_window(struct xwindow *wp)
{
if (wp->popup) {
nh_XtPopdown(wp->popup);
/* Redraw message window if new lines have been added. */
void
-display_message_window(wp)
-struct xwindow *wp;
+display_message_window(struct xwindow *wp)
{
set_message_slider(wp);
if (wp->mesg_information->dirty)
* rendering of the text is too long for the window.
*/
void
-append_message(wp, str)
-struct xwindow *wp;
-const char *str;
+append_message(struct xwindow *wp, const char *str)
{
char *mark, *remainder, buf[BUFSZ];
* element.
*/
static struct line_element *
-get_previous(mark)
-struct line_element *mark;
+get_previous(struct line_element *mark)
{
struct line_element *curr;
* are no longer used.
*/
static void
-set_circle_buf(mesg_info, count)
-struct mesg_info_t *mesg_info;
-int count;
+set_circle_buf(struct mesg_info_t *mesg_info, int count)
{
int i;
struct line_element *tail, *curr, *head;
* not, back up from the end by words until we find a place to split.
*/
static char *
-split(s, fs, pixel_width)
-char *s;
-XFontStruct *fs; /* Font for the window. */
-Dimension pixel_width;
+split(char *s,
+ XFontStruct *fs, /* Font for the window. */
+ Dimension pixel_width)
{
char save, *end, *remainder;
* one.
*/
static void
-add_line(mesg_info, s)
-struct mesg_info_t *mesg_info;
-const char *s;
+add_line(struct mesg_info_t *mesg_info, const char *s)
{
register struct line_element *curr = mesg_info->head;
register int new_line_length = strlen(s);
* line above this saved pointer.
*/
void
-set_last_pause(wp)
-struct xwindow *wp;
+set_last_pause(struct xwindow *wp)
{
register struct mesg_info_t *mesg_info = wp->mesg_information;
}
static void
-redraw_message_window(wp)
-struct xwindow *wp;
+redraw_message_window(struct xwindow *wp)
{
struct mesg_info_t *mesg_info = wp->mesg_information;
register struct line_element *curr;
* move the vertical slider to the bottom.
*/
static void
-mesg_check_size_change(wp)
-struct xwindow *wp;
+mesg_check_size_change(struct xwindow *wp)
{
struct mesg_info_t *mesg_info = wp->mesg_information;
Arg arg[2];
/* Event handler for message window expose events. */
/*ARGSUSED*/
static void
-mesg_exposed(w, client_data, widget_data)
-Widget w;
-XtPointer client_data; /* unused */
-XtPointer widget_data; /* expose event from Window widget */
+mesg_exposed(Widget w,
+ XtPointer client_data, /* unused */
+ XtPointer widget_data) /* expose event from Window widget */
{
XExposeEvent *event = (XExposeEvent *) widget_data;
}
static void
-get_gc(w, mesg_info)
-Widget w;
-struct mesg_info_t *mesg_info;
+get_gc(Widget w, struct mesg_info_t *mesg_info)
{
XGCValues values;
XtGCMask mask = GCFunction | GCForeground | GCBackground | GCFont;
*/
/* ARGSUSED */
static void
-mesg_resized(w, client_data, call_data)
-Widget w;
-XtPointer call_data, client_data;
+mesg_resized(Widget w, XtPointer call_data, XtPointer client_data)
{
Arg args[4];
Cardinal num_args;
<Btn4Down>: scroll(8)\n\
<Btn5Down>: scroll(2)";
-static void NDECL(plsel_dialog_acceptvalues);
-static void FDECL(plsel_set_play_button, (BOOLEAN_P));
-static void FDECL(plsel_set_sensitivities, (BOOLEAN_P));
-static void NDECL(X11_player_selection_randomize);
-static void NDECL(X11_player_selection_setupOthers);
-static void FDECL(racetoggleCallback, (Widget, XtPointer, XtPointer));
-static void FDECL(roletoggleCallback, (Widget, XtPointer, XtPointer));
-static void FDECL(gendertoggleCallback, (Widget, XtPointer, XtPointer));
-static void FDECL(aligntoggleCallback, (Widget, XtPointer, XtPointer));
-static void FDECL(plsel_random_btn_callback, (Widget, XtPointer, XtPointer));
-static void FDECL(plsel_play_btn_callback, (Widget, XtPointer, XtPointer));
-static void FDECL(plsel_quit_btn_callback, (Widget, XtPointer, XtPointer));
-static Widget FDECL(X11_create_player_selection_name, (Widget));
-static void NDECL(X11_player_selection_dialog);
-static void NDECL(X11_player_selection_prompts);
-static void FDECL(ps_quit, (Widget, XtPointer, XtPointer));
-static void FDECL(ps_random, (Widget, XtPointer, XtPointer));
-static void FDECL(ps_select, (Widget, XtPointer, XtPointer));
-static void FDECL(extend_select, (Widget, XtPointer, XtPointer));
-static void FDECL(extend_dismiss, (Widget, XtPointer, XtPointer));
-static void FDECL(extend_help, (Widget, XtPointer, XtPointer));
-static void FDECL(popup_delete, (Widget, XEvent *, String *, Cardinal *));
-static void NDECL(ec_dismiss);
-static void FDECL(ec_scroll_to_view, (int));
-static void NDECL(init_extended_commands_popup);
-static Widget FDECL(make_menu, (const char *, const char *, const char *,
- const char *, XtCallbackProc, const char *,
- XtCallbackProc, int, const char **,
- Widget **, XtCallbackProc, Widget *));
+static void plsel_dialog_acceptvalues(void);
+static void plsel_set_play_button(boolean);
+static void plsel_set_sensitivities(boolean);
+static void X11_player_selection_randomize(void);
+static void X11_player_selection_setupOthers(void);
+static void racetoggleCallback(Widget, XtPointer, XtPointer);
+static void roletoggleCallback(Widget, XtPointer, XtPointer);
+static void gendertoggleCallback(Widget, XtPointer, XtPointer);
+static void aligntoggleCallback(Widget, XtPointer, XtPointer);
+static void plsel_random_btn_callback(Widget, XtPointer, XtPointer);
+static void plsel_play_btn_callback(Widget, XtPointer, XtPointer);
+static void plsel_quit_btn_callback(Widget, XtPointer, XtPointer);
+static Widget X11_create_player_selection_name(Widget);
+static void X11_player_selection_dialog(void);
+static void X11_player_selection_prompts(void);
+static void ps_quit(Widget, XtPointer, XtPointer);
+static void ps_random(Widget, XtPointer, XtPointer);
+static void ps_select(Widget, XtPointer, XtPointer);
+static void extend_select(Widget, XtPointer, XtPointer);
+static void extend_dismiss(Widget, XtPointer, XtPointer);
+static void extend_help(Widget, XtPointer, XtPointer);
+static void popup_delete(Widget, XEvent *, String *, Cardinal *);
+static void ec_dismiss(void);
+static void ec_scroll_to_view(int);
+static void init_extended_commands_popup(void);
+static Widget make_menu(const char *, const char *, const char *, const char *,
+ XtCallbackProc, const char *, XtCallbackProc, int,
+ const char **, Widget **, XtCallbackProc, Widget *);
/* Bad Hack alert. Using integers instead of XtPointers */
XtPointer
-i2xtp(i)
-int i;
+i2xtp(int i)
{
return (XtPointer) (ptrdiff_t) i;
}
int
-xtp2i(x)
-XtPointer x;
+xtp2i(XtPointer x)
{
return (int) (ptrdiff_t) x;
}
/* Player Selection ------------------------------------------------------- */
/* ARGSUSED */
static void
-ps_quit(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+ps_quit(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(client_data);
/* ARGSUSED */
static void
-ps_random(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+ps_random(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(client_data);
/* ARGSUSED */
static void
-ps_select(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+ps_select(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(call_data);
/* ARGSUSED */
void
-ps_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+ps_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch, *mark;
char rolechars[QBUFSZ];
/* ARGSUSED */
void
-race_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+race_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch, *mark;
char racechars[QBUFSZ];
/* ARGSUSED */
void
-gend_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+gend_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch, *mark;
static char gendchars[] = "mf";
/* ARGSUSED */
void
-algn_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+algn_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch, *mark;
static char algnchars[] = "LNC";
Widget plsel_btn_play;
static void
-plsel_dialog_acceptvalues()
+plsel_dialog_acceptvalues(void)
{
Arg args[2];
String s;
/* ARGSUSED */
void
-plsel_quit(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+plsel_quit(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(w);
nhUse(event);
/* ARGSUSED */
void
-plsel_play(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+plsel_play(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
Arg args[2];
Boolean state;
/* ARGSUSED */
void
-plsel_randomize(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+plsel_randomize(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(w);
nhUse(event);
/* enable or disable the Play button */
static void
-plsel_set_play_button(state)
-boolean state;
+plsel_set_play_button(boolean state)
{
Arg args[2];
}
static void
-plsel_set_sensitivities(setcurr)
-boolean setcurr;
+plsel_set_sensitivities(boolean setcurr)
{
Arg args[2];
int j, valid;
}
static void
-X11_player_selection_randomize()
+X11_player_selection_randomize(void)
{
int nrole = plsel_n_roles;
int nrace = plsel_n_races;
}
static void
-X11_player_selection_setupOthers()
+X11_player_selection_setupOthers(void)
{
Arg args[2];
int ra = xtp2i(XawToggleGetCurrent(plsel_race_radios[0])) - 1;
}
static void
-racetoggleCallback(w, client, call)
-Widget w;
-XtPointer client, call;
+racetoggleCallback(Widget w, XtPointer client, XtPointer call)
{
Arg args[2];
int j, valid;
}
static void
-roletoggleCallback(w, client, call)
-Widget w;
-XtPointer client, call;
+roletoggleCallback(Widget w, XtPointer client, XtPointer call)
{
Arg args[2];
int j, valid;
}
static void
-gendertoggleCallback(w, client, call)
-Widget w;
-XtPointer client, call;
+gendertoggleCallback(Widget w, XtPointer client, XtPointer call)
{
int i, r = xtp2i(XawToggleGetCurrent(plsel_gend_radios[0])) - 1;
}
static void
-aligntoggleCallback(w, client, call)
-Widget w;
-XtPointer client, call;
+aligntoggleCallback(Widget w, XtPointer client, XtPointer call)
{
int r = xtp2i(XawToggleGetCurrent(plsel_align_radios[0])) - 1;
}
static void
-plsel_random_btn_callback(w, client, call)
-Widget w;
-XtPointer client;
-XtPointer call;
+plsel_random_btn_callback(Widget w, XtPointer client, XtPointer call)
{
nhUse(w);
nhUse(client);
}
static void
-plsel_play_btn_callback(w, client, call)
-Widget w;
-XtPointer client;
-XtPointer call;
+plsel_play_btn_callback(Widget w, XtPointer client, XtPointer call)
{
nhUse(w);
nhUse(client);
}
static void
-plsel_quit_btn_callback(w, client, call)
-Widget w;
-XtPointer client;
-XtPointer call;
+plsel_quit_btn_callback(Widget w, XtPointer client, XtPointer call)
{
nhUse(w);
nhUse(client);
}
static Widget
-X11_create_player_selection_name(form)
-Widget form;
+X11_create_player_selection_name(Widget form)
{
Widget namelabel, name_vp, name_form;
Arg args[10];
}
static void
-X11_player_selection_dialog()
+X11_player_selection_dialog(void)
{
Widget popup, popup_vp;
Widget form;
}
static void
-X11_player_selection_prompts()
+X11_player_selection_prompts(void)
{
int num_roles, num_races, num_gends, num_algns, i, availcount, availindex;
Widget popup, player_form;
/* Global functions ======================================================== */
void
-X11_player_selection()
+X11_player_selection(void)
{
if (iflags.wc_player_selection == VIA_DIALOG) {
if (!*g.plname) {
/* called by core to have the player pick an extended command */
int
-X11_get_ext_cmd()
+X11_get_ext_cmd(void)
{
if (iflags.extmenu != ec_full_list) {
/* player has toggled the 'extmenu' option, toss the old widgets */
}
void
-release_extended_cmds()
+release_extended_cmds(void)
{
if (extended_commands) {
XtDestroyWidget(extended_command_popup), extended_command_popup = 0;
/* Extended Command ------------------------------------------------------- */
/* ARGSUSED */
static void
-extend_select(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+extend_select(Widget w, XtPointer client_data, XtPointer call_data)
{
int selected = (int) (ptrdiff_t) client_data;
/* ARGSUSED */
static void
-extend_dismiss(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+extend_dismiss(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(client_data);
/* ARGSUSED */
static void
-extend_help(w, client_data, call_data)
-Widget w;
-XtPointer client_data, call_data;
+extend_help(Widget w, XtPointer client_data, XtPointer call_data)
{
nhUse(w);
nhUse(client_data);
/* ARGSUSED */
void
-ec_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+ec_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
if (w == extended_command_popup) {
ec_dismiss();
/* ARGSUSED */
static void
-popup_delete(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+popup_delete(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
nhUse(event);
nhUse(params);
}
static void
-ec_dismiss()
+ec_dismiss(void)
{
/* unselect while still visible */
if (extended_cmd_selected >= 0)
/* scroll the extended command menu if necessary
so that choices extended_cmd_selected through ec_indx will be visible */
static void
-ec_scroll_to_view(ec_indx)
-int ec_indx; /* might be greater than extended_cmd_selected */
+ec_scroll_to_view(int ec_indx) /* might be greater than extended_cmd_selected */
{
Widget viewport, scrollbar, tmpw;
Arg args[5];
/* decide whether extcmdlist[idx] should be part of extended commands menu */
static boolean
-ignore_extcmd(idx)
-int idx;
+ignore_extcmd(int idx)
{
/* #shell or #suspect might not be available;
'extmenu' option controls whether we show full list
/* ARGSUSED */
void
-ec_key(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+ec_key(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch;
int i, pass;
* be used from a menubox.
*/
static void
-init_extended_commands_popup()
+init_extended_commands_popup(void)
{
int i, j, num_commands, ignore_cmds = 0;
* ------------------------
*/
static Widget
-make_menu(popup_name, popup_label, popup_translations, left_name,
- left_callback, right_name, right_callback, num_names, widget_names,
- command_widgets, name_callback, formp)
-const char *popup_name;
-const char *popup_label;
-const char *popup_translations;
-const char *left_name;
-XtCallbackProc left_callback;
-const char *right_name;
-XtCallbackProc right_callback;
-int num_names;
-const char **widget_names; /* return array of command widgets */
-Widget **command_widgets;
-XtCallbackProc name_callback;
-Widget *formp; /* return */
+make_menu(const char *popup_name, const char *popup_label,
+ const char *popup_translations, const char *left_name,
+ XtCallbackProc left_callback, const char *right_name,
+ XtCallbackProc right_callback, int num_names,
+ const char **widget_names, /* return array of command widgets */
+ Widget **command_widgets,
+ XtCallbackProc name_callback, Widget *formp) /* return */
{
Widget popup, popform, form, label, above, left, right, view;
Widget *commands, *curr;
#define NUM_STATS 41
-static int FDECL(condcolor, (long, unsigned long *));
-static int FDECL(condattr, (long, unsigned long *));
-static void FDECL(HiliteField, (Widget, int, int, int, XFontStruct **));
-static void FDECL(PrepStatusField, (int, Widget, const char *));
-static void FDECL(DisplayCond, (int, unsigned long *));
-static int FDECL(render_conditions, (int, int));
+static int condcolor(long, unsigned long *);
+static int condattr(long, unsigned long *);
+static void HiliteField(Widget, int, int, int, XFontStruct **);
+static void PrepStatusField(int, Widget, const char *);
+static void DisplayCond(int, unsigned long *);
+static int render_conditions(int, int);
#ifdef STATUS_HILITES
-static void FDECL(tt_reset_color, (int, int, unsigned long *));
+static void tt_reset_color(int, int, unsigned long *);
#endif
-static void NDECL(tt_status_fixup);
-static Widget FDECL(create_tty_status_field, (int, int, Widget, Widget));
-static Widget FDECL(create_tty_status, (Widget, Widget));
-static void FDECL(update_fancy_status_field, (int, int, int));
-static void FDECL(update_fancy_status, (BOOLEAN_P));
-static Widget FDECL(create_fancy_status, (Widget, Widget));
-static void FDECL(destroy_fancy_status, (struct xwindow *));
-static void FDECL(create_status_window_fancy, (struct xwindow *,
- BOOLEAN_P, Widget));
-static void FDECL(create_status_window_tty, (struct xwindow *,
- BOOLEAN_P, Widget));
-static void FDECL(destroy_status_window_fancy, (struct xwindow *));
-static void FDECL(destroy_status_window_tty, (struct xwindow *));
-static void FDECL(adjust_status_fancy, (struct xwindow *, const char *));
-static void FDECL(adjust_status_tty, (struct xwindow *, const char *));
+static void tt_status_fixup(void);
+static Widget create_tty_status_field(int, int, Widget, Widget);
+static Widget create_tty_status(Widget, Widget);
+static void update_fancy_status_field(int, int, int);
+static void update_fancy_status(boolean);
+static Widget create_fancy_status(Widget, Widget);
+static void destroy_fancy_status(struct xwindow *);
+static void create_status_window_fancy(struct xwindow *, boolean, Widget);
+static void create_status_window_tty(struct xwindow *, boolean, Widget);
+static void destroy_status_window_fancy(struct xwindow *);
+static void destroy_status_window_tty(struct xwindow *);
+static void adjust_status_fancy(struct xwindow *, const char *);
+static void adjust_status_tty(struct xwindow *, const char *);
extern const char *status_fieldfmt[MAXBLSTATS];
extern char *status_vals[MAXBLSTATS];
struct xwindow *xw_status_win;
static int
-condcolor(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condcolor(long bm, unsigned long *bmarray)
{
int i;
}
static int
-condattr(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condattr(long bm, unsigned long *bmarray)
{
int attr = 0;
int i;
}
void
-X11_status_init()
+X11_status_init(void)
{
int i;
}
void
-X11_status_finish()
+X11_status_finish(void)
{
/* nothing */
return;
}
void
-X11_status_enablefield(fieldidx, nm, fmt, enable)
-int fieldidx;
-const char *nm;
-const char *fmt;
-boolean enable;
+X11_status_enablefield(int fieldidx, const char *nm,
+ const char *fmt, boolean enable)
{
genl_status_enablefield(fieldidx, nm, fmt, enable);
}
#if 0
int
-cond_bm2idx(bm)
-unsigned long bm;
+cond_bm2idx(unsigned long bm)
{
int i;
/* highlight a tty-style status field (or condition) */
static void
-HiliteField(label, fld, cond, colrattr, font_p)
-Widget label;
-int fld, cond, colrattr;
-XFontStruct **font_p;
+HiliteField(Widget label,
+ int fld, int cond, int colrattr,
+ XFontStruct **font_p)
{
#ifdef STATUS_HILITES
static Pixel grayPxl, blackPxl, whitePxl;
/* set up a specific field other than 'condition'; its general location
was specified during widget creation but it might need adjusting */
static void
-PrepStatusField(fld, label, text)
-int fld;
-Widget label;
-const char *text;
+PrepStatusField(int fld, Widget label, const char *text)
{
Arg args[6];
Cardinal num_args;
/* set up one status condition for tty-style status display */
static void
-DisplayCond(c_idx, colormasks)
-int c_idx; /* index into tt_condorder[] */
-unsigned long *colormasks;
+DisplayCond(int c_idx, /* index into tt_condorder[] */
+ unsigned long *colormasks)
{
Widget label;
Arg args[6];
/* display the tty-style status conditions; the number shown varies and
we might be showing more, same, or fewer than during previous status */
static int
-render_conditions(row, dx)
-int row, dx;
+render_conditions(int row, int dx)
{
Widget label;
Arg args[6];
/* reset status_hilite for BL_RESET; if highlighting has been disabled or
this field is disabled, clear highlighting for this field or condition */
static void
-tt_reset_color(fld, cond, colormasks)
-int fld, cond;
-unsigned long *colormasks;
+tt_reset_color(int fld, int cond, unsigned long *colormasks)
{
Widget label;
int colrattr = NO_COLOR;
then explicitly set them for all the status widgets;
also cache some geometry settings in (*xw_status_win).Status_info */
static void
-tt_status_fixup()
+tt_status_fixup(void)
{
Arg args[6];
Cardinal num_args;
/* core requests updating one status field (or is indicating that it's time
to flush all updated fields); tty-style handling */
static void
-X11_status_update_tty(fld, ptr, chg, percent, color, colormasks)
-int fld, chg UNUSED, percent, color;
-genericptr_t ptr;
-unsigned long *colormasks; /* bitmask of highlights for conditions */
+X11_status_update_tty(int fld, genericptr_t ptr, int chg UNUSED, int percent,
+ int color,
+ unsigned long *colormasks) /* bitmask of highlights
+ for conditions */
{
static int xtra_space[MAXBLSTATS];
static unsigned long *cond_colormasks = (unsigned long *) 0;
/*ARGSUSED*/
static void
-X11_status_update_fancy(fld, ptr, chg, percent, colrattr, colormasks)
-int fld, chg UNUSED, percent UNUSED, colrattr;
-genericptr_t ptr;
-unsigned long *colormasks;
+X11_status_update_fancy(int fld, genericptr_t ptr, int chg UNUSED,
+ int percent UNUSED, int colrattr,
+ unsigned long *colormasks UNUSED)
{
static const struct bl_to_ff {
int bl, ff;
}
void
-X11_status_update(fld, ptr, chg, percent, color, colormasks)
-int fld, chg UNUSED, percent UNUSED, color;
-genericptr_t ptr;
-unsigned long *colormasks;
+X11_status_update(int fld, genericptr_t ptr, int chg,
+ int percent, int color,
+ unsigned long *colormasks)
{
if (fld < BL_RESET || fld >= MAXBLSTATS)
panic("X11_status_update(%d) -- invalid field", fld);
/* create a widget for a particular status field or potential condition */
static Widget
-create_tty_status_field(fld, condindx, above, left)
-int fld, condindx;
-Widget above, left;
+create_tty_status_field(int fld, int condindx, Widget above, Widget left)
{
Arg args[16];
Cardinal num_args;
/* create an overall status widget (X11_status_widget) and also
separate widgets for all status fields and potential conditions */
static Widget
-create_tty_status(parent, top)
-Widget parent, top;
+create_tty_status(Widget parent, Widget top)
{
Widget form; /* viewport that holds the form that surrounds everything */
Widget w, over_w, prev_w;
/*ARGSUSED*/
void
-create_status_window_tty(wp, create_popup, parent)
-struct xwindow *wp; /* window pointer */
-boolean create_popup UNUSED;
-Widget parent;
+create_status_window_tty(struct xwindow *wp, /* window pointer */
+ boolean create_popup UNUSED, Widget parent)
{
wp->type = NHW_STATUS;
wp->w = create_tty_status(parent, (Widget) 0);
}
void
-destroy_status_window_tty(wp)
-struct xwindow *wp;
+destroy_status_window_tty(struct xwindow *wp)
{
/* If status_information is defined, then it a "text" status window. */
if (wp->status_information) {
/*ARGSUSED*/
void
-adjust_status_tty(wp, str)
-struct xwindow *wp UNUSED;
-const char *str UNUSED;
+adjust_status_tty(struct xwindow *wp UNUSED, const char *str UNUSED)
{
/* nothing */
return;
}
void
-create_status_window(wp, create_popup, parent)
-struct xwindow *wp; /* window pointer */
-boolean create_popup;
-Widget parent;
+create_status_window(struct xwindow *wp, /* window pointer */
+ boolean create_popup, Widget parent)
{
struct status_info_t *si = (struct status_info_t *) alloc(sizeof *si);
}
void
-destroy_status_window(wp)
-struct xwindow *wp;
+destroy_status_window(struct xwindow *wp)
{
if (appResources.fancy_status)
destroy_status_window_fancy(wp);
}
void
-adjust_status(wp, str)
-struct xwindow *wp;
-const char *str;
+adjust_status(struct xwindow *wp, const char *str)
{
if (appResources.fancy_status)
adjust_status_fancy(wp, str);
}
void
-create_status_window_fancy(wp, create_popup, parent)
-struct xwindow *wp; /* window pointer */
-boolean create_popup;
-Widget parent;
+create_status_window_fancy(struct xwindow *wp, /* window pointer */
+ boolean create_popup, Widget parent)
{
XFontStruct *fs;
Arg args[8];
}
void
-destroy_status_window_fancy(wp)
-struct xwindow *wp;
+destroy_status_window_fancy(struct xwindow *wp)
{
/* If status_information is defined, then it a "text" status window. */
if (wp->status_information) {
* + We didn't set stringInPlace on the widget.
*/
void
-adjust_status_fancy(wp, str)
-struct xwindow *wp;
-const char *str;
+adjust_status_fancy(struct xwindow *wp, const char *str)
{
Arg args[2];
Cardinal num_args;
struct ovld_item conds[NUM_OVLD];
};
-static const struct f_overload *FDECL(ff_ovld_from_mask, (unsigned long));
-static const struct f_overload *FDECL(ff_ovld_from_indx, (int));
-static void FDECL(hilight_label, (Widget));
-static void FDECL(update_val, (struct X_status_value *, long));
-static void FDECL(skip_cond_val, (struct X_status_value *));
-static void FDECL(update_color, (struct X_status_value *, int));
-static boolean FDECL(name_widget_has_label, (struct X_status_value *));
-static void FDECL(apply_hilite_attributes, (struct X_status_value *, int));
-static const char *FDECL(width_string, (int));
-static void FDECL(create_widget, (Widget, struct X_status_value *, int));
-static void FDECL(get_widths, (struct X_status_value *, int *, int *));
-static void FDECL(set_widths, (struct X_status_value *, int, int));
-static Widget FDECL(init_column, (const char *, Widget, Widget, Widget,
- int *, int));
-static void NDECL(fixup_cond_widths);
-static Widget FDECL(init_info_form, (Widget, Widget, Widget));
+static const struct f_overload *ff_ovld_from_mask(unsigned long);
+static const struct f_overload *ff_ovld_from_indx(int);
+static void hilight_label(Widget);
+static void update_val(struct X_status_value *, long);
+static void skip_cond_val(struct X_status_value *);
+static void update_color(struct X_status_value *, int);
+static boolean name_widget_has_label(struct X_status_value *);
+static void apply_hilite_attributes(struct X_status_value *, int);
+static const char *width_string(int);
+static void create_widget(Widget, struct X_status_value *, int);
+static void get_widths(struct X_status_value *, int *, int *);
+static void set_widths(struct X_status_value *, int, int);
+static Widget init_column(const char *, Widget, Widget, Widget, int *, int);
+static void fixup_cond_widths(void);
+static Widget init_info_form(Widget, Widget, Widget);
/*
* Notes:
};
static const struct f_overload *
-ff_ovld_from_mask(mask)
-unsigned long mask;
+ff_ovld_from_mask(unsigned long mask)
{
const struct f_overload *fo;
}
static const struct f_overload *
-ff_ovld_from_indx(indx)
-int indx; /* F_foo number, index into shown_stats[] */
+ff_ovld_from_indx(int indx) /* F_foo number, index into shown_stats[] */
{
const struct f_overload *fo;
int i, ff;
* kinds of funny values being displayed.
*/
void
-null_out_status()
+null_out_status(void)
{
int i;
struct X_status_value *sv;
/* this is almost an exact duplicate of hilight_value() */
static void
-hilight_label(w)
-Widget w; /* label widget */
+hilight_label(Widget w) /* label widget */
{
/*
* This predates STATUS_HILITES.
}
static void
-update_val(attr_rec, new_value)
-struct X_status_value *attr_rec;
-long new_value;
+update_val(struct X_status_value *attr_rec, long new_value)
{
static boolean Exp_shown = TRUE, time_shown = TRUE, score_shown = TRUE,
Xp_was_HD = FALSE;
/* overloaded condition is being cleared without going through update_val()
so that an alternate can be shown; put this one back to default settings */
static void
-skip_cond_val(sv)
-struct X_status_value *sv;
+skip_cond_val(struct X_status_value *sv)
{
sv->last_value = 0L; /* Off */
if (sv->set) {
}
static void
-update_color(sv, color)
-struct X_status_value *sv;
-int color;
+update_color(struct X_status_value *sv, int color)
{
Pixel pixel = 0;
Arg args[1];
}
static boolean
-name_widget_has_label(sv)
-struct X_status_value *sv;
+name_widget_has_label(struct X_status_value *sv)
{
Arg args[1];
const char *label;
}
static void
-apply_hilite_attributes(sv, attributes)
-struct X_status_value *sv;
-int attributes;
+apply_hilite_attributes(struct X_status_value *sv, int attributes)
{
boolean attr_inversion = ((HL_INVERSE & attributes)
&& (sv->type != SV_NAME
* [**] HD is shown instead of level and exp if Upolyd.
*/
static void
-update_fancy_status_field(i, color, attributes)
-int i, color, attributes;
+update_fancy_status_field(int i, int color, int attributes)
{
struct X_status_value *sv = &shown_stats[i];
unsigned long condmask = 0L;
/* fully update status after bl_flush or window resize */
static void
-update_fancy_status(force_update)
-boolean force_update;
+update_fancy_status(boolean force_update)
{
static boolean old_showtime, old_showexp, old_showscore;
static int old_upolyd = -1; /* -1: force first time update */
* Turn off hilighted status values after a certain amount of turns.
*/
void
-check_turn_events()
+check_turn_events(void)
{
int i;
struct X_status_value *sv;
/* Return a string for the initial width, so use longest possible value. */
static const char *
-width_string(sv_index)
-int sv_index;
+width_string(int sv_index)
{
switch (sv_index) {
case F_DUMMY:
}
static void
-create_widget(parent, sv, sv_index)
-Widget parent;
-struct X_status_value *sv;
-int sv_index;
+create_widget(Widget parent, struct X_status_value *sv, int sv_index)
{
Arg args[4];
Cardinal num_args;
* Get current width of value. width2p is only valid for SV_VALUE types.
*/
static void
-get_widths(sv, width1p, width2p)
-struct X_status_value *sv;
-int *width1p, *width2p;
+get_widths(struct X_status_value *sv, int *width1p, int *width2p)
{
Arg args[1];
Dimension width;
}
static void
-set_widths(sv, width1, width2)
-struct X_status_value *sv;
-int width1, width2;
+set_widths(struct X_status_value *sv, int width1, int width2)
{
Arg args[1];
}
static Widget
-init_column(name, parent, top, left, col_indices, xtrawidth)
-const char *name;
-Widget parent, top, left;
-int *col_indices, xtrawidth;
+init_column(const char *name, Widget parent, Widget top, Widget left,
+ int *col_indices, int xtrawidth)
{
Widget form;
Arg args[4];
* TODO: widen title field and implement hitpoint bar on it.
*/
static Widget
-init_info_form(parent, top, left)
-Widget parent, top, left;
+init_info_form(Widget parent, Widget top, Widget left)
{
Widget form, col1, col2;
struct X_status_value *sv_name, *sv_dlevel;
/* give the three status condition columns the same width */
static void
-fixup_cond_widths()
+fixup_cond_widths(void)
{
int pass, i, *ip, w1, w2;
* contains everything.
*/
static Widget
-create_fancy_status(parent, top)
-Widget parent, top;
+create_fancy_status(Widget parent, Widget top)
{
Widget form; /* The form that surrounds everything. */
Widget w;
}
static void
-destroy_fancy_status(wp)
-struct xwindow *wp;
+destroy_fancy_status(struct xwindow *wp)
{
int i;
struct X_status_value *sv;
<BtnDown>: rip_dismiss_text()\n\
<Key>: rip_dismiss_text()";
-static Widget FDECL(create_ripout_widget, (Widget));
+static Widget create_ripout_widget(Widget);
#endif
/*ARGSUSED*/
void
-delete_text(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+delete_text(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
struct xwindow *wp;
struct text_info_t *text_info;
*/
/*ARGSUSED*/
void
-dismiss_text(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
struct xwindow *wp;
struct text_info_t *text_info;
/* Dismiss when a non-modifier key pressed. */
void
-key_dismiss_text(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+key_dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
char ch = key_event_to_char((XKeyEvent *) event);
if (ch)
#ifdef GRAPHIC_TOMBSTONE
/* Dismiss from clicking on rip image. */
void
-rip_dismiss_text(w, event, params, num_params)
-Widget w;
-XEvent *event;
-String *params;
-Cardinal *num_params;
+rip_dismiss_text(Widget w, XEvent *event, String *params, Cardinal *num_params)
{
dismiss_text(XtParent(w), event, params, num_params);
}
/* ARGSUSED */
void
-add_to_text_window(wp, attr, str)
-struct xwindow *wp;
-int attr; /* currently unused */
-const char *str;
+add_to_text_window(struct xwindow *wp, int attr, /* currently unused */
+ const char *str)
{
struct text_info_t *text_info = wp->text_information;
int width;
}
void
-display_text_window(wp, blocking)
-struct xwindow *wp;
-boolean blocking;
+display_text_window(struct xwindow *wp, boolean blocking)
{
struct text_info_t *text_info;
Arg args[8];
}
void
-create_text_window(wp)
-struct xwindow *wp;
+create_text_window(struct xwindow *wp)
{
struct text_info_t *text_info;
Arg args[8];
}
void
-destroy_text_window(wp)
-struct xwindow *wp;
+destroy_text_window(struct xwindow *wp)
{
/* Don't need to pop down, this only called from dismiss_text(). */
}
void
-clear_text_window(wp)
-struct xwindow *wp;
+clear_text_window(struct xwindow *wp)
{
clear_text_buffer(&wp->text_information->text);
}
/* Append a line to the text buffer. */
void
-append_text_buffer(tb, str, concat)
-struct text_buffer *tb;
-const char *str;
-boolean concat;
+append_text_buffer(struct text_buffer *tb, const char *str, boolean concat)
{
char *copy;
int length;
/* Initialize text buffer. */
void
-init_text_buffer(tb)
-struct text_buffer *tb;
+init_text_buffer(struct text_buffer *tb)
{
tb->text = (char *) alloc(START_SIZE);
tb->text[0] = '\0';
/* Empty the text buffer */
void
-clear_text_buffer(tb)
-struct text_buffer *tb;
+clear_text_buffer(struct text_buffer *tb)
{
tb->text_last = 0;
tb->text[0] = '\0';
/* Free up allocated memory. */
void
-free_text_buffer(tb)
-struct text_buffer *tb;
+free_text_buffer(struct text_buffer *tb)
{
free(tb->text);
tb->text = (char *) 0;
#ifdef GRAPHIC_TOMBSTONE
-static void FDECL(rip_exposed, (Widget, XtPointer, XtPointer));
+static void rip_exposed(Widget, XtPointer, XtPointer);
static XImage *rip_image = 0;
*/
/*ARGSUSED*/
static void
-rip_exposed(w, client_data, widget_data)
-Widget w;
-XtPointer client_data UNUSED;
-XtPointer widget_data; /* expose event from Window widget */
+rip_exposed(Widget w, XtPointer client_data UNUSED,
+ XtPointer widget_data) /* expose event from Window widget */
{
XExposeEvent *event = (XExposeEvent *) widget_data;
Display *dpy = XtDisplay(w);
#define WVALUE "value"
Widget
-create_value(parent, name_value)
-Widget parent;
-const char *name_value;
+create_value(Widget parent, const char *name_value)
{
Widget form, name;
Arg args[8];
}
void
-set_name(w, new_label)
-Widget w;
-const char *new_label;
+set_name(Widget w, const char *new_label)
{
Arg args[1];
Widget name;
}
void
-set_name_width(w, new_width)
-Widget w;
-int new_width;
+set_name_width(Widget w, int new_width)
{
Arg args[1];
Widget name;
}
int
-get_name_width(w)
-Widget w;
+get_name_width(Widget w)
{
Arg args[1];
Dimension width;
}
Widget
-get_value_widget(w)
-Widget w;
+get_value_widget(Widget w)
{
return XtNameToWidget(w, WVALUE);
}
void
-set_value(w, new_value)
-Widget w;
-const char *new_value;
+set_value(Widget w, const char *new_value)
{
Arg args[1];
Widget val;
}
void
-set_value_width(w, new_width)
-Widget w;
-int new_width;
+set_value_width(Widget w, int new_width)
{
Arg args[1];
Widget val;
}
int
-get_value_width(w)
-Widget w;
+get_value_width(Widget w)
{
Arg args[1];
Widget val;
/* Swap foreground and background colors (this is the best I can do with */
/* a label widget, unless I can get some init hook in there). */
void
-hilight_value(w)
-Widget w;
+hilight_value(Widget w)
{
swap_fg_bg(get_value_widget(w));
}
/* Swap the foreground and background colors of the given widget */
void
-swap_fg_bg(w)
-Widget w;
+swap_fg_bg(Widget w)
{
Arg args[2];
Pixel fg, bg;
void
chainin_display_nhwindow(window, blocking)
winid window;
-BOOLEAN_P blocking;
+boolean blocking;
{
(*cibase->nprocs->win_display_nhwindow)(cibase->ndata, window, blocking);
}
chainout_display_nhwindow(vp, window, blocking)
void *vp;
winid window;
-BOOLEAN_P blocking;
+boolean blocking;
{
struct chainout_data *tdp = vp;
trace_display_nhwindow(vp, window, blocking)
void *vp;
winid window;
-BOOLEAN_P blocking;
+boolean blocking;
{
struct trace_data *tdp = vp;
/*
* Note:
- *
+ * FIXME
* Prototypes need to use the widened/unwidened type macros (CHAR_P, &c)
* in order to match fields of the window_procs struct (see winprocs.h).
* But for a standard-conforming compiler, we'll end up with the widened
winid wid; /* NetHack window id */
glyph_info glyphinfo; /* holds menu glyph and additional glyph info */
anything identifier; /* Value returned if item selected */
- CHAR_P accelerator; /* Character used to select item from menu */
- CHAR_P group_accel; /* Group accelerator for menu item, if any */
+ char accelerator; /* Character used to select item from menu */
+ char group_accel; /* Group accelerator for menu item, if any */
int attr; /* Text attributes for item */
const char *str; /* Text of menu item */
- BOOLEAN_P presel; /* Whether menu item should be preselected */
+ boolean presel; /* Whether menu item should be preselected */
boolean selected; /* Whether item is currently selected */
unsigned itemflags;
int page_num; /* Display page number for entry */
int
curses_character_input_dialog(const char *prompt, const char *choices,
- CHAR_P def)
+ char def)
{
WINDOW *askwin = NULL;
#ifdef PDCURSES
/* Return an extended command from the user */
int
-curses_ext_cmd()
+curses_ext_cmd(void)
{
int count, letter, prompt_width, startx, starty, winx, winy;
int messageh, messagew, maxlen = BUFSZ - 1;
void
curses_add_nhmenu_item(winid wid, const glyph_info *glyphinfo,
- const ANY_P *identifier, CHAR_P accelerator,
- CHAR_P group_accel, int attr,
+ const ANY_P *identifier, char accelerator,
+ char group_accel, int attr,
const char *str, unsigned itemflags)
{
nhmenu_item *new_item, *current_items, *menu_item_ptr;
void curses_line_input_dialog(const char *prompt, char *answer, int buffer);
int curses_character_input_dialog(const char *prompt, const char *choices,
- CHAR_P def);
+ char def);
int curses_ext_cmd(void);
void curses_create_nhmenu(winid wid, unsigned long);
void curses_add_nhmenu_item(winid wid, const glyph_info *glyphinfo,
- const ANY_P *identifier, CHAR_P accelerator,
- CHAR_P group_accel, int attr,
+ const ANY_P *identifier, char accelerator,
+ char group_accel, int attr,
const char *str, unsigned itemflags);
void curs_menu_set_bottom_heavy(winid);
void curses_finalize_nhmenu(winid wid, const char *prompt);
/* Create the "main" nonvolatile windows used by nethack */
void
-curses_create_main_windows()
+curses_create_main_windows(void)
{
int min_message_height = 1;
int message_orientation = 0;
/* Initialize curses colors to colors used by NetHack */
void
-curses_init_nhcolors()
+curses_init_nhcolors(void)
{
#ifdef TEXTCOLOR
if (has_colors()) {
/* Allow player to pick character's role, race, gender, and alignment.
Borrowed from the Gnome window port. */
void
-curses_choose_character()
+curses_choose_character(void)
{
int n, i, sel, count_off, pick4u;
int count = 0;
/* Initialize and display options appropriately */
void
-curses_init_options()
+curses_init_options(void)
{
/* change these from set_gameview to set_in_game */
set_wc_option_mod_status(WC_ALIGN_MESSAGE | WC_ALIGN_STATUS, set_in_game);
/* Display an ASCII splash screen if the splash_screen option is set */
void
-curses_display_splash_window()
+curses_display_splash_window(void)
{
int i, x_start, y_start;
/* Restore colors and cursor state before exiting */
void
-curses_cleanup()
+curses_cleanup(void)
{
#ifdef TEXTCOLOR
if (has_colors() && can_change_color()) {
/* Adds an inventory item. 'y' is 1 rather than 0 for the first item. */
void
-curses_add_inv(int y, const glyph_info *glyphinfo UNUSED, CHAR_P accelerator,
+curses_add_inv(int y, const glyph_info *glyphinfo UNUSED, char accelerator,
attr_t attr, const char *str)
{
WINDOW *win = curses_get_nhwin(INV_WIN);
the process. You need to fill in pl_character[0].
*/
void
-curses_player_selection()
+curses_player_selection(void)
{
curses_choose_character();
}
/* Ask the user for a player name. */
void
-curses_askname()
+curses_askname(void)
{
#ifdef SELECTSAVED
if (iflags.wc2_selectsaved && !iflags.renameinprogress)
A noop for the tty and X window-ports.
*/
void
-curses_get_nh_event()
+curses_get_nh_event(void)
{
boolean do_reset = FALSE;
/* Restore the windows after being suspended. */
void
-curses_resume_nhwindows()
+curses_resume_nhwindows(void)
{
curses_refresh_nethack_windows();
}
--more--, if necessary, in the tty window-port.
*/
void
-curses_display_nhwindow(winid wid, BOOLEAN_P block)
+curses_display_nhwindow(winid wid, boolean block)
{
menu_item *selected = NULL;
iff complain is TRUE.
*/
void
-curses_display_file(const char *filename, BOOLEAN_P must_exist)
+curses_display_file(const char *filename, boolean must_exist)
{
curses_view_file(filename, must_exist);
}
void
curses_add_menu(winid wid, const glyph_info *glyphinfo,
const ANY_P * identifier,
- CHAR_P accelerator, CHAR_P group_accel, int attr,
+ char accelerator, char group_accel, int attr,
const char *str, unsigned itemflags)
{
int curses_attr;
for the moment
*/
void
-curses_mark_synch()
+curses_mark_synch(void)
{
}
display is OK when return from wait_synch().
*/
void
-curses_wait_synch()
+curses_wait_synch(void)
{
/* [do we need 'if (counting) curses_count_window((char *)0);' here?] */
}
*/
void
-curses_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
+curses_print_glyph(winid wid, xchar x, xchar y,
const glyph_info *glyphinfo, const glyph_info *bkglyphinfo UNUSED)
{
int glyph;
Returned character _must_ be non-zero.
*/
int
-curses_nhgetch()
+curses_nhgetch(void)
{
int ch;
redone, since sounds aren't attributable to windows anyway.]
*/
void
-curses_nhbell()
+curses_nhbell(void)
{
beep();
}
-- On the tty-port this scrolls WIN_MESSAGE back one line.
*/
int
-curses_doprev_message()
+curses_doprev_message(void)
{
curses_prev_mesg();
return 0;
ports might use a popup.
*/
char
-curses_yn_function(const char *question, const char *choices, CHAR_P def)
+curses_yn_function(const char *question, const char *choices, char def)
{
return (char) curses_character_input_dialog(question, choices, def);
}
selection, -1 otherwise.
*/
int
-curses_get_ext_cmd()
+curses_get_ext_cmd(void)
{
return curses_ext_cmd();
}
by a nap(50ms), but allows asynchronous operation.
*/
void
-curses_delay_output()
+curses_delay_output(void)
{
/* refreshing the whole display is a waste of time,
* but that's why we're here */
just declare an empty function.
*/
void
-curses_start_screen()
+curses_start_screen(void)
{
}
completeness. The complement of start_screen().
*/
void
-curses_end_screen()
+curses_end_screen(void)
{
}
}
static char *
-dummy_get_color_string(VOID_ARGS)
+dummy_get_color_string(void)
{
return (char *) 0;
}
}
int
-curses_more()
+curses_more(void)
{
return curses_block(FALSE);
}
/* Clear the message window if one line; otherwise unhighlight old messages */
void
-curses_clear_unhighlight_message_window()
+curses_clear_unhighlight_message_window(void)
{
int mh, mw, count,
brdroffset = curses_window_has_border(MESSAGE_WIN) ? 1 : 0;
recent messages. */
void
-curses_last_messages()
+curses_last_messages(void)
{
nhprev_mesg *mesg;
int i, height, width;
/* Initialize list for message history */
void
-curses_init_mesg_history()
+curses_init_mesg_history(void)
{
max_messages = iflags.msg_history;
/* Display previous messages in a popup (via menu so can scroll backwards) */
void
-curses_prev_mesg()
+curses_prev_mesg(void)
{
int count;
winid wid;
puts it into save file; if any new messages are added to the list while
that is taking place, the results are likely to be scrambled */
char *
-curses_getmsghistory(init)
-boolean init;
+curses_getmsghistory(boolean init)
{
static int nxtidx;
nhprev_mesg *mesg;
* into message history for ^P recall without having displayed it.
*/
void
-curses_putmsghistory(msg, restoring_msghist)
-const char *msg;
-boolean restoring_msghist;
+curses_putmsghistory(const char *msg, boolean restoring_msghist)
{
static boolean initd = FALSE;
static int stash_count;
void curses_init_mesg_history(void);
void curses_prev_mesg(void);
void curses_count_window(const char *count_text);
-char *curses_getmsghistory(BOOLEAN_P);
-void curses_putmsghistory(const char *, BOOLEAN_P);
+char *curses_getmsghistory(boolean);
+void curses_putmsghistory(const char *, boolean);
#endif /* CURSMESG_H */
/* Read a character of input from the user */
int
-curses_read_char()
+curses_read_char(void)
{
int ch;
#if defined(ALT_0) || defined(ALT_9) || defined(ALT_A) || defined(ALT_Z)
/* Perform actions that should be done every turn before nhgetch() */
void
-curses_prehousekeeping()
+curses_prehousekeeping(void)
{
#ifndef PDCURSES
WINDOW *win = curses_get_nhwin(MAP_WIN);
/* Perform actions that should be done every turn after nhgetch() */
void
-curses_posthousekeeping()
+curses_posthousekeeping(void)
{
curs_set(0);
/* curses_decrement_highlights(FALSE); */
/* format iflags.wc2_petattr into "+a+b..." for set bits a, b, ...
(used by core's 'O' command; return value points past leading '+') */
char *
-curses_fmt_attrs(outbuf)
-char *outbuf;
+curses_fmt_attrs(char *outbuf)
{
int attr = iflags.wc2_petattr;
}
void
-curses_mouse_support(mode)
-int mode; /* 0: off, 1: on, 2: alternate on */
+curses_mouse_support(int mode) /* 0: off, 1: on, 2: alternate on */
{
#ifdef NCURSES_MOUSE_VERSION
mmask_t result, oldmask, newmask;
static int hpbar_percent, hpbar_color;
static int vert_status_dirty;
-static void NDECL(draw_status);
-static void FDECL(draw_vertical, (BOOLEAN_P));
-static void FDECL(draw_horizontal, (BOOLEAN_P));
+static void draw_status(void);
+static void draw_vertical(boolean);
+static void draw_horizontal(boolean);
static void curs_HPbar(char *, int);
static void curs_stat_conds(int, int, int *, int *, char *, boolean *);
static void curs_vert_status_vals(int);
#ifdef STATUS_HILITES
#ifdef TEXTCOLOR
-static int FDECL(condcolor, (long, unsigned long *));
+static int condcolor(long, unsigned long *);
#endif
-static int FDECL(condattr, (long, unsigned long *));
-static int FDECL(nhattr2curses, (int));
+static int condattr(long, unsigned long *);
+static int nhattr2curses(int);
#endif /* STATUS_HILITES */
/* width of a single line in vertical status orientation (one field per line;
#define STATVAL_WIDTH 60 /* overkill; was MAXCO (200), massive overkill */
void
-curses_status_init()
+curses_status_init(void)
{
int i;
}
void
-curses_status_finish()
+curses_status_finish(void)
{
int i;
static int changed_fields = 0;
void
-curses_status_update(fldidx, ptr, chg, percent, color_and_attr, colormasks)
-int fldidx, chg UNUSED,
- percent, color_and_attr;
-genericptr_t ptr;
-unsigned long *colormasks;
+curses_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
+ int color_and_attr, unsigned long *colormasks)
{
long *condptr = (long *) ptr;
char *text = (char *) ptr;
}
static void
-draw_status()
+draw_status(void)
{
WINDOW *win = curses_get_nhwin(STATUS_WIN);
orient statorient = (orient) curses_get_window_orientation(STATUS_WIN);
/* horizontal layout on 2 or 3 lines */
static void
-draw_horizontal(border)
-boolean border;
+draw_horizontal(boolean border)
{
#define blPAD BL_FLUSH
/* almost all fields already come with a leading space;
/* vertical layout, to left or right of map */
static void
-draw_vertical(border)
-boolean border;
+draw_vertical(boolean border)
{
/* for blank lines, the digit prefix is the order in which they get
removed if we need to shrink to fit within height limit (very rare) */
* be displayed in based on user settings.
*/
static int
-condcolor(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condcolor(long bm, unsigned long *bmarray)
{
int i;
#endif /* TEXTCOLOR */
static int
-condattr(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condattr(long bm, unsigned long *bmarray)
{
int i, attr = 0;
/* convert tty attributes to curses attributes;
despite similar names, the mask fields have different values */
static int
-nhattr2curses(attrmask)
-int attrmask;
+nhattr2curses(int attrmask)
{
int result = 0;
/* Global declarations */
-void curses_update_stats();
+void curses_update_stats(void);
void curses_decrement_highlights(boolean);
attr_t curses_color_attr(int nh_color, int bg_color);
/* Refresh nethack windows if they exist, or base window if not */
void
-curses_refresh_nethack_windows()
+curses_refresh_nethack_windows(void)
{
WINDOW *status_window, *message_window, *map_window, *inv_window;
/* called by destroy_nhwindows() prior to exit */
void
-curs_destroy_all_wins()
+curs_destroy_all_wins(void)
{
curses_count_window((char *) 0); /* clean up orphan */
/* Init map array to blanks */
static void
-clear_map()
+clear_map(void)
{
int x, y;
#define BI_JPEG 4
#define BI_PNG 5
-static uint16 FDECL(read_u16, (const unsigned char buf[2]));
-static uint32 FDECL(read_u32, (const unsigned char buf[4]));
-static int32 FDECL(read_s32, (const unsigned char buf[4]));
-static struct Pixel FDECL(build_pixel, (const struct BitmapInfoHeader *, uint32));
-static unsigned char FDECL(pixel_element, (uint32, uint32));
-static boolean FDECL(read_header, (FILE *, struct BitmapHeader *));
-static boolean FDECL(read_info_header, (FILE *, struct BitmapInfoHeader *));
-static boolean FDECL(check_info_header, (const struct BitmapInfoHeader *));
-static unsigned FDECL(get_palette_size, (const struct BitmapInfoHeader *));
-static boolean FDECL(read_palette, (FILE *, struct Pixel *, unsigned));
+static uint16 read_u16(const unsigned char buf[2]);
+static uint32 read_u32(const unsigned char buf[4]);
+static int32 read_s32(const unsigned char buf[4]);
+static struct Pixel build_pixel(const struct BitmapInfoHeader *, uint32);
+static unsigned char pixel_element(uint32, uint32);
+static boolean read_header(FILE *, struct BitmapHeader *);
+static boolean read_info_header(FILE *, struct BitmapInfoHeader *);
+static boolean check_info_header(const struct BitmapInfoHeader *);
+static unsigned get_palette_size(const struct BitmapInfoHeader *);
+static boolean read_palette(FILE *, struct Pixel *, unsigned);
/* Read a .BMP file into the image structure */
/* Return TRUE if successful, FALSE on any error */
boolean
-read_bmp_tiles(filename, image)
-const char *filename;
-struct TileSetImage *image;
+read_bmp_tiles(const char *filename, struct TileSetImage *image)
{
struct BitmapHeader header1;
struct BitmapInfoHeader header2;
/* Read and decode the first header */
static boolean
-read_header(fp, header)
-FILE *fp;
-struct BitmapHeader *header;
+read_header(FILE *fp, struct BitmapHeader *header)
{
unsigned char buf[14];
size_t size;
/* Read and decode the second header */
static boolean
-read_info_header(fp, header)
-FILE *fp;
-struct BitmapInfoHeader *header;
+read_info_header(FILE *fp, struct BitmapInfoHeader *header)
{
unsigned char buf[124]; /* maximum size */
size_t size;
/* Check the second header for consistency and unsupported features */
static boolean
-check_info_header(header)
-const struct BitmapInfoHeader *header;
+check_info_header(const struct BitmapInfoHeader *header)
{
if (header->NumPlanes != 1) return FALSE;
switch (header->BitsPerPixel) {
/* Return the number of palette entries to read from the file */
static unsigned
-get_palette_size(header)
-const struct BitmapInfoHeader *header;
+get_palette_size(const struct BitmapInfoHeader *header)
{
switch (header->BitsPerPixel) {
case 1:
* Return TRUE if successful, FALSE on any error
*/
static boolean
-read_palette(fp, palette, palette_size)
-FILE *fp;
-struct Pixel *palette;
-unsigned palette_size;
+read_palette(FILE *fp, struct Pixel *palette, unsigned palette_size)
{
unsigned i;
unsigned char buf[4];
/* Decode an unsigned 16 bit quantity */
static uint16
-read_u16(buf)
-const unsigned char buf[2];
+read_u16(const unsigned char buf[2])
{
return ((uint16)buf[0] << 0)
| ((uint16)buf[1] << 8);
/* Decode an unsigned 32 bit quantity */
static uint32
-read_u32(buf)
-const unsigned char buf[4];
+read_u32(const unsigned char buf[4])
{
return ((uint32)buf[0] << 0)
| ((uint32)buf[1] << 8)
/* Decode a signed 32 bit quantity */
static int32
-read_s32(buf)
-const unsigned char buf[4];
+read_s32(const unsigned char buf[4])
{
return (int32)((read_u32(buf) ^ 0x80000000) - 0x80000000);
}
/* Extract one element (red, green, blue or alpha) from a pixel */
static unsigned char
-pixel_element(mask, color)
-uint32 mask;
-uint32 color;
+pixel_element(uint32 mask, uint32 color)
{
uint32 bits, shift;
#include "tile.h"
#ifndef MONITOR_HEAP
-extern long *FDECL(alloc, (unsigned int));
+extern long *alloc(unsigned int);
#endif
#define PPM_ASSIGN(p, red, grn, blu) \
static pixel **image;
static unsigned char input_code_size;
-static int FDECL(GetDataBlock, (FILE * fd, unsigned char *buf));
-static void FDECL(DoExtension, (FILE * fd, int label));
-static boolean FDECL(ReadColorMap, (FILE * fd, int number));
-static void FDECL(read_header, (FILE * fd));
-static int FDECL(GetCode, (FILE * fd, int code_size, int flag));
-static int FDECL(LWZReadByte, (FILE * fd, int flag, int input_code_size));
-static void FDECL(ReadInterleavedImage, (FILE * fd, int len, int height));
-static void FDECL(ReadTileStrip, (FILE * fd, int len));
+static int GetDataBlock(FILE * fd, unsigned char *buf);
+static void DoExtension(FILE * fd, int label);
+static boolean ReadColorMap(FILE * fd, int number);
+static void read_header(FILE * fd);
+static int GetCode(FILE * fd, int code_size, int flag);
+static int LWZReadByte(FILE * fd, int flag, int input_code_size);
+static void ReadInterleavedImage(FILE * fd, int len, int height);
+static void ReadTileStrip(FILE * fd, int len);
/* These should be in gif.h, but there isn't one. */
-boolean FDECL(fopen_gif_file, (const char *, const char *));
-boolean FDECL(read_gif_tile, (pixel(*) [TILE_X]));
-int NDECL(fclose_gif_file);
+boolean fopen_gif_file(const char *, const char *);
+boolean read_gif_tile(pixel(*) [TILE_X]);
+int fclose_gif_file(void);
static int
-GetDataBlock(fd, buf)
-FILE *fd;
-unsigned char *buf;
+GetDataBlock(FILE *fd, unsigned char *buf)
{
unsigned char count;
}
static void
-DoExtension(fd, label)
-FILE *fd;
-int label;
+DoExtension(FILE *fd, int label)
{
static char buf[256];
char *str;
}
static boolean
-ReadColorMap(fd, number)
-FILE *fd;
-int number;
+ReadColorMap(FILE *fd, int number)
{
int i;
unsigned char rgb[3];
* file, so if that image has a local colormap, overwrite the global one.
*/
static void
-read_header(fd)
-FILE *fd;
+read_header(FILE *fd)
{
unsigned char buf[16];
unsigned char c;
}
static int
-GetCode(fd, code_size, flag)
-FILE *fd;
-int code_size;
-int flag;
+GetCode(FILE *fd, int code_size, int flag)
{
static unsigned char buf[280];
static int curbit, lastbit, done, last_byte;
}
static int
-LWZReadByte(fd, flag, input_code_size)
-FILE *fd;
-int flag;
-int input_code_size;
+LWZReadByte(FILE *fd, int flag, int input_code_size)
{
static int fresh = FALSE;
int code, incode;
}
static void
-ReadInterleavedImage(fd, len, height)
-FILE *fd;
-int len, height;
+ReadInterleavedImage(FILE *fd, int len, int height)
{
int v;
int xpos = 0, ypos = 0, pass = 0;
}
static void
-ReadTileStrip(fd, len)
-FILE *fd;
-int len;
+ReadTileStrip(FILE *fd, int len)
{
int v;
int xpos = 0, ypos = 0;
}
boolean
-fopen_gif_file(filename, type)
-const char *filename;
-const char *type;
+fopen_gif_file(const char *filename, const char *type)
{
int i;
/* Read a tile. Returns FALSE when there are no more tiles */
boolean
-read_gif_tile(pixels)
-pixel (*pixels)[TILE_X];
+read_gif_tile(pixel (*pixels)[TILE_X])
{
int i, j;
}
int
-fclose_gif_file()
+fclose_gif_file(void)
{
int i;
"objects.txt", "other.gif", "other.txt" };
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
pixel pixels[TILE_Y][TILE_X];
unsigned char *data;
};
-static boolean FDECL(read_data_block, (struct Bitstream *gif, struct DataBlock *block));
-static void FDECL(free_data_block, (struct DataBlock *block));
-static unsigned short FDECL(read_u16, (const unsigned char buf[2]));
-static void FDECL(init_decoder, (struct Bitstream *gif, unsigned bit_width));
-static void FDECL(reset_decoder, (struct Bitstream *gif));
-static int FDECL(decode, (struct Bitstream *gif, struct DataBlock *block));
-static int FDECL(get_code, (struct Bitstream *gif, struct DataBlock *block));
-static unsigned FDECL(interlace_incr, (unsigned y, unsigned height));
+static boolean read_data_block(struct Bitstream *gif,
+ struct DataBlock *block);
+static void free_data_block(struct DataBlock *block);
+static unsigned short read_u16(const unsigned char buf[2]);
+static void init_decoder(struct Bitstream *gif, unsigned bit_width);
+static void reset_decoder(struct Bitstream *gif);
+static int decode(struct Bitstream *gif, struct DataBlock *block);
+static int get_code(struct Bitstream *gif, struct DataBlock *block);
+static unsigned interlace_incr(unsigned y, unsigned height);
/*
* GIF specifies a canvas, which may have a palette (the "global color table")
*/
boolean
-read_gif_tiles(filename, image)
-const char *filename;
-struct TileSetImage *image;
+read_gif_tiles(const char *filename, struct TileSetImage *image)
{
struct Bitstream gif;
struct DataBlock block;
boolean have_lct, interlace;
unsigned lct_start, lct_size;
struct Pixel lct[256];
- int b;
+ int new_b;
unsigned x, y, x2, y2;
size = fread(buf, 1, 9, gif.fp);
}
}
/* 22. Table based image data */
- b = fgetc(gif.fp);
- if (b == EOF) goto error;
- if (b < MIN_LZW_BITS - 1 || MAX_LZW_BITS - 1 < b) goto error;
- init_decoder(&gif, b);
+ new_b = fgetc(gif.fp);
+ if (new_b == EOF) goto error;
+ if (new_b < MIN_LZW_BITS - 1 || MAX_LZW_BITS - 1 < new_b) goto error;
+ init_decoder(&gif, new_b);
x = 0;
y = 0;
if (!read_data_block(&gif, &block)) goto error;
while (TRUE) {
- b = decode(&gif, &block);
- if (b == EOF) goto error;
- if (b == END_OF_DATA) break;
+ new_b = decode(&gif, &block);
+ if (new_b == EOF) goto error;
+ if (new_b == END_OF_DATA) break;
if (y >= img_height) goto error;
x2 = img_left + x;
y2 = img_top + y;
if (x2 < image->width && y2 < image->height) {
- image->pixels[y2 * image->width + x2] = lct[b];
- image->indexes[y2 * image->width + x2] = b + lct_start;
+ image->pixels[y2 * image->width + x2] = lct[new_b];
+ image->indexes[y2 * image->width + x2] = new_b + lct_start;
}
++x;
if (x >= img_width) {
}
static void
-init_decoder(gif, bit_width)
-struct Bitstream *gif;
-unsigned bit_width;
+init_decoder(struct Bitstream *gif, unsigned bit_width)
{
unsigned i;
unsigned clear;
}
static void
-reset_decoder(gif)
-struct Bitstream *gif;
+reset_decoder(struct Bitstream *gif)
{
/* Set the bit width */
gif->bit_width = gif->initial_bit_width + 1;
}
static int
-decode(gif, block)
-struct Bitstream *gif;
-struct DataBlock *block;
+decode(struct Bitstream *gif, struct DataBlock *block)
{
int code;
unsigned clear = 1 << gif->initial_bit_width;
/* Get the next code, until code other than clear */
while (TRUE) {
code = get_code(gif, block);
- if (code != clear) break;
+ if ((unsigned) code != clear) break;
reset_decoder(gif);
}
if (code == EOF) return EOF;
- if (code == clear + 1) return END_OF_DATA;
+ if ((unsigned) code == clear + 1) return END_OF_DATA;
if (code > gif->dict_size) return EOF;
/* Add a new string to the dictionary */
/* code is less than gif->dict_size and not equal to clear or clear + 1 */
/* Prepare the decoded string for return; note that it is stored in
* reverse order */
- while (code >= clear) {
+ while ((unsigned) code >= clear) {
gif->string[gif->str_size++] = gif->dictionary[code].byte;
code = gif->dictionary[code].next;
}
}
static int
-get_code(gif, block)
-struct Bitstream *gif;
-struct DataBlock *block;
+get_code(struct Bitstream *gif, struct DataBlock *block)
{
int code;
}
static unsigned
-interlace_incr(y, height)
-unsigned y;
-unsigned height;
+interlace_incr(unsigned y, unsigned height)
{
static const unsigned char incr[] = { 8, 2, 4, 2 };
/* Decode an unsigned 16 bit quantity */
static unsigned short
-read_u16(buf)
-const unsigned char buf[2];
+read_u16(const unsigned char buf[2])
{
return ((unsigned short)buf[0] << 0)
| ((unsigned short)buf[1] << 8);
}
static boolean
-read_data_block(gif, block)
-struct Bitstream *gif;
-struct DataBlock *block;
+read_data_block(struct Bitstream *gif, struct DataBlock *block)
{
long pos = ftell(gif->fp);
int b;
b = fgetc(gif->fp);
if (b == EOF) return FALSE;
if (b == 0) break;
- if (fread(block->data + i, 1, b, gif->fp) != b) return FALSE;
+ if (fread(block->data + i, 1, b, gif->fp) != (unsigned) b)
+ return FALSE;
i += b;
}
}
static void
-free_data_block(block)
-struct DataBlock *block;
+free_data_block(struct DataBlock *block)
{
free(block->data);
block->size = 0;
#include "tile.h"
#ifndef MONITOR_HEAP
-extern long *FDECL(alloc, (unsigned int));
+extern long *alloc(unsigned int);
#endif
FILE *ppm_file;
static int tiles_across, tiles_down, curr_tiles_across;
static pixel **image;
-static void NDECL(write_header);
-static void NDECL(WriteTileStrip);
+static void write_header(void);
+static void WriteTileStrip(void);
static void
-write_header()
+write_header(void)
{
(void) fprintf(ppm_file, "P6 %03d %03d 255\n", PpmScreen.Width,
PpmScreen.Height);
}
static void
-WriteTileStrip()
+WriteTileStrip(void)
{
int i, j;
}
boolean
-fopen_ppm_file(filename, type)
-const char *filename;
-const char *type;
+fopen_ppm_file(const char *filename, const char *type)
{
int i;
}
boolean
-write_ppm_tile(pixels)
-pixel (*pixels)[TILE_X];
+write_ppm_tile(pixel (*pixels)[TILE_X])
{
int i, j;
}
int
-fclose_ppm_file()
+fclose_ppm_file(void)
{
int i, j;
}
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
pixel pixels[TILE_Y][TILE_X];
};
struct window_procs *
-get_safe_procs(optn)
-int optn;
+get_safe_procs(int optn)
{
if (optn) {
/* include the slightly more functional stdc versions */
/*ARGSUSED*/
void
-safe_init_nhwindows(argcp, argv)
-int *argcp UNUSED;
-char **argv UNUSED;
+safe_init_nhwindows(int *argcp UNUSED, char **argv UNUSED)
{
return;
}
void
-safe_player_selection()
+safe_player_selection(void)
{
return;
}
void
-safe_askname()
+safe_askname(void)
{
return;
}
void
-safe_get_nh_event()
+safe_get_nh_event(void)
{
return;
}
void
-safe_suspend_nhwindows(str)
-const char *str;
+safe_suspend_nhwindows(const char *str)
{
return;
}
void
-safe_resume_nhwindows()
+safe_resume_nhwindows(void)
{
return;
}
void
-safe_exit_nhwindows(str)
-const char *str;
+safe_exit_nhwindows(const char *str)
{
return;
}
winid
-safe_create_nhwindow(type)
-int type;
+safe_create_nhwindow(int type)
{
return WIN_ERR;
}
void
-safe_clear_nhwindow(window)
-winid window;
+safe_clear_nhwindow(winid window)
{
return;
}
/*ARGSUSED*/
void
-safe_display_nhwindow(window, blocking)
-winid window;
-boolean blocking;
+safe_display_nhwindow(winid window,boolean blocking)
{
return;
}
void
-safe_dismiss_nhwindow(window)
-winid window;
+safe_dismiss_nhwindow(winid window)
{
return;
}
void
-safe_destroy_nhwindow(window)
-winid window;
+safe_destroy_nhwindow(winid window)
{
return;
}
void
-safe_curs(window, x, y)
-winid window;
-int x, y;
+safe_curs(winid window, int x, int y)
{
return;
}
void
-safe_putstr(window, attr, str)
-winid window;
-int attr;
-const char *str;
+safe_putstr(winid window, int attr, const char *str)
{
return;
}
void
-safe_putmixed(window, attr, str)
-winid window;
-int attr;
-const char *str;
+safe_putmixed(winid window, int attr, const char *str)
{
return;
}
void
-safe_display_file(fname, complain)
-const char *fname;
-boolean complain;
+safe_display_file(const char * fname, boolean complain)
{
return;
}
void
-safe_start_menu(window, mbehavior)
-winid window;
-unsigned long mbehavior;
+safe_start_menu(winid window, unsigned long mbehavior)
{
return;
}
* later.
*/
void
-safe_add_menu(window, glyphinfo, identifier, ch, gch, attr, str, itemflags)
-winid window; /* window to use, must be of type NHW_MENU */
-const glyph_info *glyphinfo UNUSED; /* glyph plus glyph info */
-const anything *identifier; /* what to return if selected */
-char ch; /* keyboard accelerator (0 = pick our own) */
-char gch; /* group accelerator (0 = no group) */
-int attr; /* attribute for string (like safe_putstr()) */
-const char *str; /* menu string */
-unsigned int itemflags; /* itemflags such as marked as selected */
+safe_add_menu(
+ winid window, /* window to use, must be of type NHW_MENU */
+ const glyph_info *glyphinfo UNUSED, /* glyph plus glyph info */
+ const anything *identifier, /* what to return if selected */
+ char ch, /* keyboard accelerator (0 = pick our own) */
+ char gch, /* group accelerator (0 = no group) */
+ int attr, /* attribute for string (like safe_putstr()) */
+ const char *str, /* menu string */
+ unsigned int itemflags) /* itemflags such as marked as selected */
{
return;
}
* End a menu in this window, window must a type NHW_MENU.
*/
void
-safe_end_menu(window, prompt)
-winid window; /* menu to use */
-const char *prompt; /* prompt to for menu */
+safe_end_menu(
+ winid window, /* menu to use */
+ const char *prompt) /* prompt to for menu */
{
return;
}
int
-safe_select_menu(window, how, menu_list)
-winid window;
-int how;
-menu_item **menu_list;
+safe_select_menu(
+ winid window,
+ int how,
+ menu_item **menu_list)
{
return 0;
}
/* special hack for treating top line --More-- as a one item menu */
char
-safe_message_menu(let, how, mesg)
-char let;
-int how;
-const char *mesg;
+safe_message_menu(
+ char let,
+ int how,
+ const char *mesg)
{
return '\033';
}
void
-safe_update_inventory()
+safe_update_inventory(void)
{
return;
}
void
-safe_mark_synch()
+safe_mark_synch(void)
{
}
void
-safe_wait_synch()
+safe_wait_synch(void)
{
}
#ifdef CLIPPING
void
-safe_cliparound(x, y)
-int x, y;
+safe_cliparound(int x, int y)
{
}
#endif /* CLIPPING */
* Print the glyph to the output device. Don't flush the output device.
*/
void
-safe_print_glyph(window, x, y, glyphinfo, bkglyphinfo)
-winid window UNUSED;
-xchar x UNUSED, y UNUSED;
-const glyph_info *glyphinfo UNUSED;
-const glyph_info *bkglyphinfo UNUSED;
+safe_print_glyph(
+ winid window UNUSED,
+ xchar x UNUSED,
+ xchar y UNUSED,
+ const glyph_info *glyphinfo UNUSED,
+ const glyph_info *bkglyphinfo UNUSED)
{
return;
}
void
-safe_raw_print(str)
-const char *str;
+safe_raw_print(const char *str)
{
return;
}
void
-safe_raw_print_bold(str)
-const char *str;
+safe_raw_print_bold(const char *str)
{
return;
}
int
-safe_nhgetch()
+safe_nhgetch(void)
{
return '\033';
}
*/
/*ARGSUSED*/
int
-safe_nh_poskey(x, y, mod)
-int *x, *y, *mod;
+safe_nh_poskey(int *x, int *y, int *mod)
{
return '\033';
}
void
-win_safe_init(dir)
-int dir;
+win_safe_init(int dir)
{
return;
}
#ifdef POSITIONBAR
void
-safe_update_positionbar(posbar)
-char *posbar;
+safe_update_positionbar(char *posbar)
{
return;
}
* -- initialize the port-specific data structures.
*/
void
-safe_status_init()
+safe_status_init(void)
{
return;
}
boolean
-safe_can_suspend()
+safe_can_suspend(void)
{
return FALSE;
}
void
-safe_nhbell()
+safe_nhbell(void)
{
return;
}
int
-safe_doprev_message()
+safe_doprev_message(void)
{
return 0;
}
char
-safe_yn_function(query, resp, def)
-const char *query;
-const char *resp;
-char def;
+safe_yn_function(const char * query, const char* resp, char def)
{
return '\033';
}
/*ARGSUSED*/
void
-safe_getlin(prompt, outbuf)
-const char *prompt UNUSED;
-char *outbuf;
+safe_getlin(const char* prompt UNUSED, char *outbuf)
{
Strcpy(outbuf, "\033");
}
int
-safe_get_ext_cmd()
+safe_get_ext_cmd(void)
{
return '\033';
}
void
-safe_number_pad(mode)
-int mode;
+safe_number_pad(int mode)
{
return;
}
void
-safe_delay_output()
+safe_delay_output(void)
{
return;
}
void
-safe_start_screen()
+safe_start_screen(void)
{
return;
}
void
-safe_end_screen()
+safe_end_screen(void)
{
return;
}
void
-safe_outrip(tmpwin, how, when)
-winid tmpwin;
-int how;
-time_t when;
+safe_outrip(winid tmpwin, int how, time_t when)
{
return;
}
/*ARGSUSED*/
void
-safe_preference_update(pref)
-const char *pref UNUSED;
+safe_preference_update(const char* pref UNUSED)
{
return;
}
char *
-safe_getmsghistory(init)
-boolean init UNUSED;
+safe_getmsghistory(boolean init UNUSED)
{
return (char *) 0;
}
void
-safe_putmsghistory(msg, is_restoring)
-const char *msg;
-boolean is_restoring;
+safe_putmsghistory(
+ const char *msg,
+ boolean is_restoring)
{
}
void
-safe_status_finish()
+safe_status_finish(void)
{
}
void
-safe_status_enablefield(fieldidx, nm, fmt, enable)
-int fieldidx;
-const char *nm;
-const char *fmt;
-boolean enable;
+safe_status_enablefield(
+ int fieldidx,
+ const char *nm,
+ const char *fmt,
+ boolean enable)
{
}
/* call once for each field, then call with BL_FLUSH to output the result */
void
-safe_status_update(idx, ptr, chg, percent, color, colormasks)
-int idx;
-genericptr_t ptr;
-int chg UNUSED, percent UNUSED, color UNUSED;
-unsigned long *colormasks UNUSED;
+safe_status_update(
+ int idx,
+ genericptr_t ptr,
+ int chg UNUSED,
+ int percent UNUSED,
+ int color UNUSED,
+ unsigned long *colormasks UNUSED)
{
}
/* Add to your code: windowprocs.win_raw_print = stdio_wait_synch; */
void
-stdio_wait_synch()
+stdio_wait_synch(void)
{
char valid[] = {' ', '\n', '\r', '\033', '\0'};
/* Add to your code: windowprocs.win_raw_print = stdio_raw_print; */
void
-stdio_raw_print(str)
-const char *str;
+stdio_raw_print(const char* str)
{
if (str)
fprintf(stdout, "%s\n", str);
/* no newline variation, add to your code:
windowprocs.win_raw_print = stdio_nonl_raw_print; */
void
-stdio_nonl_raw_print(str)
-const char *str;
+stdio_nonl_raw_print(const char* str)
{
if (str)
fprintf(stdout, "%s", str);
/* Add to your code: windowprocs.win_raw_print_bold = stdio_raw_print_bold; */
void
-stdio_raw_print_bold(str)
-const char *str;
+stdio_raw_print_bold(const char* str)
{
stdio_raw_print(str);
return;
/* Add to your code: windowprocs.win_nhgetch = stdio_nhgetch; */
int
-stdio_nhgetch()
+stdio_nhgetch(void)
{
return getchar();
}
#define Fprintf (void) fprintf
-extern boolean FDECL(fopen_text_file, (const char *, const char *));
-extern boolean FDECL(read_text_tile, (pixel(*) [TILE_X]));
-extern boolean FDECL(write_text_tile, (pixel(*) [TILE_X]));
-extern int NDECL(fclose_text_file);
+extern boolean fopen_text_file(const char *, const char *);
+extern boolean read_text_tile(pixel(*) [TILE_X]);
+extern boolean write_text_tile(pixel(*) [TILE_X]);
+extern int fclose_text_file(void);
-extern void FDECL(set_grayscale, (int));
-extern void NDECL(init_colormap);
-extern void NDECL(merge_colormap);
+extern void set_grayscale(int);
+extern void init_colormap(void);
+extern void merge_colormap(void);
#if defined(MICRO) || defined(WIN32)
#undef exit
#if !defined(MSDOS) && !defined(WIN32)
-extern void FDECL(exit, (int));
+extern void exit(int);
#endif
#endif
#include "config.h"
#include "tile.h"
-extern void NDECL(monst_globals_init);
-extern void NDECL(objects_globals_init);
+extern void monst_globals_init(void);
+extern void objects_globals_init(void);
#include <stdint.h>
#if defined(UINT32_MAX) && defined(INT32_MAX) && defined(UINT16_MAX)
#define BITCOUNT 8
-extern char *FDECL(tilename, (int, int));
+extern char *tilename(int, int);
#define MAGICTILENO (340 + 440 + 231 + 340)
pixel tilepixels[TILE_Y][TILE_X];
-static void FDECL(build_bmfh, (BITMAPFILEHEADER *));
-static void FDECL(build_bmih, (BITMAPINFOHEADER *));
-static void FDECL(build_bmptile, (pixel(*) [TILE_X]));
+static void build_bmfh(BITMAPFILEHEADER *);
+static void build_bmih(BITMAPINFOHEADER *);
+static void build_bmptile(pixel(*) [TILE_X]);
const char *tilefiles[] = {
#if (TILE_X == 32)
FILE *fp;
int
-main(argc, argv)
-int argc;
-char *argv[];
+main(int argc, char *argv[])
{
int i, j;
}
static void
-build_bmfh(pbmfh)
-BITMAPFILEHEADER *pbmfh;
+build_bmfh(BITMAPFILEHEADER* pbmfh)
{
pbmfh->bfType = leshort(0x4D42);
pbmfh->bfSize = lelong(BMPFILESIZE);
}
static void
-build_bmih(pbmih)
-BITMAPINFOHEADER *pbmih;
+build_bmih(BITMAPINFOHEADER* pbmih)
{
WORD cClrBits;
int w, h;
}
static void
-build_bmptile(pixels)
-pixel (*pixels)[TILE_X];
+build_bmptile(pixel(*pixels)[TILE_X])
{
int cur_x, cur_y, cur_color, apply_color;
int x, y;
FILE *tilemap_file;
#endif
-const char *FDECL(tilename, (int, int, int));
-void NDECL(init_tilemap);
-void FDECL(process_substitutions, (FILE *));
-boolean FDECL(acceptable_tilename, (int, int, const char *, const char *));
+const char *tilename(int, int, int);
+void init_tilemap(void);
+void process_substitutions(FILE *);
+boolean acceptable_tilename(int, int, const char *, const char *);
#if defined(MICRO) || defined(WIN32)
#undef exit
#if !defined(MSDOS) && !defined(WIN32)
-extern void FDECL(exit, (int));
+extern void exit(int);
#endif
#endif
* file_entry is the position of the tile within the monsters/objects/other set
*/
const char *
-tilename(set, file_entry, gend)
-int set, file_entry, gend;
+tilename(int set, int file_entry, int gend)
{
int i, j, condnum, tilenum, gendnum;
static char buf[BUFSZ];
* introduced in 3.3.1.
*/
void
-init_tilemap()
+init_tilemap(void)
{
int i, j, condnum, tilenum;
int corpsetile, swallowbase;
#endif
}
-const char *prolog[] = { "", "void", "substitute_tiles(plev)",
- "d_level *plev;", "{", " int i;", "" };
+const char *prolog[] = { "", "void", "substitute_tiles(d_level *plev)",
+ "{", " int i;", "" };
const char *epilog[] = { " return;", "}" };
/* write out the substitutions in an easily-used form. */
void
-process_substitutions(ofp)
-FILE *ofp;
+process_substitutions(FILE *ofp)
{
static const char Dent[] = " "; /* 4 space indentation */
int i, j, k, span, start;
}
#ifdef OBTAIN_TILEMAP
-extern void NDECL(monst_globals_init);
-extern void NDECL(objects_globals_init);
+extern void monst_globals_init(void);
+extern void objects_globals_init(void);
#endif
int
-main()
+main(int argc UNUSED, char *argv[] UNUSED)
{
register int i;
char filename[30];
};
boolean
-acceptable_tilename(glyph_set, idx, encountered, expected)
-int glyph_set, idx;
-const char *encountered, *expected;
+acceptable_tilename(int glyph_set, int idx, const char *encountered,
+ const char *expected)
{
if (glyph_set == OTH_GLYPH) {
if (idx >= 0 && idx < SIZE(altlabels)) {
#include "flag.h"
#include "tileset.h"
-static void FDECL(get_tile_map, (const char *));
-static unsigned FDECL(gcd, (unsigned, unsigned));
-static void FDECL(split_tiles, (const struct TileSetImage *));
-static void FDECL(free_image, (struct TileSetImage *));
+static void get_tile_map(const char *);
+static unsigned gcd(unsigned, unsigned);
+static void split_tiles(const struct TileSetImage *);
+static void free_image(struct TileSetImage *);
static struct TileImage *tiles;
static unsigned num_tiles;
static struct Pixel palette[256];
boolean
-read_tiles(filename, true_color)
-const char *filename;
-boolean true_color;
+read_tiles(const char *filename, boolean true_color)
{
static const unsigned char png_sig[] = {
0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A
/* Free tile memory not required by the chosen display mode */
void
-set_tile_type(true_color)
-boolean true_color;
+set_tile_type(boolean true_color)
{
unsigned i;
}
const struct Pixel *
-get_palette()
+get_palette(void)
{
return have_palette ? palette : NULL;
}
/* TODO: derive tile_map from image_desc */
static void
-get_tile_map(image_desc)
-const char *image_desc;
+get_tile_map(const char *image_desc UNUSED)
{
return;
}
void
-free_tiles()
+free_tiles(void)
{
unsigned i;
}
static void
-free_image(image)
-struct TileSetImage *image;
+free_image(struct TileSetImage *image)
{
if (image->pixels)
free((genericptr_t) image->pixels), image->pixels = NULL;
}
const struct TileImage *
-get_tile(tile_index)
-unsigned tile_index;
+get_tile(unsigned tile_index)
{
if (tile_index >= num_tiles)
return &blank_tile;
/* Note that any tile returned by this function must be freed */
struct TileImage *
-stretch_tile(inp_tile, out_width, out_height)
-const struct TileImage *inp_tile;
-unsigned out_width, out_height;
+stretch_tile(const struct TileImage *inp_tile,
+ unsigned out_width, unsigned out_height)
{
unsigned x_scale_inp, x_scale_out, y_scale_inp, y_scale_out;
unsigned divisor;
/* Free a tile returned by stretch_tile */
/* Do NOT use this with tiles returned by get_tile */
void
-free_tile(tile)
-struct TileImage *tile;
+free_tile(struct TileImage *tile)
{
if (tile != NULL) {
free(tile->indexes);
/* Return the greatest common divisor */
static unsigned
-gcd(a, b)
-unsigned a, b;
+gcd(unsigned a, unsigned b)
{
while (TRUE) {
if (b == 0) return a;
}
static void
-split_tiles(image)
-const struct TileSetImage *image;
+split_tiles(const struct TileSetImage *image)
{
unsigned tile_rows, tile_cols;
size_t tile_size, i, j;
if (image->indexes != NULL) {
tile->indexes = (unsigned char *) alloc(tile_size);
}
- for (y2 = 0; y2 < iflags.wc_tile_height; ++y2) {
- for (x2 = 0; x2 < iflags.wc_tile_width; ++x2) {
+ for (y2 = 0; y2 < (unsigned) iflags.wc_tile_height; ++y2) {
+ for (x2 = 0; x2 < (unsigned) iflags.wc_tile_width; ++x2) {
unsigned x = x1 * iflags.wc_tile_width + x2;
unsigned y = y1 * iflags.wc_tile_height + y2;
}
boolean
-read_png_tiles(filename, image)
-const char *filename;
-struct TileSetImage *image;
+read_png_tiles(const char *filename UNUSED, struct TileSetImage *image UNUSED)
{
/* stub */
return FALSE;
"other.txt" };
#endif
-extern const char *FDECL(tilename, (int, int, int));
-extern boolean FDECL(acceptable_tilename, (int, int, const char *, const char *));
-static void FDECL(read_text_colormap, (FILE *));
-static boolean FDECL(write_text_colormap, (FILE *));
-static boolean FDECL(read_txttile, (FILE *, pixel (*)[TILE_X]));
-static void FDECL(write_txttile, (FILE *, pixel (*)[TILE_X]));
+extern const char *tilename(int, int, int);
+extern boolean acceptable_tilename(int, int, const char *, const char *);
+static void read_text_colormap(FILE *);
+static boolean write_text_colormap(FILE *);
+static boolean read_txttile(FILE *, pixel (*)[TILE_X]);
+static void write_txttile(FILE *, pixel (*)[TILE_X]);
enum { MONSTER_SET, OBJECT_SET, OTHER_SET};
};
void
-set_grayscale(g)
-int g;
+set_grayscale(int g)
{
grayscale = g;
}
static void
-read_text_colormap(txtfile)
-FILE *txtfile;
+read_text_colormap(FILE *txtfile)
{
int i, r, g, b;
char c[2];
#undef FORMAT_STRING
static boolean
-write_text_colormap(txtfile)
-FILE *txtfile;
+write_text_colormap(FILE *txtfile)
{
int i;
char c;
}
static boolean
-read_txttile(txtfile, pixels)
-FILE *txtfile;
-pixel (*pixels)[TILE_X];
+read_txttile(FILE *txtfile, pixel (*pixels)[TILE_X])
{
int ph, i, j, k, reslt;
char buf[BUFSZ], ttype[BUFSZ], gend[BUFSZ];
}
static void
-write_txttile(txtfile, pixels)
-FILE *txtfile;
-pixel (*pixels)[TILE_X];
+write_txttile(FILE *txtfile, pixel (*pixels)[TILE_X])
{
const char *p;
const char *type;
/* initialize main colormap from globally accessed ColorMap */
void
-init_colormap()
+init_colormap(void)
{
int i;
/* merge new colors from ColorMap into MainColorMap */
void
-merge_colormap()
+merge_colormap(void)
{
int i, j;
}
boolean
-fopen_text_file(filename, type)
-const char *filename;
-const char *type;
+fopen_text_file(const char *filename, const char *type)
{
const char *p;
int i;
}
boolean
-read_text_tile(pixels)
-pixel (*pixels)[TILE_X];
+read_text_tile(pixel (*pixels)[TILE_X])
{
return (read_txttile(tile_file, pixels));
}
boolean
-write_text_tile(pixels)
-pixel (*pixels)[TILE_X];
+write_text_tile(pixel (*pixels)[TILE_X])
{
write_txttile(tile_file, pixels);
return TRUE;
}
int
-fclose_text_file()
+fclose_text_file(void)
{
int ret;
VDECLCB(shim_resume_nhwindows,(void), "v")
DECLCB(winid, shim_create_nhwindow, (int type), "ii", A2P type)
VDECLCB(shim_clear_nhwindow,(winid window), "vi", A2P window)
-VDECLCB(shim_display_nhwindow,(winid window, BOOLEAN_P blocking), "vii", A2P window, A2P blocking)
+VDECLCB(shim_display_nhwindow,(winid window, boolean blocking), "vii", A2P window, A2P blocking)
VDECLCB(shim_destroy_nhwindow,(winid window), "vi", A2P window)
VDECLCB(shim_curs,(winid a, int x, int y), "viii", A2P a, A2P x, A2P y)
VDECLCB(shim_putstr,(winid w, int attr, const char *str), "viis", A2P w, A2P attr, P2V str)
-VDECLCB(shim_display_file,(const char *name, BOOLEAN_P complain), "vsi", P2V name, A2P complain)
+VDECLCB(shim_display_file,(const char *name, boolean complain), "vsi", P2V name, A2P complain)
VDECLCB(shim_start_menu,(winid window, unsigned long mbehavior), "vii", A2P window, A2P mbehavior)
VDECLCB(shim_add_menu,
- (winid window, const glyph_info *glyphinfo, const ANY_P *identifier, CHAR_P ch, CHAR_P gch, int attr, const char *str, unsigned int itemflags),
+ (winid window, const glyph_info *glyphinfo, const ANY_P *identifier, char ch, char gch, int attr, const char *str, unsigned int itemflags),
"viipiiisi",
- A2P window, P2VP glyphinfo, P2V identifier, A2P ch, A2P gch, A2P attr, P2V str, A2P itemflags)
+ A2P window, P2V glyphinfo, P2V identifier, A2P ch, A2P gch, A2P attr, P2V str, A2P itemflags)
VDECLCB(shim_end_menu,(winid window, const char *prompt), "vis", A2P window, P2V prompt)
/* XXX: shim_select_menu menu_list is an output */
DECLCB(int, shim_select_menu,(winid window, int how, MENU_ITEM_P **menu_list), "iiio", A2P window, A2P how, P2V menu_list)
-DECLCB(char, shim_message_menu,(CHAR_P let, int how, const char *mesg), "ciis", A2P let, A2P how, P2V mesg)
+DECLCB(char, shim_message_menu,(char let, int how, const char *mesg), "ciis", A2P let, A2P how, P2V mesg)
VDECLCB(shim_mark_synch,(void), "v")
VDECLCB(shim_wait_synch,(void), "v")
VDECLCB(shim_cliparound,(int x, int y), "vii", A2P x, A2P y)
VDECLCB(shim_update_positionbar,(char *posbar), "vp", P2V posbar)
-VDECLCB(shim_print_glyph,(winid w, int x, int y, const glyph_info *glyph, const glyph_info *bkglyph), "viiiii", A2P w, A2P x, A2P y, V2P glyphinfo, V2P bkglyphinfo)
+VDECLCB(shim_print_glyph,(winid w, int x, int y, const glyph_info *glyphinfo, const glyph_info *bkglyphinfo), "viiiii", A2P w, A2P x, A2P y, P2V glyphinfo, P2V bkglyphinfo)
VDECLCB(shim_raw_print,(const char *str), "vs", P2V str)
VDECLCB(shim_raw_print_bold,(const char *str), "vs", P2V str)
DECLCB(int, shim_nhgetch,(void), "i")
DECLCB(int, shim_nh_poskey,(int *x, int *y, int *mod), "iooo", P2V x, P2V y, P2V mod)
VDECLCB(shim_nhbell,(void), "v")
DECLCB(int, shim_doprev_message,(void),"iv")
-DECLCB(char, shim_yn_function,(const char *query, const char *resp, CHAR_P def), "cssi", P2V query, P2V resp, A2P def)
+DECLCB(char, shim_yn_function,(const char *query, const char *resp, char def), "cssi", P2V query, P2V resp, A2P def)
VDECLCB(shim_getlin,(const char *query, char *bufp), "vso", P2V query, P2V bufp)
DECLCB(int,shim_get_ext_cmd,(void),"iv")
VDECLCB(shim_number_pad,(int state), "vi", A2P state)
VDECLCB(shim_start_screen, (void), "v")
VDECLCB(shim_end_screen, (void), "v")
VDECLCB(shim_preference_update, (const char *pref), "vp", P2V pref)
-DECLCB(char *,shim_getmsghistory, (BOOLEAN_P init), "si", A2P init)
-VDECLCB(shim_putmsghistory, (const char *msg, BOOLEAN_P restoring_msghist), "vsi", P2V msg, A2P restoring_msghist)
+DECLCB(char *,shim_getmsghistory, (boolean init), "si", A2P init)
+VDECLCB(shim_putmsghistory, (const char *msg, boolean restoring_msghist), "vsi", P2V msg, A2P restoring_msghist)
VDECLCB(shim_status_init, (void), "v")
VDECLCB(shim_status_enablefield,
- (int fieldidx, const char *nm, const char *fmt, BOOLEAN_P enable),
+ (int fieldidx, const char *nm, const char *fmt, boolean enable),
"vippi",
A2P fieldidx, P2V nm, P2V fmt, A2P enable)
/* XXX: the second argument to shim_status_update is sometimes an integer and sometimes a pointer */
char morc = 0; /* tell the outside world what char you chose */
static boolean suppress_history;
-static boolean FDECL(ext_cmd_getlin_hook, (char *));
+static boolean ext_cmd_getlin_hook(char *);
-typedef boolean FDECL((*getlin_hook_proc), (char *));
+typedef boolean (*getlin_hook_proc)(char *);
-static void FDECL(hooked_tty_getlin,
- (const char *, char *, getlin_hook_proc));
-extern int NDECL(extcmd_via_menu); /* cmd.c */
+static void hooked_tty_getlin(const char *, char *, getlin_hook_proc);
+extern int extcmd_via_menu(void); /* cmd.c */
extern char erase_char, kill_char; /* from appropriate tty.c file */
* resulting string is "\033".
*/
void
-tty_getlin(query, bufp)
-const char *query;
-register char *bufp;
+tty_getlin(const char *query, register char *bufp)
{
suppress_history = FALSE;
hooked_tty_getlin(query, bufp, (getlin_hook_proc) 0);
}
static void
-hooked_tty_getlin(query, bufp, hook)
-const char *query;
-register char *bufp;
-getlin_hook_proc hook;
+hooked_tty_getlin(const char *query, register char *bufp, getlin_hook_proc hook)
{
register char *obufp = bufp;
register int c;
}
void
-xwaitforspace(s)
-register const char *s; /* chars allowed besides return */
+xwaitforspace(register const char *s) /* chars allowed besides return */
{
register int c, x = ttyDisplay ? (int) ttyDisplay->dismiss_more : '\n';
* + base has enough room to hold our string
*/
static boolean
-ext_cmd_getlin_hook(base)
-char *base;
+ext_cmd_getlin_hook(char *base)
{
int oindex, com_index;
* stop when we have found enough characters to make a unique command.
*/
int
-tty_get_ext_cmd()
+tty_get_ext_cmd(void)
{
int i;
char buf[BUFSZ];
#define Tgetstr(key) (tgetstr(key, &tbufptr))
-static char *FDECL(s_atr2str, (int));
-static char *FDECL(e_atr2str, (int));
+static char *s_atr2str(int);
+static char *e_atr2str(int);
-void FDECL(cmov, (int, int));
-void FDECL(nocmov, (int, int));
+void cmov(int, int);
+void nocmov(int, int);
#if defined(TEXTCOLOR) && defined(TERMLIB)
#if (!defined(UNIX) || !defined(TERMINFO)) && !defined(TOS)
-static void FDECL(analyze_seq, (char *, int *, int *));
+static void analyze_seq(char *, int *, int *);
#endif
#endif
#if defined(TEXTCOLOR) && (defined(TERMLIB) || defined(ANSI_DEFAULT))
-static void NDECL(init_hilite);
-static void NDECL(kill_hilite);
+static void init_hilite(void);
+static void kill_hilite(void);
#endif
/* (see tcap.h) -- nh_CM, nh_ND, nh_CD, nh_HI,nh_HE, nh_US,nh_UE, ul_hack */
#endif /* TERMLIB */
void
-tty_startup(wid, hgt)
-int *wid, *hgt;
+tty_startup(int *wid, int *hgt)
{
#ifdef TERMLIB
register const char *term;
*/
/* deallocate resources prior to final termination */
void
-tty_shutdown()
+tty_shutdown(void)
{
/* we only attempt to clean up a few individual termcap variables */
#if defined(TEXTCOLOR) && (defined(TERMLIB) || defined(ANSI_DEFAULT))
}
void
-tty_number_pad(state)
-int state;
+tty_number_pad(int state)
{
switch (state) {
case -1: /* activate keypad mode (escape sequences) */
}
#ifdef TERMLIB
-extern void NDECL((*decgraphics_mode_callback)); /* defined in symbols.c */
-static void NDECL(tty_decgraphics_termcap_fixup);
+extern void (*decgraphics_mode_callback)(void); /* defined in symbols.c */
+static void tty_decgraphics_termcap_fixup(void);
/*
We call this routine whenever DECgraphics mode is enabled, even if it
so this is a convenient hook.
*/
static void
-tty_decgraphics_termcap_fixup()
+tty_decgraphics_termcap_fixup(void)
{
static char ctrlN[] = "\016";
static char ctrlO[] = "\017";
#endif /* TERMLIB */
#if defined(ASCIIGRAPH) && defined(PC9800)
-extern void NDECL((*ibmgraphics_mode_callback)); /* defined in drawing.c */
+extern void (*ibmgraphics_mode_callback)(void); /* defined in drawing.c */
#endif
#ifdef PC9800
-extern void NDECL((*ascgraphics_mode_callback)); /* defined in drawing.c */
-static void NDECL(tty_ascgraphics_hilite_fixup);
+extern void (*ascgraphics_mode_callback)(void); /* defined in drawing.c */
+static void tty_ascgraphics_hilite_fixup(void);
static void
-tty_ascgraphics_hilite_fixup()
+tty_ascgraphics_hilite_fixup(void)
{
register int c;
#endif /* PC9800 */
void
-tty_start_screen()
+tty_start_screen(void)
{
xputs(TI);
xputs(VS);
}
void
-tty_end_screen()
+tty_end_screen(void)
{
clear_screen();
xputs(VE);
then action must be taken in trampoli.[ch]. */
void
-nocmov(x, y)
-int x, y;
+nocmov(int x, int y)
{
if ((int) ttyDisplay->cury > y) {
if (UP) {
}
void
-cmov(x, y)
-register int x, y;
+cmov(register int x, register int y)
{
xputs(tgoto(nh_CM, x, y));
ttyDisplay->cury = y;
/* See note above. xputc() is a special function for overlays. */
int
-xputc(c)
-int c; /* actually char, but explicitly specify its widened type */
+xputc(int c) /* actually char, but explicitly specify its widened type */
{
/*
* Note: xputc() as a direct all to putchar() doesn't make any
}
void
-xputs(s)
-const char *s;
+xputs(const char *s)
{
#ifndef TERMLIB
(void) fputs(s, stdout);
}
void
-cl_end()
+cl_end(void)
{
if (CE) {
xputs(CE);
}
void
-clear_screen()
+clear_screen(void)
{
/* note: if CL is null, then termcap initialization failed,
so don't attempt screen-oriented I/O during final cleanup.
}
void
-home()
+home(void)
{
if (HO)
xputs(HO);
}
void
-standoutbeg()
+standoutbeg(void)
{
if (SO)
xputs(SO);
}
void
-standoutend()
+standoutend(void)
{
if (SE)
xputs(SE);
#if 0 /* if you need one of these, uncomment it (here and in extern.h) */
void
-revbeg()
+revbeg(void)
{
if (MR)
xputs(MR);
}
void
-boldbeg()
+boldbeg(void)
{
if (MD)
xputs(MD);
}
void
-blinkbeg()
+blinkbeg(void)
{
if (MB)
xputs(MB);
}
void
-dimbeg()
+dimbeg(void)
{
/* not in most termcap entries */
if (MH)
}
void
-m_end()
+m_end(void)
{
if (ME)
xputs(ME);
#endif /*0*/
void
-backsp()
+backsp(void)
{
xputs(BC);
}
void
-tty_nhbell()
+tty_nhbell(void)
{
if (flags.silent)
return;
#ifdef ASCIIGRAPH
void
-graph_on()
+graph_on(void)
{
if (AS)
xputs(AS);
}
void
-graph_off()
+graph_off(void)
{
if (AE)
xputs(AE);
/* delay 50 ms */
void
-tty_delay_output()
+tty_delay_output(void)
{
#if defined(MICRO)
register int i;
/* must only be called with curx = 1 */
void
-cl_eos() /* free after Robert Viduya */
+cl_eos(void) /* free after Robert Viduya */
{
if (nh_CD) {
xputs(nh_CD);
static char nilstring[] = "";
static void
-init_hilite()
+init_hilite(void)
{
register int c;
char *setf, *scratch;
}
static void
-kill_hilite()
+kill_hilite(void)
{
/* if colors weren't available, no freeing needed */
if (hilites[CLR_BLACK] == nh_HI)
#ifndef TOS
/* find the foreground and background colors set by nh_HI or nh_HE */
static void
-analyze_seq(str, fg, bg)
-char *str;
-int *fg, *bg;
+analyze_seq(char *str, int *fg, int *bg)
{
register int c, code;
int len;
*/
static void
-init_hilite()
+init_hilite(void)
{
register int c;
#ifdef TOS
}
static void
-kill_hilite()
+kill_hilite(void)
{
#ifndef TOS
register int c;
static char adef_nilstring[] = "";
static void
-init_hilite()
+init_hilite(void)
{
register int c;
}
static void
-kill_hilite()
+kill_hilite(void)
{
register int c;
static char nulstr[] = "";
static char *
-s_atr2str(n)
-int n;
+s_atr2str(int n)
{
switch (n) {
case ATR_BLINK:
}
static char *
-e_atr2str(n)
-int n;
+e_atr2str(int n)
{
switch (n) {
case ATR_ULINE:
/* suppress nonfunctional highlights so render_status() might be able to
optimize more; keep this in sync with s_atr2str() */
int
-term_attr_fixup(msk)
-int msk;
+term_attr_fixup(int msk)
{
/* underline is converted to bold if its start sequence isn't available */
if ((msk & HL_ULINE) && (!nh_US || !*nh_US)) {
}
void
-term_start_attr(attr)
-int attr;
+term_start_attr(int attr)
{
if (attr) {
const char *astr = s_atr2str(attr);
}
void
-term_end_attr(attr)
-int attr;
+term_end_attr(int attr)
{
if (attr) {
const char *astr = e_atr2str(attr);
}
void
-term_start_raw_bold()
+term_start_raw_bold(void)
{
xputs(nh_HI);
}
void
-term_end_raw_bold()
+term_end_raw_bold(void)
{
xputs(nh_HE);
}
#ifdef TEXTCOLOR
void
-term_end_color()
+term_end_color(void)
{
xputs(nh_HE);
}
void
-term_start_color(color)
-int color;
+term_start_color(int color)
{
if (color < CLR_MAX && hilites[color] && *hilites[color])
xputs(hilites[color]);
#define C(c) (0x1f & (c))
#endif
-static void FDECL(redotoplin, (const char *));
-static void FDECL(topl_putsym, (CHAR_P));
-static void FDECL(removetopl, (int));
-static void FDECL(msghistory_snapshot, (BOOLEAN_P));
-static void FDECL(free_msghistory_snapshot, (BOOLEAN_P));
+static void redotoplin(const char *);
+static void topl_putsym(char);
+static void removetopl(int);
+static void msghistory_snapshot(boolean);
+static void free_msghistory_snapshot(boolean);
int
-tty_doprev_message()
+tty_doprev_message(void)
{
register struct WinDesc *cw = wins[WIN_MESSAGE];
winid prevmsg_win;
}
static void
-redotoplin(str)
-const char *str;
+redotoplin(const char *str)
{
int otoplin = ttyDisplay->toplin;
/* for use by tty_putstr() */
void
-show_topl(str)
-const char *str;
+show_topl(const char *str)
{
struct WinDesc *cw = wins[WIN_MESSAGE];
/* used by update_topl(); also by tty_putstr() */
void
-remember_topl()
+remember_topl(void)
{
register struct WinDesc *cw = wins[WIN_MESSAGE];
int idx = cw->maxrow;
}
void
-addtopl(s)
-const char *s;
+addtopl(const char *s)
{
register struct WinDesc *cw = wins[WIN_MESSAGE];
}
void
-more()
+more(void)
{
struct WinDesc *cw = wins[WIN_MESSAGE];
}
void
-update_topl(bp)
-register const char *bp;
+update_topl(register const char *bp)
{
register char *tl, *otl;
register int n0;
redotoplin(g.toplines);
}
-static
-void
-topl_putsym(c)
-char c;
+static void
+topl_putsym(char c)
{
register struct WinDesc *cw = wins[WIN_MESSAGE];
}
void
-putsyms(str)
-const char *str;
+putsyms(const char *str)
{
while (*str)
topl_putsym(*str++);
}
static void
-removetopl(n)
-register int n;
+removetopl(register int n)
{
/* assume addtopl() has been done, so ttyDisplay->toplin is already set */
while (n-- > 0)
/* returns a single keystroke; also sets 'yn_number' */
char
-tty_yn_function(query, resp, def)
-const char *query, *resp;
-char def;
+tty_yn_function(const char *query, const char *resp, char def)
/*
* Generic yes/no function. 'def' is the default (returned by space or
* return; 'esc' returns 'q', or 'n', or the default, depending on
/* collect currently available message history data into a sequential array;
optionally, purge that data from the active circular buffer set as we go */
static void
-msghistory_snapshot(purge)
-boolean purge; /* clear message history buffer as we copy it */
+msghistory_snapshot(boolean purge) /* clear message history buffer
+ as we copy it */
{
char *mesg;
int i, inidx, outidx;
/* release memory allocated to message history snapshot */
static void
-free_msghistory_snapshot(purged)
-boolean purged; /* True: took history's pointers, False: just cloned them */
+free_msghistory_snapshot(boolean purged) /* True: took history's pointers,
+ False: just cloned them */
{
if (snapshot_mesgs) {
/* snapshot pointers are no longer in use */
* included among the output of the subsequent calls.
*/
char *
-tty_getmsghistory(init)
-boolean init;
+tty_getmsghistory(boolean init)
{
static int nxtidx;
char *nextmesg;
* into message history for ^P recall without having displayed it.
*/
void
-tty_putmsghistory(msg, restoring_msghist)
-const char *msg;
-boolean restoring_msghist;
+tty_putmsghistory(const char *msg, boolean restoring_msghist)
{
static boolean initd = FALSE;
int idx;
struct WinDesc *wins[MAXWIN];
struct DisplayDesc *ttyDisplay; /* the tty display descriptor */
-extern void FDECL(cmov, (int, int)); /* from termcap.c */
-extern void FDECL(nocmov, (int, int)); /* from termcap.c */
+extern void cmov(int, int); /* from termcap.c */
+extern void nocmov(int, int); /* from termcap.c */
#if defined(UNIX) || defined(VMS)
static char obuf[BUFSIZ]; /* BUFSIZ is defined in stdio.h */
#endif
#endif /* CLIPPING */
#if defined(USE_TILES) && defined(MSDOS)
-extern void FDECL(adjust_cursor_flags, (struct WinDesc *));
+extern void adjust_cursor_flags(struct WinDesc *);
#endif
#if defined(ASCIIGRAPH) && !defined(NO_TERMS)
static const char to_continue[] = "to continue";
#define getret() getreturn(to_continue)
#else
-static void NDECL(getret);
+static void getret(void);
#endif
-static void FDECL(bail, (const char *)); /* __attribute__((noreturn)) */
-static void NDECL(new_status_window);
-static void FDECL(erase_menu_or_text, (winid, struct WinDesc *,
- BOOLEAN_P));
-static void FDECL(free_window_info, (struct WinDesc *, BOOLEAN_P));
-static boolean FDECL(toggle_menu_curr, (winid, tty_menu_item *, int,
- BOOLEAN_P, BOOLEAN_P, long));
-static void FDECL(dmore, (struct WinDesc *, const char *));
-static void FDECL(set_item_state, (winid, int, tty_menu_item *));
-static void FDECL(set_all_on_page, (winid, tty_menu_item *,
- tty_menu_item *));
-static void FDECL(unset_all_on_page, (winid, tty_menu_item *,
- tty_menu_item *));
-static void FDECL(invert_all_on_page, (winid, tty_menu_item *,
- tty_menu_item *, CHAR_P));
-static void FDECL(invert_all, (winid, tty_menu_item *,
- tty_menu_item *, CHAR_P));
-static void FDECL(toggle_menu_attr, (BOOLEAN_P, int, int));
-static void FDECL(process_menu_window, (winid, struct WinDesc *));
-static void FDECL(process_text_window, (winid, struct WinDesc *));
-static tty_menu_item *FDECL(reverse, (tty_menu_item *));
-static const char *FDECL(compress_str, (const char *));
-static void FDECL(tty_putsym, (winid, int, int, CHAR_P));
-static void FDECL(setup_rolemenu, (winid, BOOLEAN_P, int, int, int));
-static void FDECL(setup_racemenu, (winid, BOOLEAN_P, int, int, int));
-static void FDECL(setup_gendmenu, (winid, BOOLEAN_P, int, int, int));
-static void FDECL(setup_algnmenu, (winid, BOOLEAN_P, int, int, int));
-static boolean NDECL(reset_role_filtering);
+static void bail(const char *); /* __attribute__((noreturn)) */
+static void new_status_window(void);
+static void erase_menu_or_text(winid, struct WinDesc *, boolean);
+static void free_window_info(struct WinDesc *, boolean);
+static boolean toggle_menu_curr(winid, tty_menu_item *, int, boolean,
+ boolean, long);
+static void dmore(struct WinDesc *, const char *);
+static void set_item_state(winid, int, tty_menu_item *);
+static void set_all_on_page(winid, tty_menu_item *, tty_menu_item *);
+static void unset_all_on_page(winid, tty_menu_item *, tty_menu_item *);
+static void invert_all_on_page(winid, tty_menu_item *, tty_menu_item *,
+ char);
+static void invert_all(winid, tty_menu_item *, tty_menu_item *, char);
+static void toggle_menu_attr(boolean, int, int);
+static void process_menu_window(winid, struct WinDesc *);
+static void process_text_window(winid, struct WinDesc *);
+static tty_menu_item *reverse(tty_menu_item *);
+static const char *compress_str(const char *);
+static void tty_putsym(winid, int, int, char);
+static void setup_rolemenu(winid, boolean, int, int, int);
+static void setup_racemenu(winid, boolean, int, int, int);
+static void setup_gendmenu(winid, boolean, int, int, int);
+static void setup_algnmenu(winid, boolean, int, int, int);
+static boolean reset_role_filtering(void);
#ifdef STATUS_HILITES
-static boolean FDECL(check_fields, (BOOLEAN_P, int *));
-static void NDECL(render_status);
-static void FDECL(tty_putstatusfield, (const char *, int, int));
-static boolean NDECL(check_windowdata);
-static void NDECL(set_condition_length);
-static int FDECL(make_things_fit, (BOOLEAN_P));
-static void FDECL(shrink_enc, (int));
-static void FDECL(shrink_dlvl, (int));
+static boolean check_fields(boolean, int *);
+static void render_status(void);
+static void tty_putstatusfield(const char *, int, int);
+static boolean check_windowdata(void);
+static void set_condition_length(void);
+static int make_things_fit(boolean);
+static void shrink_enc(int);
+static void shrink_dlvl(int);
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
-static void NDECL(status_sanity_check);
+static void status_sanity_check(void);
#endif /* NH_DEVEL_STATUS */
#endif
#ifdef TTY_SOUND_ESCCODES
void
-print_vt_soundcode_idx(idx, v)
-int idx, v;
+print_vt_soundcode_idx(int idx, int v)
{
HUPSKIP();
if (iflags.vt_sounddata) {
/* clean up and quit */
static void
-bail(mesg)
-const char *mesg;
+bail(const char *mesg)
{
clearlocks();
tty_exit_nhwindows(mesg);
}
#if defined(SIGWINCH) && defined(CLIPPING) && !defined(NO_SIGNAL)
-static void FDECL(winch_handler, (int));
+static void winch_handler(int);
/*
* This really ought to just set a flag like the hangup handler does,
*
* 'winch_seen' has been "notyet" for a long time....
*/
+/* signal handler is called with at least 1 arg */
/*ARGUSED*/
static void
-winch_handler(sig_unused) /* signal handler is called with at least 1 arg */
-int sig_unused UNUSED;
+winch_handler(int sig_unused UNUSED)
{
int oldLI = LI, oldCO = CO, i;
register struct WinDesc *cw;
/* destroy and recreate status window; extracted from winch_handler()
and augmented for use by tty_preference_update() */
static void
-new_status_window()
+new_status_window(void)
{
if (WIN_STATUS != WIN_ERR) {
/* if it's shrinking, clear it before destroying so that
/*ARGSUSED*/
void
-tty_init_nhwindows(argcp, argv)
-int *argcp UNUSED;
-char **argv UNUSED;
+tty_init_nhwindows(int *argcp UNUSED, char **argv UNUSED)
{
int wid, hgt, i;
}
void
-tty_preference_update(pref)
-const char *pref;
+tty_preference_update(const char *pref)
{
if (!strcmp(pref, "statuslines") && iflags.window_inited) {
new_status_window();
#define ALGN flags.initalign
void
-tty_player_selection()
+tty_player_selection(void)
{
int i, k, n, choice, nextpick;
boolean getconfirmation, picksomething;
}
static boolean
-reset_role_filtering()
+reset_role_filtering(void)
{
winid win;
anything any;
/* add entries a-Archeologist, b-Barbarian, &c to menu being built in 'win' */
static void
-setup_rolemenu(win, filtering, race, gend, algn)
-winid win;
-boolean filtering; /* True => exclude filtered roles; False => filter reset */
-int race, gend, algn; /* all ROLE_NONE for !filtering case */
+setup_rolemenu(winid win,
+ boolean filtering, /* True => exclude filtered roles;
+ False => filter reset */
+ int race, int gend, int algn) /* all ROLE_NONE for !filtering case */
{
anything any;
int i;
}
static void
-setup_racemenu(win, filtering, role, gend, algn)
-winid win;
-boolean filtering;
-int role, gend, algn;
+setup_racemenu(winid win, boolean filtering, int role, int gend, int algn)
{
anything any;
boolean race_ok;
}
static void
-setup_gendmenu(win, filtering, role, race, algn)
-winid win;
-boolean filtering;
-int role, race, algn;
+setup_gendmenu(winid win, boolean filtering, int role, int race, int algn)
{
anything any;
boolean gend_ok;
}
static void
-setup_algnmenu(win, filtering, role, race, gend)
-winid win;
-boolean filtering;
-int role, race, gend;
+setup_algnmenu(winid win, boolean filtering, int role, int race, int gend)
{
anything any;
boolean algn_ok;
* Always called after init_nhwindows() and before display_gamewindows().
*/
void
-tty_askname()
+tty_askname(void)
{
static const char who_are_you[] = "Who are you? ";
register int c, ct, tryct = 0;
}
void
-tty_get_nh_event()
+tty_get_nh_event(void)
{
return;
}
#if !defined(MICRO) && !defined(WIN32CON)
static void
-getret()
+getret(void)
{
HUPSKIP();
xputs("\n");
#endif
void
-tty_suspend_nhwindows(str)
-const char *str;
+tty_suspend_nhwindows(const char *str)
{
settty(str); /* calls end_screen, perhaps raw_print */
if (!str)
}
void
-tty_resume_nhwindows()
+tty_resume_nhwindows(void)
{
gettty();
setftty(); /* calls start_screen */
}
void
-tty_exit_nhwindows(str)
-const char *str;
+tty_exit_nhwindows(const char *str)
{
winid i;
}
winid
-tty_create_nhwindow(type)
-int type;
+tty_create_nhwindow(int type)
{
struct WinDesc *newwin;
int i, rowoffset;
}
static void
-erase_menu_or_text(window, cw, clear)
-winid window;
-struct WinDesc *cw;
-boolean clear;
+erase_menu_or_text(winid window, struct WinDesc *cw, boolean clear)
{
if (cw->offx == 0) {
if (cw->offy) {
}
static void
-free_window_info(cw, free_data)
-struct WinDesc *cw;
-boolean free_data;
+free_window_info(struct WinDesc *cw, boolean free_data)
{
int i;
}
void
-tty_clear_nhwindow(window)
-winid window;
+tty_clear_nhwindow(winid window)
{
int i, j, m, n;
register struct WinDesc *cw = 0;
}
static boolean
-toggle_menu_curr(window, curr, lineno, in_view, counting, count)
-winid window;
-tty_menu_item *curr;
-int lineno;
-boolean in_view, counting;
-long count;
+toggle_menu_curr(winid window, tty_menu_item *curr, int lineno,
+ boolean in_view, boolean counting, long count)
{
if (curr->selected) {
if (counting && count > 0) {
}
static void
-dmore(cw, s)
-register struct WinDesc *cw;
-const char *s; /* valid responses */
+dmore(register struct WinDesc *cw,
+ const char *s) /* valid responses */
{
const char *prompt = cw->morestr ? cw->morestr : defmorestr;
int offset = (cw->type == NHW_TEXT) ? 1 : 2;
}
static void
-set_item_state(window, lineno, item)
-winid window;
-int lineno;
-tty_menu_item *item;
+set_item_state(winid window, int lineno, tty_menu_item *item)
{
char ch = item->selected ? (item->count == -1L ? '+' : '#') : '-';
}
static void
-set_all_on_page(window, page_start, page_end)
-winid window;
-tty_menu_item *page_start, *page_end;
+set_all_on_page(winid window, tty_menu_item *page_start,
+ tty_menu_item *page_end)
{
tty_menu_item *curr;
int n;
}
static void
-unset_all_on_page(window, page_start, page_end)
-winid window;
-tty_menu_item *page_start, *page_end;
+unset_all_on_page(winid window, tty_menu_item *page_start,
+ tty_menu_item *page_end)
{
tty_menu_item *curr;
int n;
}
static void
-invert_all_on_page(window, page_start, page_end, acc)
-winid window;
-tty_menu_item *page_start, *page_end;
-char acc; /* group accelerator, 0 => all */
+invert_all_on_page(winid window, tty_menu_item *page_start,
+ tty_menu_item *page_end,
+ char acc) /* group accelerator, 0 => all */
{
tty_menu_item *curr;
int n;
* Invert all entries that match the give group accelerator (or all if zero).
*/
static void
-invert_all(window, page_start, page_end, acc)
-winid window;
-tty_menu_item *page_start, *page_end;
-char acc; /* group accelerator, 0 => all */
+invert_all(winid window, tty_menu_item *page_start,
+ tty_menu_item *page_end,
+ char acc) /* group accelerator, 0 => all */
{
tty_menu_item *curr;
boolean on_curr_page;
/* support menucolor in addition to caller-supplied attribute */
static void
-toggle_menu_attr(on, color, attr)
-boolean on;
-int color, attr;
+toggle_menu_attr(boolean on, int color, int attr)
{
if (on) {
term_start_attr(attr);
}
static void
-process_menu_window(window, cw)
-winid window;
-struct WinDesc *cw;
+process_menu_window(winid window, struct WinDesc *cw)
{
tty_menu_item *page_start, *page_end, *curr;
long count;
}
static void
-process_text_window(window, cw)
-winid window;
-struct WinDesc *cw;
+process_text_window(winid window, struct WinDesc *cw)
{
int i, n, attr;
boolean linestart;
/*ARGSUSED*/
void
-tty_display_nhwindow(window, blocking)
-winid window;
-boolean blocking; /* with ttys, all windows are blocking */
+tty_display_nhwindow(winid window,
+ boolean blocking) /* with ttys, all windows are blocking */
{
register struct WinDesc *cw = 0;
short s_maxcol;
}
void
-tty_dismiss_nhwindow(window)
-winid window;
+tty_dismiss_nhwindow(winid window)
{
register struct WinDesc *cw = 0;
}
void
-tty_destroy_nhwindow(window)
-winid window;
+tty_destroy_nhwindow(winid window)
{
register struct WinDesc *cw = 0;
}
void
-tty_curs(window, x, y)
-winid window;
-register int x, y; /* not xchar: perhaps xchar is unsigned and
- curx-x would be unsigned as well */
+tty_curs(winid window,
+ register int x, register int y) /* not xchar: perhaps xchar is
+ unsigned and curx-x would be
+ unsigned as well */
{
struct WinDesc *cw = 0;
int cx = ttyDisplay->curx;
}
static void
-tty_putsym(window, x, y, ch)
-winid window;
-int x, y;
-char ch;
+tty_putsym(winid window, int x, int y, char ch)
{
register struct WinDesc *cw = 0;
}
static const char *
-compress_str(str)
-const char *str;
+compress_str(const char *str)
{
static char cbuf[BUFSZ];
}
void
-tty_putstr(window, attr, str)
-winid window;
-int attr;
-const char *str;
+tty_putstr(winid window, int attr, const char *str)
{
register struct WinDesc *cw = 0;
register char *ob;
}
void
-tty_display_file(fname, complain)
-const char *fname;
-boolean complain;
+tty_display_file(const char *fname, boolean complain)
{
#ifdef DEF_PAGER /* this implies that UNIX is defined */
{
}
void
-tty_start_menu(window, mbehavior)
-winid window;
-unsigned long mbehavior;
+tty_start_menu(winid window, unsigned long mbehavior)
{
wins[window]->mbehavior = mbehavior;
tty_clear_nhwindow(window);
* later.
*/
void
-tty_add_menu(window, glyphinfo, identifier, ch, gch, attr, str, itemflags)
-winid window; /* window to use, must be of type NHW_MENU */
-const glyph_info *glyphinfo UNUSED; /* glyph info w/glyph to display w/item */
-const anything *identifier; /* what to return if selected */
-char ch; /* keyboard accelerator (0 = pick our own) */
-char gch; /* group accelerator (0 = no group) */
-int attr; /* attribute for string (like tty_putstr()) */
-const char *str; /* menu string */
-unsigned int itemflags; /* itemflags such as MENU_ITEMFLAGS_SELECTED */
+tty_add_menu(winid window, /* window to use, must be of type NHW_MENU */
+ const glyph_info *glyphinfo UNUSED, /* glyph info with glyph to
+ display with item */
+ const anything *identifier, /* what to return if selected */
+ char ch, /* keyboard accelerator (0 = pick our own) */
+ char gch, /* group accelerator (0 = no group) */
+ int attr, /* attribute for string (like tty_putstr()) */
+ const char *str, /* menu string */
+ unsigned int itemflags) /* itemflags such as MENU_ITEMFLAGS_SELECTED */
{
boolean preselected = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
register struct WinDesc *cw = 0;
/* Invert the given list, can handle NULL as an input. */
static tty_menu_item *
-reverse(curr)
-tty_menu_item *curr;
+reverse(tty_menu_item *curr)
{
tty_menu_item *next, *head = 0;
* height of the window.
*/
void
-tty_end_menu(window, prompt)
-winid window; /* menu to use */
-const char *prompt; /* prompt to for menu */
+tty_end_menu(winid window, /* menu to use */
+ const char *prompt) /* prompt to for menu */
{
struct WinDesc *cw = 0;
tty_menu_item *curr;
}
int
-tty_select_menu(window, how, menu_list)
-winid window;
-int how;
-menu_item **menu_list;
+tty_select_menu(winid window, int how, menu_item **menu_list)
{
register struct WinDesc *cw = 0;
tty_menu_item *curr;
/* special hack for treating top line --More-- as a one item menu */
char
-tty_message_menu(let, how, mesg)
-char let;
-int how;
-const char *mesg;
+tty_message_menu(char let, int how, const char *mesg)
{
HUPSKIP();
/* "menu" without selection; use ordinary pline, no more() */
}
void
-tty_update_inventory()
+tty_update_inventory(void)
{
return;
}
void
-tty_mark_synch()
+tty_mark_synch(void)
{
HUPSKIP();
(void) fflush(stdout);
}
void
-tty_wait_synch()
+tty_wait_synch(void)
{
HUPSKIP();
/* we just need to make sure all windows are synch'd */
}
void
-docorner(xmin, ymax)
-register int xmin, ymax;
+docorner(register int xmin, register int ymax)
{
register int y;
register struct WinDesc *cw = wins[WIN_MAP];
}
void
-end_glyphout()
+end_glyphout(void)
{
HUPSKIP();
#if defined(ASCIIGRAPH) && !defined(NO_TERMS)
#ifndef WIN32
void
-g_putch(in_ch)
-int in_ch;
+g_putch(int in_ch)
{
register char ch = (char) in_ch;
#ifdef CLIPPING
void
-setclipped()
+setclipped(void)
{
clipping = TRUE;
clipx = clipy = 0;
}
void
-tty_cliparound(x, y)
-int x, y;
+tty_cliparound(int x, int y)
{
int oldx = clipx, oldy = clipy;
*/
void
-tty_print_glyph(window, x, y, glyphinfo, bkglyphinfo)
-winid window;
-xchar x, y;
+tty_print_glyph(winid window, xchar x, xchar y,
#if defined(TTY_TILES_ESCCODES) || defined(MSDOS)
-const glyph_info *glyphinfo;
+ const glyph_info *glyphinfo,
#else
-const glyph_info *glyphinfo UNUSED;
+ const glyph_info *glyphinfo UNUSED,
#endif
-const glyph_info *bkglyphinfo UNUSED;
+ const glyph_info *bkglyphinfo UNUSED)
{
boolean inverse_on = FALSE;
int ch, color;
}
void
-tty_raw_print(str)
-const char *str;
+tty_raw_print(const char *str)
{
HUPSKIP();
if (ttyDisplay)
}
void
-tty_raw_print_bold(str)
-const char *str;
+tty_raw_print_bold(const char *str)
{
HUPSKIP();
if (ttyDisplay)
}
int
-tty_nhgetch()
+tty_nhgetch(void)
{
int i;
#ifdef UNIX
*/
/*ARGSUSED*/
int
-tty_nh_poskey(x, y, mod)
#if defined(WIN32CON)
-int *x, *y, *mod;
+tty_nh_poskey(int *x, int *y, int *mod)
#else
-int *x UNUSED, *y UNUSED, *mod UNUSED;
+tty_nh_poskey(int *x UNUSED, int *y UNUSED, int *mod UNUSED)
#endif
{
int i;
}
void
-win_tty_init(dir)
-int dir;
+win_tty_init(int dir)
{
if (dir != WININIT)
return;
#ifdef POSITIONBAR
void
-tty_update_positionbar(posbar)
-char *posbar;
+tty_update_positionbar(char *posbar)
{
#ifdef MSDOS
video_update_positionbar(posbar);
#ifdef STATUS_HILITES
#ifdef TEXTCOLOR
-static int FDECL(condcolor, (long, unsigned long *));
+static int condcolor(long, unsigned long *);
#endif
-static int FDECL(condattr, (long, unsigned long *));
+static int condattr(long, unsigned long *);
static unsigned long *tty_colormasks;
static long tty_condition_bits;
static struct tty_status_fields tty_status[2][MAXBLSTATS]; /* 2: NOW,BEFORE */
* -- call genl_status_init() to initialize the general data.
*/
void
-tty_status_init()
+tty_status_init(void)
{
#ifdef STATUS_HILITES
int i, num_rows;
}
void
-tty_status_enablefield(fieldidx, nm, fmt, enable)
-int fieldidx;
-const char *nm;
-const char *fmt;
-boolean enable;
+tty_status_enablefield(int fieldidx, const char *nm, const char *fmt,
+ boolean enable)
{
genl_status_enablefield(fieldidx, nm, fmt, enable);
}
*/
void
-tty_status_update(fldidx, ptr, chg, percent, color, colormasks)
-int fldidx, chg UNUSED, percent, color;
-genericptr_t ptr;
-unsigned long *colormasks;
+tty_status_update(int fldidx, genericptr_t ptr, int chg UNUSED, int percent,
+ int color, unsigned long *colormasks)
{
int attrmask;
long *condptr = (long *) ptr;
}
static int
-make_things_fit(force_update)
-boolean force_update;
+make_things_fit(boolean force_update)
{
int trycnt, fitting = 0, requirement;
int rowsz[3], num_rows, condrow, otheroptions = 0;
* This is now done at an individual field case-by-case level.
*/
static boolean
-check_fields(forcefields, sz)
-boolean forcefields;
-int sz[3];
+check_fields(boolean forcefields, int sz[3])
{
int c, i, row, col, num_rows, idx;
boolean valid = TRUE, matchprev, update_right;
#if (NH_DEVEL_STATUS != NH_STATUS_RELEASED)
static void
-status_sanity_check(VOID_ARGS)
+status_sanity_check(void)
{
int i;
static boolean in_sanity_check = FALSE;
* This is what places a field on the tty display.
*/
static void
-tty_putstatusfield(text, x, y)
-const char *text;
-int x, y;
+tty_putstatusfield(const char *text, int x, int y)
{
int i, n, ncols, nrows, lth = 0;
struct WinDesc *cw = 0;
/* caller must set cond_shrinklvl (0..2) before calling us */
static void
-set_condition_length()
+set_condition_length(void)
{
long mask;
int c, lth = 0;
}
static void
-shrink_enc(lvl)
-int lvl;
+shrink_enc(int lvl)
{
/* shrink or restore the encumbrance word */
if (lvl <= 2) {
}
static void
-shrink_dlvl(lvl)
-int lvl;
+shrink_dlvl(int lvl)
{
/* try changing Dlvl: to Dl: */
char buf[BUFSZ];
* blank and null-terminated.
*/
static boolean
-check_windowdata(VOID_ARGS)
+check_windowdata(void)
{
if (WIN_STATUS == WIN_ERR || wins[WIN_STATUS] == (struct WinDesc *) 0) {
paniclog("check_windowdata", " null status window.");
* be displayed in based on user settings.
*/
static int
-condcolor(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condcolor(long bm, unsigned long *bmarray)
{
int i;
#endif /* TEXTCOLOR */
static int
-condattr(bm, bmarray)
-long bm;
-unsigned long *bmarray;
+condattr(long bm, unsigned long *bmarray)
{
int attr = 0;
int i;
} while (0)
static void
-render_status(VOID_ARGS)
+render_status(void)
{
long mask, bits;
int i, x, y, idx, c, ci, row, tlth, num_rows, coloridx = 0, attrmask = 0;
#if defined(USER_SOUNDS) && defined(TTY_SOUND_ESCCODES)
void
-play_usersound_via_idx(idx, volume)
-int idx, volume;
+play_usersound_via_idx(int idx, int volume)
{
print_vt_soundcode_idx(idx, volume);
}
/*#define COMCTL_URL
* "http://www.microsoft.com/msdownload/ieplatform/ie/comctrlx86.asp"*/
-extern void FDECL(nethack_exit, (int)) NORETURN;
+extern void nethack_exit(int) NORETURN;
static TCHAR *_get_cmd_arg(TCHAR *pCmdLine);
static HRESULT GetComCtlVersion(LPDWORD pdwMajor, LPDWORD pdwMinor);
BOOL WINAPI
#endif
// Foward declarations of functions included in this code module:
-extern boolean FDECL(main, (int, char **));
+extern boolean main(int, char **);
static void __cdecl mswin_moveloop(void *);
#define MAX_CMDLINE_PARAM 255
}
PNHWinApp
-GetNHApp()
+GetNHApp(void)
{
return &_nethack_app;
}
static BOOL plselDrawItem(HWND hWnd, WPARAM wParam, LPARAM lParam);
boolean
-mswin_player_selection_window()
+mswin_player_selection_window(void)
{
INT_PTR ret;
plsel_data_t data;
}
UINT
-mswin_charset()
+mswin_charset(void)
{
CHARSETINFO cis;
if (SYMHANDLING(H_IBM))
/* check for input */
int
-mswin_have_input()
+mswin_have_input(void)
{
return
#ifdef SAFERHANGUP
/* get event from the queue and delete it */
PMSNHEvent
-mswin_input_pop()
+mswin_input_pop(void)
{
PMSNHEvent retval;
/* get event from the queue but leave it there */
PMSNHEvent
-mswin_input_peek()
+mswin_input_peek(void)
{
PMSNHEvent retval;
// returns strdup() created pointer - callee assumes the ownership
HWND
-mswin_init_main_window()
+mswin_init_main_window(void)
{
static int run_once = 0;
HWND ret;
}
void
-register_main_window_class()
+register_main_window_class(void)
{
WNDCLASS wcex;
}
void
-mswin_menu_check_intf_mode()
+mswin_menu_check_intf_mode(void)
{
HMENU hMenu = GetMenu(GetNHApp()->hMainWnd);
}
void
-mswin_apply_window_style_all() {
+mswin_apply_window_style_all(void)
+{
int i;
for (i = 0; i < MAXWINDOWS; i++) {
if (IsWindow(GetNHApp()->windowlist[i].win)
// returns strdup() created pointer - callee assumes the ownership
#define TEXT_BUFFER_SIZE 4096
char *
-nh_compose_ascii_screenshot()
+nh_compose_ascii_screenshot(void)
{
char *retval;
PMSNHMsgGetText text;
extern boolean win32_cursorblink; /* from sys\winnt\winnt.c */
HWND
-mswin_init_map_window()
+mswin_init_map_window(void)
{
static int run_once = 0;
HWND hWnd;
/* register window class for map window */
void
-register_map_window_class()
+register_map_window_class(void)
{
WNDCLASS wcex;
ZeroMemory(&wcex, sizeof(wcex));
typedef struct mswin_menu_item {
glyph_info glyphinfo;
ANY_P identifier;
- CHAR_P accelerator;
- CHAR_P group_accel;
+ char accelerator;
+ char group_accel;
int attr;
char str[NHMENU_STR_SIZE];
- BOOLEAN_P presel;
+ boolean presel;
unsigned int itemflags;
int count;
BOOL has_focus;
} MSNHMsgPutstr, *PMSNHMsgPutstr;
typedef struct mswin_nhmsg_print_glyph {
- XCHAR_P x;
- XCHAR_P y;
+ xchar x;
+ xchar y;
glyph_info glyphinfo;
glyph_info bkglyphinfo;
} MSNHMsgPrintGlyph, *PMSNHMsgPrintGlyph;
typedef struct mswin_nhmsg_add_menu {
glyph_info glyphinfo;
const ANY_P *identifier;
- CHAR_P accelerator;
- CHAR_P group_accel;
+ char accelerator;
+ char group_accel;
int attr;
const char *str;
- BOOLEAN_P presel;
+ boolean presel;
unsigned int itemflags;
} MSNHMsgAddMenu, *PMSNHMsgAddMenu;
#endif
HWND
-mswin_init_message_window()
+mswin_init_message_window(void)
{
static int run_once = 0;
HWND ret;
}
void
-register_message_window_class()
+register_message_window_class(void)
{
WNDCLASS wcex;
ZeroMemory(&wcex, sizeof(wcex));
static void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam);
HWND
-mswin_init_RIP_window()
+mswin_init_RIP_window(void)
{
HWND ret;
PNHRIPWindow data;
#define DEFAULT_COLOR_FG_STATUS COLOR_WINDOWTEXT
HWND
-mswin_init_status_window()
+mswin_init_status_window(void)
{
static int run_once = 0;
HWND ret;
}
void
-register_status_window_class()
+register_status_window_class(void)
{
WNDCLASS wcex;
ZeroMemory(&wcex, sizeof(wcex));
static void LayoutText(HWND hwnd);
HWND
-mswin_init_text_window()
+mswin_init_text_window(void)
{
HWND ret;
RECT rt;
/* Restore the windows after being suspended. */
void
-mswin_resume_nhwindows()
+mswin_resume_nhwindows(void)
{
logDebug("mswin_resume_nhwindows()\n");
--more--, if necessary, in the tty window-port.
*/
void
-mswin_display_nhwindow(winid wid, BOOLEAN_P block)
+mswin_display_nhwindow(winid wid, boolean block)
{
logDebug("mswin_display_nhwindow(%d, %d)\n", wid, block);
if (GetNHApp()->windowlist[wid].win != NULL) {
iff complain is TRUE.
*/
void
-mswin_display_file(const char *filename, BOOLEAN_P must_exist)
+mswin_display_file(const char *filename, boolean must_exist)
{
dlb *f;
TCHAR wbuf[BUFSZ];
void
mswin_add_menu(winid wid, const glyph_info *glyphinfo,
const ANY_P *identifier,
- CHAR_P accelerator, CHAR_P group_accel, int attr,
+ char accelerator, char group_accel, int attr,
const char *str, unsigned int itemflags)
{
boolean presel = ((itemflags & MENU_ITEMFLAGS_SELECTED) != 0);
window up, otherwise empty.
*/
void
-mswin_update_inventory()
+mswin_update_inventory(void)
{
logDebug("mswin_update_inventory()\n");
if (iflags.perm_invent && g.program_state.something_worth_saving
for the moment
*/
void
-mswin_mark_synch()
+mswin_mark_synch(void)
{
logDebug("mswin_mark_synch()\n");
}
display is OK when return from wait_synch().
*/
void
-mswin_wait_synch()
+mswin_wait_synch(void)
{
logDebug("mswin_wait_synch()\n");
mswin_raw_print_flush();
*/
void
-mswin_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
+mswin_print_glyph(winid wid, xchar x, xchar y,
const glyph_info *glyphinfo, const glyph_info *bkglyphinfo)
{
logDebug("mswin_print_glyph(%d, %d, %d, %d, %d, %lu)\n", wid, x, y, glyphinfo->glyph, bkglyphinfo->glyph);
* dialog box and clear raw_print_strbuf.
*/
void
-mswin_raw_print_flush()
+mswin_raw_print_flush(void)
{
if (raw_print_strbuf.str != NULL) {
int wlen = strlen(raw_print_strbuf.str) + 1;
Returned character _must_ be non-zero.
*/
int
-mswin_nhgetch()
+mswin_nhgetch(void)
{
PMSNHEvent event;
int key = 0;
anyway.]
*/
void
-mswin_nhbell()
+mswin_nhbell(void)
{
logDebug("mswin_nhbell()\n");
}
-- On the tty-port this scrolls WIN_MESSAGE back one line.
*/
int
-mswin_doprev_message()
+mswin_doprev_message(void)
{
logDebug("mswin_doprev_message()\n");
SendMessage(mswin_hwnd_from_winid(WIN_MESSAGE), WM_VSCROLL,
ports might use a popup.
*/
char
-mswin_yn_function(const char *question, const char *choices, CHAR_P def)
+mswin_yn_function(const char *question, const char *choices, char def)
{
char ch;
char yn_esc_map = '\033';
char message[BUFSZ];
char res_ch[2];
int createcaret;
- boolean digit_ok, allow_num;
+ boolean digit_ok, allow_num = FALSE;
logDebug("mswin_yn_function(%s, %s, %d)\n", question, choices, def);
selection, -1 otherwise.
*/
int
-mswin_get_ext_cmd()
+mswin_get_ext_cmd(void)
{
int ret;
logDebug("mswin_get_ext_cmd()\n");
by a nap(50ms), but allows asynchronous operation.
*/
void
-mswin_delay_output()
+mswin_delay_output(void)
{
logDebug("mswin_delay_output()\n");
mswin_map_update(mswin_hwnd_from_winid(WIN_MAP));
}
void
-mswin_change_color()
+mswin_change_color(void)
{
logDebug("mswin_change_color()\n");
}
char *
-mswin_get_color_string()
+mswin_get_color_string(void)
{
logDebug("mswin_get_color_string()\n");
return ("");
just declare an empty function.
*/
void
-mswin_start_screen()
+mswin_start_screen(void)
{
/* Do Nothing */
logDebug("mswin_start_screen()\n");
completeness. The complement of start_screen().
*/
void
-mswin_end_screen()
+mswin_end_screen(void)
{
/* Do Nothing */
logDebug("mswin_end_screen()\n");
#define TEXT_BUFFER_SIZE 4096
char *
-mswin_getmsghistory(BOOLEAN_P init)
+mswin_getmsghistory(boolean init)
{
static PMSNHMsgGetText text = 0;
static char *next_message = 0;
}
void
-mswin_putmsghistory(const char *msg, BOOLEAN_P restoring)
+mswin_putmsghistory(const char *msg, boolean restoring)
{
BOOL save_sound_opt;
}
void
-mswin_main_loop()
+mswin_main_loop(void)
{
while (!mswin_have_input()) {
MSG msg;
#define INTFKEY "Interface"
void
-mswin_read_reg()
+mswin_read_reg(void)
{
HKEY key;
DWORD size;
}
void
-mswin_write_reg()
+mswin_write_reg(void)
{
HKEY key;
DWORD disposition;
}
void
-mswin_destroy_reg()
+mswin_destroy_reg(void)
{
char keystring[MAX_PATH];
HKEY key;
</PropertyGroup>
<ItemDefinitionGroup>
<ClCompile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
+ <DisableSpecificWarnings>4820;4706;4244;4245;4100;4310</DisableSpecificWarnings>
<PreprocessorDefinitions>WIN32;CRT_SECURE_NO_DEPRECATE;_SCL_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WINVER=0x0601;_WIN32_WINNT=0x0601;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
void mswin_resume_nhwindows(void);
winid mswin_create_nhwindow(int type);
void mswin_clear_nhwindow(winid wid);
-void mswin_display_nhwindow(winid wid, BOOLEAN_P block);
+void mswin_display_nhwindow(winid wid, boolean block);
void mswin_destroy_nhwindow(winid wid);
void mswin_curs(winid wid, int x, int y);
void mswin_putstr(winid wid, int attr, const char *text);
void mswin_putstr_ex(winid wid, int attr, const char *text, int);
-void mswin_display_file(const char *filename, BOOLEAN_P must_exist);
+void mswin_display_file(const char *filename, boolean must_exist);
void mswin_start_menu(winid wid, unsigned long mbehavior);
void mswin_add_menu(winid wid, const glyph_info *glyphinfo,
const ANY_P *identifier,
- CHAR_P accelerator, CHAR_P group_accel, int attr,
+ char accelerator, char group_accel, int attr,
const char *str, unsigned int itemflags);
void mswin_end_menu(winid wid, const char *prompt);
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
void mswin_mark_synch(void);
void mswin_wait_synch(void);
void mswin_cliparound(int x, int y);
-void mswin_print_glyph(winid wid, XCHAR_P x, XCHAR_P y,
+void mswin_print_glyph(winid wid, xchar x, xchar y,
const glyph_info *glyph, const glyph_info *bkglyph);
void mswin_raw_print(const char *str);
void mswin_raw_print_bold(const char *str);
int mswin_nh_poskey(int *x, int *y, int *mod);
void mswin_nhbell(void);
int mswin_doprev_message(void);
-char mswin_yn_function(const char *question, const char *choices, CHAR_P def);
+char mswin_yn_function(const char *question, const char *choices, char def);
void mswin_getlin(const char *question, char *input);
int mswin_get_ext_cmd(void);
void mswin_number_pad(int state);
void mswin_end_screen(void);
void mswin_outrip(winid wid, int how, time_t when);
void mswin_preference_update(const char *pref);
-char *mswin_getmsghistory(BOOLEAN_P init);
-void mswin_putmsghistory(const char *msg, BOOLEAN_P);
+char *mswin_getmsghistory(boolean init);
+void mswin_putmsghistory(const char *msg, boolean);
void mswin_status_init(void);
void mswin_status_finish(void);