Angband
Functions | Variables
get.c File Reference
#include "get.h"
#include "init.h"

Functions

void set_getfunctions (struct getset *funcs)
static bool get_file_backup (const char *suggested_name, char *path, size_t len)
bool get_file (const char *suggested_name, char *path, size_t len)
bool get_string (const char *prompt, char *buf, size_t len)
 Prompt for a string from the user.
s16b get_quantity (const char *prompt, int max)
 Request a quantity from the user.
bool get_check (const char *prompt)
 Verify something with the user.
bool get_item (struct object **choice, const char *pmt, const char *fail, cmd_code cmd, item_filter filter, int mode)
bool get_direction (int *dir, bool allow_5)
bool get_target (int *dp)
int get_spell (const char *verb, bool(*spell_test)(int spell))

Variables

static struct getset = { 0 }

Function Documentation

bool get_check ( const char *  prompt)

Verify something with the user.

Parameters
promptis the prompt to the user, and should take the form "Query? "
Returns
whether the user answered "y"

get_check_hook() should be set to a function which asks the user for a "y/n" answer

References getset::check, FALSE, and get_check_hook.

bool get_direction ( int dir,
bool  allow_5 
)

References getset::direction.

bool get_file ( const char *  suggested_name,
char *  path,
size_t  len 
)

References getset::file, and get_file_backup().

static bool get_file_backup ( const char *  suggested_name,
char *  path,
size_t  len 
)
static
bool get_item ( struct object **  choice,
const char *  pmt,
const char *  fail,
cmd_code  cmd,
item_filter  filter,
int  mode 
)

References getset::item.

s16b get_quantity ( const char *  prompt,
int  max 
)

Request a quantity from the user.

Parameters
promptis the prompt to the user, and should take the form "Prompt: "
maxis the maximum value to accept
Returns
the quantity

References get_quantity_hook, and getset::quantity.

int get_spell ( const char *  verb,
bool(*)(int spell)  spell_test 
)

References getset::spell.

bool get_string ( const char *  prompt,
char *  buf,
size_t  len 
)

Prompt for a string from the user.

Parameters
promptis the prompt to the user, and should take the form "Prompt: "
bufis the user string, and the value passed in is the default
lenis the length of buf
Returns
whether the user accepted the entered value or escaped

References FALSE, getset::file, get_string_hook, and getset::string.

bool get_target ( int dp)

References getset::target.

void set_getfunctions ( struct getset funcs)

Variable Documentation

struct getset = { 0 }
static