#include "hack.h"
Defines | |
| #define | Static static |
| #define | TABSIZ 0x20 |
Functions | |
| boolean | digit (char c) |
| boolean | letter (char c) |
| char | highc (char c) |
| char | lowc (char c) |
| char * | lcase (char *s) |
| char * | upstart (char *s) |
| char * | mungspaces (char *bp) |
| char * | eos (char *s) |
| char * | strkitten (char *s, char c) |
| char * | s_suffix (char *s) const |
| char * | xcrypt (char *str, char *buf) const |
| boolean | onlyspace (char *s) const |
| char * | tabexpand (char *sbuf) |
| char * | visctrl (char c) |
| const char * | ordin (int n) |
| char * | sitoa (int n) |
| int | sgn (int n) |
| int | rounddiv (long x, int y) |
| int | distmin (int x0, int y0, int x1, int y1) |
| int | dist2 (int x0, int y0, int x1, int y1) |
| boolean | online2 (int x0, int y0, int x1, int y1) |
| boolean | pmatch (char *patrn, char *strng) const |
| int | strncmpi (const char *s1, const char *s2, int n) |
| char * | strstri (char *str, const char *sub) const |
| boolean | fuzzymatch (char *s1, char *s2, const char *ignore_chars, boolean caseblind) const |
| static struct tm * | NDECL (getlt) |
| void | setrandom () |
| static struct tm * | getlt () |
| int | getyear () |
| int | getmonth () |
| int | getmday () |
| long | yyyymmdd (time_t date) |
| int | phase_of_the_moon () |
| boolean | friday_13th () |
| int | night () |
| int | midnight () |
| boolean | towelday () |
| boolean | piday () |
| char * | get_formatted_time (time_t time, const char *fmt) |
| char * | iso8601 (time_t date) |
| char * | iso8601_duration (long seconds) |
| time_t | current_epoch () |
Variables | |
| static char | buf_fmt_time [BUFSZ] |
| static char | buf_fmt_duration [BUFSZ] |
| #define Static static |
Referenced by s_suffix(), sitoa(), and visctrl().
| #define TABSIZ 0x20 |
Referenced by strstri().
| time_t current_epoch | ( | ) |
| boolean digit | ( | char | c ) |
Referenced by checkfile(), getobj(), level_tele(), parseoptions(), readobjnam(), and score_wanted().

| int dist2 | ( | int | x0, |
| int | y0, | ||
| int | x1, | ||
| int | y1 | ||
| ) |
Referenced by can_reach_location(), check_leash(), distfleeck(), dochug(), drag_ball(), fill_zoo(), find_defensive(), find_misc(), find_offensive(), findtravelpath(), flash_hits_mon(), lookaround(), m_move(), monnear(), noisy_hit(), select_rwep(), shkcatch(), thrwmu(), use_offensive(), and wake_nearto().

| int distmin | ( | int | x0, |
| int | y0, | ||
| int | x1, | ||
| int | y1 | ||
| ) |
Referenced by do_flood(), drag_ball(), fill_zoo(), findtravelpath(), gettrack(), gush(), launch_obj(), linedup(), m_move(), m_throw(), makemaz(), mattackm(), spitmu(), stock_room(), teleds(), thitmonst(), throwspell(), thrwmu(), and use_offensive().

| char* eos | ( | char * | s ) |
Referenced by bot1(), bot2(), build_plselection_prompt(), choose_classes_menu(), dodiscovered(), doname_base(), done(), done_in_by(), dosacrifice(), dotypeinv(), enhance_skill(), enlightenment(), fruitadd(), getversionstring(), if(), lev_by_name(), lift_object(), lookat(), makeplural(), makesingular(), mstatusline(), next_opt(), obj_typename(), otransit_msg(), outentry(), outheader(), parse_config_line(), parseoptions(), print_mapseen(), readobjnam(), revive_corpse(), s_suffix(), set_bonesfile_name(), set_bonestemp_name(), set_levelfile_name(), strkitten(), use_candle(), use_container(), ustatusline(), welcome(), wishymatch(), x_monnam(), and xname().

| boolean friday_13th | ( | ) |
References getlt(), tm::tm_mday, and tm::tm_wday.
Referenced by moveloop().


