Definition in file arr_utils.h.
#include "globals.h"
Go to the source code of this file.
Functions | |
DLLIMPORT void | strip_crlf (char *string_in) |
Strips control characters from end of a string. | |
DLLIMPORT char * | prepare_short_fname (const char *fname, unsigned int maxlen) |
Prepares short version of the given filename. | |
DLLIMPORT char * | filename_from_path (char *pathname) |
Returns file name only from given filename with path. | |
char * | strdup_noquot (char *src) |
Duplicates a string without quotes. | |
char * | strdup_trim (char *src) |
Duplicates a string with trimming. | |
DLLIMPORT short | format_map_fname (char *fname, const char *usrinput, const char *levels_path) |
Creates map filename from given string. | |
DLLIMPORT short | format_data_fname (char **fullname, const char *data_path, const char *format,...) |
Formats data file name. | |
int | arr_ushort_pos (const unsigned short *arr, unsigned short arr_item, int array_count) |
Searches for position of an item in array of unsigned short. |
int arr_ushort_pos | ( | const unsigned short * | arr, | |
unsigned short | arr_item, | |||
int | array_count | |||
) |
Searches for position of an item in array of unsigned short.
arr | Pointer to the source array. | |
arr_item | The searched item. | |
array_count | Size of the array (number of elements in it). |
Definition at line 280 of file arr_utils.c.
Referenced by cube_wib_animate(), get_orientation_next(), is_animated_cube(), slab_is_door(), slab_is_liquid(), slab_is_room(), slab_is_short_unclmabl(), slab_is_space(), slab_is_tall_unclmabl(), slab_is_wall(), and slab_is_wealth().
DLLIMPORT char* filename_from_path | ( | char * | pathname | ) |
Returns file name only from given filename with path.
pathname | The source filename, possibly with path. |
Definition at line 146 of file arr_utils.c.
DLLIMPORT short format_data_fname | ( | char ** | fullname, | |
const char * | data_path, | |||
const char * | format, | |||
... | ||||
) |
Formats data file name.
Allocates memory and prints formatted file name into it. fullname Pointer to the returned file name. data_path Path to the data directory, inserted before filename. format The string format used to create file name.
Definition at line 251 of file arr_utils.c.
Referenced by change_draw_data_texture(), and load_draw_data().
DLLIMPORT short format_map_fname | ( | char * | fname, | |
const char * | usrinput, | |||
const char * | levels_path | |||
) |
Creates map filename from given string.
fname | The output filename. | |
usrinput | The input string used to create filename. | |
levels_path | Directory path to the folder containing levels. |
Definition at line 168 of file arr_utils.c.
Referenced by format_lvl_fname(), and format_lvl_savfname().
DLLIMPORT char* prepare_short_fname | ( | const char * | fname, | |
unsigned int | maxlen | |||
) |
Prepares short version of the given filename.
Resulting string is never longer than maxlen. Allocates memory for the returned string - you should free() it after use.
fname | The input (possibly long) file name. | |
maxlen | Maximal size of the returned output string. |
Definition at line 214 of file arr_utils.c.
Referenced by add_stats_to_script(), load_mapfile(), load_mapfile_msg(), and save_mapfile().
char* strdup_noquot | ( | char * | src | ) |
Duplicates a string without quotes.
Allocates memory and copies null-terminated string, skipping any quotes at start/end of the source. Any white/control character outside of quotes are skipped. All white/control characters inside quotes are preserved.
src | The string which is duplicated. |
Definition at line 93 of file arr_utils.c.
Referenced by execute_adikted_command().
char* strdup_trim | ( | char * | src | ) |
Duplicates a string with trimming.
Allocates memory and copies null-terminated string, skipping any white/control characters at start/end of the source.
src | The string which is duplicated. |
Definition at line 124 of file arr_utils.c.
Referenced by load_lif().
DLLIMPORT void strip_crlf | ( | char * | string_in | ) |
Strips control characters from end of a string.
string_in | the string which is stripped. |
Definition at line 28 of file arr_utils.c.