<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>
Miscellaneous Functions

float jlib_return_version_number(void);

This function returns a floating point value that is the version of the library that was compiled, i.e. 1.6 for JLib version 1.6.

char *jlib_return_version_string_string(void);

This function returns a string with a brief description of the version of the library that was compiled.

void popup_about(UBYTE fg,UBYTE bg);

Draws an "about" dialogue on screen containing target and mode information, in colours fg and bg. You must have either the keyboard or the mouse initialised before calling this function , or the user will not be able to press a key/click to move on. If the target has no keyboard or joystick support the function will use fgetc(stdin) to wait for the user to press a key.

void popup_info(char *text,UBYTE fg,UBYTE bg);

Draw on screen a dialogue containing text. The dialogue size is adjusted to fit the amount of text to be shown You must have one of the keyboard or mouse initialised before calling this function , or the user will not be able to press a key/click to move on. If the target has no keyboard or joystick support the function will use fgetc(stdin) to wait for the user to press a key.

void jlib_exit(char *message);

This function restores the system state if possible and exits to the operating system as gracefully as possible. This function is called internally by the library whenever a fatal error occurs. You may call this function from within your application to handle fatal errors. Note that if a custom error handler has been set with jlib_set_error_handler() than that will be called instead of the default error handler.

void jlib_set_error_handler(exit_function func);

This function allows you to specify your own exit function in the event of a fatal library or application error. If you want to write your own error handler I suggest looking in source/misc/error.c to get an idea of what to do upon an error. Your exit function should take one char * parameter which is a message describing the error that caused the fatal exit.

void jlib_exit_details(char *message);

This function performs most of the processing required from an error handler. It is advised that custom error handlers either call this function, or mimic its actions closely. Note that this call does return, so you must exit() or abort() the program yourself after calling it.

void uclock_init(void);

This function initialises a high resolution timer and starts it counting. Once initialised, time values can be read from the timer by calling the function uclock_read(). The constant UCLOCK_TICKS_PER_SECOND defines how many times per second the clock is updated.

unsigned int uclock_read(void);

This function returns the current value of the high resolution timer. You must call uclock_init() prior to using this function. Note that the values returned by this function may be positive or negative, but they will always increase over time. The difference between two successive calls to this function determines how much time has passed. Dividing this number by UCLOCK_TICKS_PER_SECOND will return the time passed in seconds.

Next Section: Debugging Functions

<Start> <Intro> <Install> <Legal> <Screen> <Buffer> <Sprite> <Input> <Misc> <Debug> <Utes> <Author>