#define max(x, y) ((x)>(y)?(x):(y))
#define min(x, y) ((x)<(y)?(x):(y))

char *abbreviate_filesize(off64_t fsize);
void add_to_iat(int_array_t *piat, int element);
char * amount_to_str(long long int amount);
void check_died_children(void);
void compile_re(regex_t *whereto, char *what);
char * convert_regexp_error(int error, const regex_t *preg);
void delete_array(char **list, int n);
void double_ts_to_str(double ts, char *format_str, char *dest, int dest_size);
void duplicate_es_array(strip_t *pes_in, int n_esin, strip_t **pes_out, int *n_esout);
void duplicate_re_array(re *pre_in, int n_rein, re **pre_out, int *n_reout);
int file_exist(char *filename);
int file_info(char *filename, off64_t *file_size, time_field_t tft, time_t *ts, mode_t *mode);
int find_char_offset(char *str, char what);
int find_editscheme(char *name);
int find_filterscheme(char *name);
char * find_most_recent_file(char *filespec, char *cur_file);
char *find_next_par(char *start);
int find_path_max(void);
void free_iat(int_array_t *piat);
void free_re(re *cur_re);
char *gethome(char *user);
int get_iat_element(int_array_t *piat, int index);
int get_iat_size(int_array_t *piat);
void get_load_values(double *v1, double *v2, double *v3);
void get_now_ts(char *format_str, char *dest, int dest_size);
double get_ts(void);
char * getusername(void);
int get_value_arg(char *par, char *string, valcheck_t check);
int get_vmsize(pid_t pid);
void grow_mem_if_needed(char **what, int *cur_len, int requested_len);
void init_children_reaper(void);
void init_iat(int_array_t *piat);
int match_files(char *search_for, char **path, char ***found, char **isdir);
int myclose(int fd);
int mydup(int old_fd);
int myopen(char *path, int mode);
int myrand(int max);
char *myrealpath(char *in);
int open_null(void);
struct passwd *getuserinfo(void);
int READ(int fd, char *where_to, int max_len, char *for_whom);
char * read_line_fd(int fd);
void setup_for_childproc(int fd, char close_fd_0, char *term);
char * shorten_filename(char *in, int max_len);
void stop_process(pid_t pid);
char * term_t_to_string(term_t term);
ssize_t WRITE(int fd, char *whereto, size_t len, char *for_whom);
char zerotomin(char c);
