http://www.w3.org/TR/html4/loose.dtd"> StdGUI Utility Functions

StdGUI Utility Functions

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUES
AUTHOR

NAME

StdGUI Utility Functions

SYNOPSIS

int beep_sound(int p_duration);

const char *stdgui_error(void);

int point_in_rect(int p_x, int p_y, int p_x0, int p_y0, int p_x1, int p_y1);

int point_in_oval(int p_x, int p_y, int p_x0, int p_y0, int p_x1, int p_y1);

int point_on_line(int p_x, int p_y, int p_x0, int p_y0, int p_x1, int p_y1);

int global_to_local(TARGET *p_tgt, int p_gx, int p_gy, int *p_lx, int *p_ly);

int local_to_global(TARGET *p_tgt, int p_lx, int p_ly, int *p_gx, int *p_gy);

char *strclone(const char *p_str);

void *memclone(const void *p_ptr, size_t p_size);

void auto_release(void);

DESCRIPTION

The beep_sound() function causes the host system alert sound to be generated, possibly (if the host system supports it) for a specified period of time.

The stdgui_error() function returns a string describing the most recent error generated by the StdGUI framework.

The point_in_rect(), point_in_oval() and point_on_line() functions determine if a point (p_x,p_y) is within or on the rectangle, oval or line segement specified by (p_x0,p_y0,p_x1,p_y1).

The strclone() and memclone() functions create dynamically allocated (with malloc()) copies of the string or memory block passed to them.

The auto_release() function releases any memory allocated by the StdGUI framework for temporary return values (mostly strings or arrays of strings).

RETURN VALUES

The beep_sound() function returns zero (0) on success, non-zero on failure.

The stdgui_error() function returns a pointer to a statically allocated string.

The point_in_rect(), point_in_oval() and point_on_line() functions all return true (1) if the point satisfies the condition, and false (0) otherwise.

The strclone() and memclone() functions return a valid pointer on success, NULL on failure.

AUTHOR

Jeffrey Dutky

dutky@bellatlantic.net or jeff.dutky@gmail.com

http://members.bellatlantic.net/~dutky