33 #include <sys/types.h>
35 #define PAD(bits, pad) (((bits)+(pad)-1)&-(pad))
37 #define MIN2(a, b) (((a) < (b)) ? a : b)
38 #define MAX2(a, b) (((a) > (b)) ? a : b)
39 #define MIN3(a, b, c) (((a) < (b)) ? MIN2(a, c) : MIN2(b, c))
40 #define MAX3(a, b, c) (((a) > (b)) ? MAX2(a, c) : MAX2(b, c))
42 #define yes_or_no(x) ((x)?"yes":"no")
43 #define on_or_off(x) ((x)?"on":"off")
44 #define true_or_false(x) ((x)?"true":"false")
45 #define w_or_v(x) ((x == COORD_WORLD)?"world":"view")
47 #define LFORMAT_TYPE_PLAIN 0
48 #define LFORMAT_TYPE_EXTENDED 1
50 #define cxfree(ptr) xfree(ptr); ptr = NULL
52 #define PSTRING(s) ((s == NULL) ? "" : escapequotes(s))
54 void xfree(
void *ptr);
55 void *
xrealloc(
void *ptr,
size_t size);
56 void fswap(
double *x,
double *y);
57 void iswap(
int *x,
int *y);
59 int argmatch(
char *s1,
char *s2,
int atleast);
63 double comp_area(
int n,
double *x,
double *y);
76 int bin_dump(
char *value,
int i,
int pad);
105 int yesno(
char *msg,
char *s1,
char *s2,
char *help_anchor);
143 void set_debuglevel(
int level);
144 int get_debuglevel(
void);
void set_grace_home(const char *dir)
unsigned char reversebits(unsigned char inword)
int fexists(const char *to)
char * copy_string(char *dest, const char *src)
void set_docname(const char *s)
void set_print_cmd(const char *cmd)
void lock_dirtystate(int flag)
char * get_print_cmd(void)
void fswap(double *x, double *y)
void clear_dirtystate(void)
char * get_userhome(void)
char * create_fstring(int form, int prec, double loc, int type)
int yesno(char *msg, char *s1, char *s2, char *help_anchor)
int set_workingdir(const char *wd)
void convertchar(char *s)
char * bi_version_string(void)
void reverse_string(char *s)
int bin_dump(char *value, int i, int pad)
char * mybasename(const char *s)
void expand_tilde(char *buf)
int compare_strings(const char *s1, const char *s2)
void set_dirtystate(void)
char * concat_strings(char *dest, const char *src)
void * xrealloc(void *ptr, size_t size)
void set_locale_num(int flag)
void msleep_wrap(unsigned int msec)
int isoneof(int c, char *s)
void set_help_viewer(const char *dir)
double comp_perimeter(int n, double *x, double *y)
void stufftext(char *s, int sp)
int argmatch(char *s1, char *s2, int atleast)
int system_wrap(const char *string)
char * get_help_viewer(void)
char * bi_ccompiler(void)
char * get_username(void)
void iswap(int *x, int *y)
char * escapequotes(char *s)
char * get_grace_home(void)
char * get_workingdir(void)
void update_app_title(void)
void set_editor(const char *cmd)
double comp_area(int n, double *x, double *y)
void log_results(char *buf)