Referenced by readobjnam(), and wishymatch().


| char* get_formatted_time | ( | time_t | time, |
| const char * | fmt | ||
| ) |
Returns a date formatted by strftime. Returns current time if time is 0.
References buf_fmt_time, BUFSZ, getlt(), and localtime().
Referenced by done(), and iso8601().


| static struct tm* getlt | ( | ) | [static, read] |
References current_epoch(), and localtime().
Referenced by friday_13th(), get_formatted_time(), getmday(), getmonth(), getyear(), midnight(), night(), phase_of_the_moon(), and yyyymmdd().


| int getmday | ( | ) |
Returns current day of month (1-31)
References getlt(), and tm::tm_mday.
Referenced by piday(), and towelday().


| int getmonth | ( | ) |
Returns current month (1-12, 1 = January)
References getlt(), and tm::tm_mon.
Referenced by piday(), and towelday().


| int getyear | ( | ) |
| char highc | ( | char | c ) |
Referenced by Adjmonnam(), Amonnam(), An(), attack(), convert_line(), do_oname(), do_play_instrument(), Doname2(), enlightenment(), help_dir(), hmon_hitmon(), locomotion(), Monnam(), newcham(), noit_Monnam(), print_mapseen(), shk_names_obj(), Shk_Your(), slip_or_trip(), stagger(), The(), upstart(), Yname2(), and Ysimple_name2().

| char* iso8601 | ( | time_t | date ) |
Returns a iso-8601 formatted date (e.g. 2010-03-19T08:46:23+0100).
References get_formatted_time().
Referenced by dump_header_html().


| char* iso8601_duration | ( | long | seconds ) |
Returns a iso-8601 formatted duration (e.g. PThh:mm:ss).
References buf_fmt_duration.
Referenced by done().

| char* lcase | ( | char * | s ) |
Referenced by checkfile(), paranoid_yn(), and x_monnam().

| boolean letter | ( | char | c ) |
Referenced by doorganize(), help_dir(), invault(), makeplural(), and parseoptions().

| char lowc | ( | char | c ) |
Referenced by do_genocide(), do_oname(), fuzzymatch(), getpos(), parseoptions(), rhack(), strncmpi(), strstri(), and the().

| int midnight | ( | ) |
References getlt(), and tm::tm_hour.
Referenced by check_special_room(), domonnoise(), and hitmu().


| char* mungspaces | ( | char * | bp ) |
Referenced by do_class_genocide(), do_genocide(), do_mname(), do_oname(), do_play_instrument(), docall(), dowrite(), invault(), parseoptions(), readobjnam(), and wc_set_window_colors().

| static struct tm* NDECL | ( | getlt | ) | [static, read] |
| int night | ( | ) |
References getlt(), and tm::tm_hour.
Referenced by damageum(), domonnoise(), hitmu(), mattacku(), mdamagem(), moveloop(), tamedog(), and were_change().


| boolean online2 | ( | int | x0, |
| int | y0, | ||
| int | x1, | ||
| int | y1 | ||
| ) |
| boolean onlyspace | ( | char * | s ) | const |
| const char* ordin | ( | int | n ) |
Referenced by enlightenment(), mshot_xname(), and topten().

| int phase_of_the_moon | ( | ) |
References getlt(), tm::tm_yday, and tm::tm_year.
Referenced by moveloop().


| boolean piday | ( | ) |
References getmday(), and getmonth().
Referenced by m_throw(), and xname().


| boolean pmatch | ( | char * | patrn, |
| char * | strng | ||
| ) | const |
| int rounddiv | ( | long | x, |
| int | y | ||
| ) |
| char* s_suffix | ( | char * | s ) | const |
References BUFSZ, eos(), Static, Strcat, strcmpi, and Strcpy.
Referenced by artifact_hit(), at_your_feet(), build_plselection_prompt(), buzz(), cancel_monst(), check_leash(), convert_line(), corpse_chance(), cthulhu_dies(), damageum(), destroy_mitem(), display_minventory(), dogaze(), domindblast(), doname_base(), dopay(), dopickup(), dotrap(), drop(), drop_boulder_on_monster(), eatcorpse(), fig_transform(), fix_worst_trouble(), food_xname(), gazemu(), ghod_hitsu(), gulpum(), hatch_egg(), hitmm(), hitmsg(), hitmu(), hmon_hitmon(), keepdogs(), lantern_message(), lifesaved_monster(), litroom(), look_here(), m_slips_free(), m_throw(), make_corpse(), mattacku(), mdamagem(), mintrap(), mon_break_armor(), mon_owns(), mon_reflects(), mon_wield_item(), mrustm(), ohitmon(), passive(), passivemm(), peek_at_iced_corpse_age(), potionhit(), revive_corpse(), rndcurse(), setmnotwielded(), shk_owns(), shopper_financial_report(), slept_monst(), spitmu(), split_mon(), thitmonst(), touch_artifact(), u_entered_shop(), unturn_dead(), urustm(), use_lamp(), use_mirror(), use_misc(), use_whip(), x_monnam(), you_aggravate(), and zap_dig().


| void setrandom | ( | ) |
References DEV_RANDOM, srand48(), and time().
Referenced by initoptions().


| int sgn | ( | int | n ) |
Referenced by bhitm(), breamu(), buzzmu(), click_to_cmd(), deadbook(), demon_talk(), dig_up_grave(), dlord(), do_genocide(), dog_move(), dosacrifice(), dprince(), exerchk(), findtravelpath(), gem_accept(), getpos(), ghod_hitsu(), hmon_hitmon(), hurtle(), launch_obj(), make_happy_shk(), makemon(), mbhit(), mhurtle(), msummon(), mv_bubble(), nasty(), ndemon(), pay_for_damage(), peace_minded(), rob_shop(), set_malign(), set_repo_loc(), shopdig(), spec_applies(), spitmu(), stone_luck(), thrwmu(), touch_artifact(), use_grapple(), use_offensive(), and xkilled().

| char* sitoa | ( | int | n ) |
References Sprintf, and Static.
Referenced by doname_base().

| char* strkitten | ( | char * | s, |
| char | c | ||
| ) |
| int strncmpi | ( | const char * | s1, |
| const char * | s2, | ||
| int | n | ||
| ) |
References lowc().
Referenced by an(), artifact_name(), convert_line(), describe_level(), doname_base(), dorecover(), dosave0(), dowrite(), explode(), find_branch(), initoptions(), invault(), lev_by_name(), match_optname(), name_to_mon(), parseoptions(), poisoned(), readobjnam(), restrict_name(), restshk(), seffects(), set_option_mod_status(), str2align(), str2gend(), str2race(), str2role(), the(), thitu(), title_to_mon(), u_entered_shop(), vtense(), wishymatch(), and xname().


| char* strstri | ( | char * | str, |
| const char * | sub | ||
| ) | const |
References lowc(), and TABSIZ.
Referenced by append_str(), checkfile(), do_class_genocide(), dosounds(), dowrite(), fruitname(), getrumor(), hmon_hitmon(), lev_by_name(), makesingular(), name_to_mon(), parse_monster_color(), poisoned(), polyman(), readobjnam(), simple_typename(), the(), wc_set_window_colors(), wield_tool(), wishymatch(), and x_monnam().


| char* tabexpand | ( | char * | sbuf ) |
| boolean towelday | ( | ) |
References getmday(), and getmonth().
Referenced by u_init().


| char* upstart | ( | char * | s ) |
References highc().
Referenced by animate_statue(), can_twoweapon(), domove(), dotrap(), fix_worst_trouble(), mattacku(), Mb_hit(), moverock(), rndcurse(), and slip_or_trip().


| char* visctrl | ( | char | c ) |
| char* xcrypt | ( | char * | str, |
| char * | buf | ||
| ) | const |
Referenced by deliver_by_pline(), deliver_by_window(), getrumor(), outoracle(), and qt_com_firstline().

| long yyyymmdd | ( | time_t | date ) |
References getlt(), localtime(), tm::tm_mday, tm::tm_mon, and tm::tm_year.
Referenced by paniclog(), and topten().


char buf_fmt_duration[BUFSZ] [static] |
Referenced by iso8601_duration().
char buf_fmt_time[BUFSZ] [static] |
Referenced by get_formatted_time().
1.7.2