Unicorn Library Reference Guide ( UCLIB 5.00 ) Unicorn Software P.O. Box 3214 Kirkland, WA 98083-3214 double a_circle( double ); Return the area of a circle with a given radius. int act_page( void ) Return the current active video page. int active_dsply( MNUPTR mnu_ptr, int choice ) Display the selected menu item in the active attribute. double a_cylinder( double, double ); Return the lateral surface area of a cylinder. double a_ellipse( double, double ); Return the area of an ellipse given its major and minor radii. double al_cone( double, double ); Return the lateral surface area of a cone given the radius of the base and the height. double alt_eq_t( double ); Return the altitude of an equilateral triangle. double a_parallel( double, double, double ); Return the area of a parallelogram given the length of the two sides and the enclosed angle in radians. double a_rect( double, double ); Return the area of a rectangle given the two sides. double a_sphere( double ); Return the area of a sphere given the radius. double at_cone( double, double ); Return the total area of a cone. double at_cylinder( double, double ); Return the total area of a cone given the radius and height. double a_trap( double, double, double ); Return the area of a trapezoid given the height and the lengths of the two parallel sides. double a_triangle( double, double ); Return the area of a triangle given the base and height. double a_tri3s( double, double, double ); Return the area of a triangle given the three sides. void atsay( int att, int row, int col, char *str ) Write a string at a specific screen location using a passed attribute. void bdr_clr( int color ) Change the boder color in text modes. In graphics modes this will change both the border and background colors. void bios_dot( int row, int col, int color) Write a dot to the graphics screen using a bios call. void blk_let( int ch, int row, int col, int att, int page ) Print a large letter of block characters. void blk_str( char *str, int row, int col, int att, int page ) Print a string of block letters on the screen. int blnkstr( char *str ) Replace all characters in a string with space characters. int cgetchar( int att ) Get a character from the user using a passed attribute. int c_gets( int, char * ); Get a string from the user using a passed attribute. Allows considerable editing including right and left cursor arrow keys, home, end, insert and delete. Returns the length of the string. int chng_case( char str[] ) Change the case of all alphabetic characters in a string. void clr_eol( void ) Clear the screen from the curent cursor position to the end of the current line. int clr_kbuf( void ) Clear the keyboard type-ahead buffer and wait for a key stroke. void clr_page( int att, int page ) Clears the specified video page to the value of attribute. void clr_win( int ulr, int ulc, int lrr, int lrc, int att ) Clear a portion of the screen to a passed attribute value. void cls( void ) Clear the screen to the default DOS attribute. void cls_clr( int att ) Clear the screen to a passed attribute value. int countch(char *str, char ch) Returns the number of times a character occurs in a given string. double cm_inch( double ); Convert centimeters to inches. int c_printf( int, char *line... ) A full color version of printf. The only differences are that this function requires a passed attribute and will NOT currently scroll when the bottom of the screen is reached. void cputchar( int att, int ch ) Color version of putchar. Tabs are performed by skipping 3 spaces. int cur_col( int page ) Return the current cursor column. void cur_off( void ) Turns off the screen cursor. void cur_on( void ) Turns on the screen cursor. void cur_rel( int row_dif, int col_dif ) Move the screen cursor relative to the current location. void cur_restore( void ); This function uses the information stored in the uc_cursor structure to place the cursor back on the screen. NOTE: This will restore the cursor from the last call to cur_sav() unless the user has placed data into the structure in the meantime. int cur_row( int page ) Returns the current cursor row. void cur_save( void ) Saves all current cursor information in a CURSOR structure including row, column and starting and ending lines. int cur_start( void ) Return the cusror starting line. int cur_stop( void ) Return the cursor stop line. char *d2mmddyy( int, int, int ) Accepts a year, month and day and returns a date in 'mmddyy' format. int day( long ); Returns the day portion of a date in YYMMDD format. long day2jul( long ); Convert a date in YYMMDD format to a julian date. This is useful from about 1900 to 2099 as it uses an approximation in the calculations. int dayofwk( long ); Returns the day of the week from a julian date. int day_of_yr( int, int, int ) Accepts a year, month and day and returns the day number of the year. double deg_rad( double ); Converts degrees to radians. Implemented as a macro. int del_blnks( char str[] ) Deletes all space characters from a string and returns the number of deletions made. int del_ch( char *str, int location ) Deletes the character at location from the string. int del_lwh( char str[] ) Deletes leading white space from a string. Returns the length of the resulting string. int del_substr( char str[], int start, int num_chars ) Delete a substring from a string. int del_twh( char str[] ) Deletes trailing whitespace from a string. Returns the length of the resulting string. void dx10cpi( void ); Sets the daisy wheel printer to 10 characters per inch. void dx12cpi( void ); Sets the daisy wheel printer to 12 characters per inch. void dx15cpi( void ); Sets the daisy wheel printer to 15 characters per inch. void dx8ln( void ); Sets the daisy wheel printer to 8 lines per inch. void dx12ln( void ); Sets the daisy wheel printer to 12 lines per inch. void dx120bs( void ); Back space the daisy wheel printer 1/120 inch. void dxback( void ); Select the reverse direction print mode for the daisy wheel printer. void dxbi( void ); Set the daisy wheel to the bi-directional print mode. void dxboldst( void ); Turn on the daisy wheel bold print mode. void dxbsend( void ); End both shadow and bold print modes. void dxchwide( int ); Set the daisy wheel character width to 'number' - 1 120ths of an inch. Number may be from 1 to 126. void dxclr1tb( void ); Clears the tab at the current column position of the printer. void dxclrtab( void ); Clears all tabs set by dxsetht(). void dxdefwid( void ); Return the HMI to the default selected by the dip switches. void dxeject( void ); Eject a sheet of paper without loading a new one if the optional sheet feeder is being used. void dx_esc_y( void ); Print the character defined by 'esc y' on the wheel. void dx_esc_z( void ); Print the character defined by 'esc z' on the wheel. void dxff( void ); Send a form feed to the daisy wheel printer. void dxfor( void ); Select the forward print mode for the daisy wheel printer. void dxhlf( void ); Send a half line feed to the daisy wheel printer. void dxinit( void ); Inititalize the printer to its power on state. void dxlinsp( int ); Set the VMI or line spacing to ( 'number' - 1 ) / 48 ths of an inch. Number must be from 1 to 126. void dxlmarg( void ); Set the daisy wheel's left margin to the current position. void dxpglen( int ); Set the page length for the daisy wheel printer. The page length is set in terms of the number of lines but is stored as an absolute length which does not change it the line spacing is later changed. This function also sets the Top- of-Form to the current location. void dxrhlf( void ); Send a reverse half line feed to the daisy wheel printer. void dxrlf( void ); Send a reverse line feed to the daisy wheel printer. void dxsetht( void ); Set a horizontal tab at the curren position. void dxshast( void ); Set the daisy wheel to the shadow print mode. void dxundend( void ); End the under line print mode. void dxundst( void ); Commence underline print mode for the daisy wheel printer. void dxuni( void ); Select the unidirectional print mode. int dy_in_mo( int, int ) Return the number of days in a month from a 4 digit year and a month number. char *first_ch( char * ) Return a pointer to the first non whitespace character in a string. void fld_add( WINDOWPTR, FIELDPTR ) Adds a field to the window's list of fields. void fld_all( WINDOWPTR ) Displays all fields attached to a window with any predefined values for the fields. void fld_clear( FIELDPTR ) Clears a single field to space characters. void fld_dsply( WINDOWPTR, char *, char * ) This function displays the fields data with a defined mask. void fld_init( WINDOWPTR ) Establishes a field list pointer in a user passed window structure. Any fields pre-existing a call to this function are destroyed and deallocated from the heap. This function must be called prior to defining any fields for the window. FIELDPTR fld_make( WINDOWPTR, int, int, char *, int, char *, char *, int ) Creates a field structure and adds it to the window field list. Default values are defined for the values not passed. int fld_read( WINDOWPTR, FIELDPTR ) Read a single data field. void fld_rjsp( char * ) Right justify a field's data and fill leading area with space characters. void fld_rjz( char * ) Right justify a field's data and fill leading area with zeros. int fld_terminate( int ) Check for a proper field termination key character. void fld_value( WINDOWPTR, FIELDPTR ) Display the data value contained in the structure on the screen. This function also re-writes the prompt. void fm_clear( WINDOWPTR ) Clears all fields to space characters. int fm_proc( WINDOWPTR ) This function processes all fields in the window field list. int fsub_str( char *substr, char *str ) Find the location of a substring in a larger string. double gal_lt( double ); Converts gallons to liters. Implemented as a macro. long gcd( long, long ) Return the greatest common divisor for two long integers. int get_ca( int, int, int ) Get a character and atribute from the screen at the location of the cursor on a pased page. void getcha( int *att, char *ch ) Get the character and attribute at the current cursor location. int get_curs(int *row, int *col, int page) Get the current cursor position on the specified page. long get_mem( void ) Returns the largest free block of memory. int getmode( void ) Returns the current video mode. unsigned get_psp( void ) Returns the segment address of the PSP. int get_str( char *str ) Get a string from the user and replace the CR terminator with a NULL terminator. long getticks( void ); The function returns the current BIOS clock tick counter value. void gliss( int, int, int ); This function produces a glissando sound. It may be either a rising or falling glissando. The parameters are start and end frequencies and the amount added for each pass through the loop. This third parameter thus controls the speed of the glissando produced. double gm_oz( double ); Converts grams to ounces. Implemented as a macro. int gotorc(int row, int col, int page ) Position the cursor on the specified page. Returns 0 if successful, -1 if row is too large, -2 if the column is too large and -3 if both are too large. void gr_bckgnd( int color ) Set the graphics background color. long gregorian( long ) Converts a julian date number to a gregorian date in 'YYYYMMDD' format. void heap_map( void ); Display a map of the current heam memory status. This is only available for the Microsoft C version of the library at present int inactive_dsply( MNUPTR mnu_ptr, int choice ) Display the selected menu item in the inactive attribute. double inch_cm( double ); Convert inches to centimeters. Implemented as a macro. int indexch( char *str, char ch ) Returns the first position, starting form the left, of the character within the string. int indexr( char *str, char ch ) Returns the righmost location of the character within the string. int ins_ch( char ch, char *str, int start ) Inserts a character into a string at start. Returns the length of the resulting string. The passed string must be long enough to hold the added character. int insert_item( MNUPTR mnu_ptr, MNU_ITEMPTR mnu_item ) Add a menu item definition to a defined menu. int ins_spc( char *str, int start, int number ) Inserts a number of spaces into a string starting at the position start. Returns the length of the resulting string. The passed string must be long enough to hold the addes spaces. int isalt( void ) Return 1 if allternate key is currently pressed, 0 otherwise. int isblanks( char * ) Return 1 if a string is all space characters, otherwise return 0. int iscaplk( void ) Return 1 if caps lock key is active, 0 otherwise. int isctrl( void ) Return 1 if control key is depressed, 0 otherwise. int isega( void ) Determine if an EGA adapter is active in the current system. Returns the number of kilobytes of EGA memory if installed or -1 if no EGA adapter is found. int isleapyr( int ) Returns 1 if the passed year is a leap year, otherwise return 0. int islshift( void ) Return 1 if left shift key is depressed, 0 otherwise. int isnumlk( void ) Return 1 if the num lock key is depressed, 0 otherwise. int isrshift( void ) Return 1 if right shift key is depressed, 0 otherwise. int isscrlk( void ) Return 1 if the scroll lock key is depressed, 0 otherwise. int item_dsply( MNUPTR mnu_ptr ) Display a single menu item including the special key letter. long jul2day( long ); Convert a julian date into a date in YYMMDD format. This is useful from about 1900 to 2100 due to approximations in the calculations. long julian( int, int, int ) Returns a julian date when passed a year, month and day. Accurate from 1/1/1 to 9999/12/31. double kg_lb( double ); Converts kilograms to pounds. implemented as a macro. double km_mi( double ); Converts kilometers to miles. Implemented as a macro. unsigned kstate( void ) Returns the key state byte via interrupt 0x016. double lb_kg( double ); Converts pounds to kilograms. Implemented as a macro. char *left_str( char str[], int length ) Return a substring of a given length from the left of a passed string void lprintf( char *, ... ); Acts just like printf() except the output is sent to the printer and you must end the argument list with a NULL arg. void lputchar( char ); Sends a single character to the printer. void lputs( char * ); Sends a string to the printer. The string contains a '\n' character appended to the end. double lt_gal( double ); Converts liters to gallons. Implemented as a macro. MNU_ITEMPTR make_item( int row, int col, int inactive, int active, char *text, PFI func, char letter, int att_letter, MNUPTR mnu_ptr ) Allocate a menu item structure and assign values to it. MNUPTR make_mnu( WINDOWPTR wn_mnu ) Allocate a menu structure and attach a window to it. int mnu_dsply( MNUPTR mnu_ptr ) Display a complete menu with all fields. int mnu_proc( MNUPTR mnu_ptr, int item_nbr ) Process a menu. double m_yd( double ); Converts meters to yards. Implemented as a macro. int m_btnpos( void ); Returns the mouse button status as follows: 0 - no button pressed. 1 - left button pressed. 2 - right button pressed. 3 - both buttons pressed. void m_flagde( void ); Decrement the mouse cursor flag. The maximum value is 0 which makes the cursor visible while all negative values indicate an invisible mouse cursor. void m_flagin( void ); Increment the mouse cursor flag. The maximum value is 0 which makes the cursor visible while all negative values indicate an invisible mouse cursor. int m_ghpos( void ); Return the mouse current horizontal position. The value will be within the virtual screen limits. Default is from 1 to 639. int m_grbcnt( void ); Returns the number of right mouse button presses. int m_glbcnt( void ); Returns the number of left mouse button presses. int m_gvpos( void ); Return the current mouse vertical position. The value will be within the virtual screen limits. Default return is from 0 to 199. char *mid_str( char str[], int start, int length ) Returns a substring of a passed string starting at start and of length length. double mi_km( double ); Converts miles to kilometers. Implemented as a macro. int mk_att( int back, int fore ) Combine foreground and background colors into an attribute byte. unsigned mk_offset( int row, int col ) Convert row and column coordinates into an offset into the video buffer. int m_llphpos( void ); Return the horizontal position when the left button was last pressed. int m_llpvpos( void ); Return the vertical position when the left button was last pressed. int m_llrhpos( void ); Return the horizontal position when the left button was last released. int m_llrvpos( void ); Return the vertical position when the left button was last released. int m_lrphpos( void ); Return the horizontal position when the right button was last pressed. int m_lrrhpos( void ); Return the horizontal position when the right button was last released. int m_lrpvpos( void ); Return the vertical position when the right button was last pressed. int m_lrrvpos( void ); Return the vertical position when the right button was last released. int month( long ); Returns the month portion of a date in YYMMDD format. char *month_str( void ) Reads the BIOS clock and returns a string for the current month. Memory is malloced within the function for the string. int monthyr( void ) Returns the month number for the current BIOS clock date. Starts with January = 0; int m_reset( void ); Resets the mouse to the power up state. void m_setpos( int, int ); Sets both the horizontal and vertical positions for the mouse. The passed values must be within the virtual screen limits. No check is made to insure this is true. void m_txtscur( int, int ); Sets a text mode software cursor. It is passed a screen mask and a cursor mask. int m_2_row( int ); Returns the text row number for a passed pixel mouse coordinate. Row numbers are from 0 to 24. void nbr2wrds( double, char * ) Converts a number in money format to a string of words. int nbr_prns( void ) Return the number of installed printers. int numcols( void ) Returns the number os current screen columns. double oz_gm( double ); Converts ounces to grams. Implemented as a macro. void palette( int number ) Select the color set for mode 4 graphics. void phasor( int ); Makes a number of phasor sounds. The number is a passed parameter. void prn_6_ln( void ); Place the graphics printer in a 6 line per inch mode. void prn_8_ln( void ); Place the graphics printer in an 8 line per inch mode. void prn_10_cpi( void ); Place the graphics printer in a 10 character per inch mode. void prn_12_ln( void ); Place the graphics printer in a 12 line per inch mode. void prn_12_cpi( void ); Place the graphics printer in a 12 character per inch mode. void prn_bell( void ); Ring the printer bell. void prn_can( void ); Cancel printer job and clear the print buffer. void prncomof( void ); Turn off the graphcis printer compresed mode. void prncomon( void ); Turn on the graphics printer compressed mode. void prndblof( void ); Turn off the double print mode. void prndblon( void ); Turn on the double print mode. void prndwof( void ); Turn off the double wide mode. void prndwon( void ); Turn on the double wide mode. void prnempof( void ); Turn off emphasized print. void prnempon( void ); Turn on emphasized print. void prn_ends( void ); End the super/sub-script modes. void prn_ff( void ); Send a form feed to the graphics printer. int prn_ready( void ) Returns non-zero if the printer is ready to print. This is somewhat dependent on individual components but should work properly on most compatibles and printers. void prn_sub( void ); Place the printer in the subscript mode. void prn_sup( void ); Place the printer in the superscript mode. void prn_unof( void ); End the underline print mode. void prn_unon( void ); Start underline print mode. void prnwidof( void ); Turn off the wide print mode. void prnwidon( void ); This function turns on the wide print mode. It is turned off automatically at the next print command. int put_ch( register char ch, int page ) Puts a character at the current cursor position using the existing screen attribute. Moves the cursor forward one character position. int put_cha( register char ch, int page, int att ) Puts a character on the screen at the current cursor location. Uses a passed attribute and moves the cursor forward on character position. void putchr( char ch ) Puts a character at the current cursor location using the existing screen attribute. Does not alter the current cursor position. double rad_deg( double ); Converts radians to degrees. Implemented as a macro. int read_att( int page ) Returns the attribute at the current cursor location. int read_ch( int page, int *att) Returns the character at the current cursor location. The attribute is returned in the formal parameter. void replacech( char *str, char chold, char chnew ) Replaces alll occurances of a character in a string with a new character. char *right_str( char str[], int length ) Return a substring of length starting at the far right of a string. void rjust( char source[], char dest[], int width ) Right justify a string within a passed width. The justified string is returned in dest[]. void scr_1ln( int ulr, int ulc, int lrr, int lrc, int att) Scroll a portion or all of the screen up one line. void scrn_off( void ) Turns off the screen. void scrn_on( void ) Turns the screen back on after a call to scrn_off(). void setcursh( int start, int stop ) Set the cursor shape ( start and stop lines ). void setfreq( int ); Set a frequency value for the sound chips to use in sound production. int setmode( int mode ) Set the video mode. void setpage( int page ) Set the active video page. int sf_active( FIELDPTR, int ) Set the field active attribute ( the atribute when the field is the current field ). int sf_begfu( FILEDPTR, PFI ) Attaches a function to the field structure. This function will be called before the field is processed. int sf_endfu( FIELDPTR, PFI ) Attaches a function to the field structure. This function will be called after the field is processed. int sf_hlptag( FIELDPTR, char * ) Set the field help tag in the field structure. int sf_inactive( FIELDPTR, int ) Set the field attribute when not the current field. int sf_message( FIELDPTR, char * ) Set a message in the field structure to be displayed when the field is the current field. This message may be displayed through the use of a begin field function. int sf_on_key( FIELDPTR, PFI ) Attaches a function pointer to the field structure that will be called when the users presses a key. May be used to preprosses key strokes before the field editor. int sf_patt( FIELDPTR, int ) Sets the attibute to be used in writting the prompt to the screen. int sf_prompt( FIELDPTR, char * ) Sets the field prompt character array into the field structure. int sf_prot( FIELDPTR, char * ) Sets field protection. int sf_usr_val( FIELDPTR, PFI ) Sets a user validation function. May be called from an end field function. int sf_val( FIELDPTR, PFI ) Sets a validation function. This function will be called from within the field editor. void shr_str( char *str ) Shift a string to the right. void siren( int ); Produces a number of siren sounds. int str_beg( char * ) Find the first actual text character in a string. Uses the C counting scheme in that the first character is 0. Returns -1 if the string contains no real text, otherwise returns the first actual ( non-space ) text position. char *strblnk( int ) Allocates memory for a string of a passed size. The string is initialized to all space characters. The function allocates the extra space for the NULL terminator so the user need only pass the actual size desired. void str_cent( char *, char *, int ) Center a string in a destination buffer. The width in which to center is also passed. int str_cjst( char * ); Center a string's characters within the string itself. This alters the passed string. char *str_date( void ) Returns the current date as a formatted string (MM:DD:YYYY). int str_end( char * ) Find the last real text character in a string. Uses the C counting scheme in that the first character is numbered 0. If the string contains all spaces the return is -1 otherwise the ending text location is returned. int strip_nl( char * ); Strips trailing newlines from a string. int str_left( char *str, int start, int number ) Shift the characters in a string to the left by a number of bytes starting from a passed start point. Caller is not allowed to shift the string past the starting point for the string. int str_ljst( char * ); Left justifies the characters in a string by altering the passed string. char *str_mask( char *str, char *mask ) This function creates and returns a subset of a given string based on a passed mask. In the mask string a '?' character will return the character for that position. An 'x' character will cause the corresponding character to be deleted while a ' ' character will substitute a space for the character. An 'A' character will convert any alphabetic character in that position to upper case while a character of 'a' will convert the string character to lower case. If the mask character is '9' only digits will be allowed, a non-digit will be converted to a space. char *str_mon( long ) Return the month as a malloced word for a passed long date in 'YYMMDD' format. void strpad( char str[], int number ) Adds a given number of spaces to the left of a string. void str_rev( char str[] ) Reverse the order of characters in a string. int str_right( char *str, int start, int number ) Shift a the characters in a string to the right by a number of bytes starting from a passed start point. The string must be long enough so that the shift will not overshoot the string. No check is made for this. Return: resulting string length. int str_rjst( char * ); Right justifies the passed string within the string by altering the string itself. char *str_save( char * ) Malloc space for a string, copy the passed string to this space and return a pointer to the new string. char *str_time( void ) Returns the current time as a string in 'hh:mm:ss' format. void strtolow( char str[] ) Converts all characters in a string to lower case. void strtoup( char str[] ) Converts all charaters in a string to upper case. void sw_att(int att, int count, int page) Screen write an attribute to the specified video page. int sw_ch( char ch, int count, int page ) Screen write a character to the video page specified. Uses the current screen attribute and wraps at the end of the line. int sw_cha( char ch, int att, int count, int page ) Screen write a charater and an attribute on the given video page. int sw_str( register char *str, int page ) Screen write a string to the specified video page using the current attribute. int sw_stra( register char *str, int page, int att ) Screen write a string to the specified video page using a passed attribute. int uc_beep( void ) Sound the speaker tone. void ucdelay( float ); This program causes a delay in fractions of a second. It is based on the timer tick value and thus has a resolution of only about 1/18.2 or 0.55 seconds. void uc_error( void ); Sound a short tone of 440 HZ followed by a short tone of 220 HZ. void uc_hline( int, int, char, int, int, int ); Draw a horizontal line of character on the screen. int uc_key( void ); Get a keystroke without echoing to the screen. The value returned is negative for special keys. ( see key.h ) Returns ASCII key code otherwise. void uc_ok( void ); Sound a short tone of 440 HZ followed by a short tone of 880 HZ. unsigned ucpeek( unsigned seg, unsigned off ) Peek a word from memory from a passed address in segment and offset form. unsigned char ucpeekb( unsigned seg, unsigned off ) Peek a byte from memory from a passed address in segment and offset form. void ucpoke( unsigned seg, unsigned off, unsigned value ) Poke a word into memory at the address indicated by segment and offset. void ucpokeb( unsigned seg, unsigned off, unsigned char value ) Poke a byte into memory at the address indicated by segment and offset. long uc_today( void ); Find the current date as a long integer. Date is returned in YYMMDD format. void uc_tone( int, float ); Sound a tone from a passed frequency and duration. void uc_vline( int, int, char, int, int, int ); Draw a vertical line of character on the video screen. unsigned ucvpeek( int, int ); Return the word contained in video memory at a row and column position. void ucvpoke( int row, int col, int attribute, char ch ) Poke a character and attribute into the video buffer using row and column screen coordinates. void ucvpokeb( int row, int col, char ch ) Poke a character into the video buffer using row and column coordinates. void unmk_att( int, int *, int * ); Unmake an attribute byte and return the foreground and background colors in parameters. int val_mon( int ) Validates that a month number is proper. int val_date( char * ) Validates a date in 'mmddyy' format. int val_state( char * ) Validates a state two letter abbreviation for a proper upper case value. double v_cone( double, double ); Return the volume of a cone from the radius and height. double v_sphere( double ); Return the volume of a sphere from its radius. void vwarble( int, int, int ); Produces a variable warble sound in which the low tone gets lower and the high tone gets higher with each cycle. void warble( int, int, int ); Produces a warble sound. The user may specify the low and high tones and the number of warbles. void w_ch( int ch, int color, int page ) Write a character in color using a BIOS call. void w_cha( int ch, int att, int page ) Write a character and attribute at the cursor location on page. int wkday( void ); Returns a number for the current day of the week from the BIOS clock. Starts with Sunday as 1. char *wkday_str( void ) Return the current day as a string. void wn_addbg( WINDOPTR ) Add a window to the linked list of windows. void wn_adden( WINDOWPTR ) Add a window to the linked list of windows. int *wn_addr( WINDOWPTR, int, int ) Computes the actual location of a character within a window. This location may be on the screen or in another window's save area if window's are overlapping on the screen. void wn_back( WINDOWPTR ) Moves a window behind all other windows. void wn_bclr( WINDOWPTR, int ) Sets the border attribute for a window. void wn_bdr( WINDOWPTR ) Draw the border for a window. void wn_char( WINDOWPTR, int, int, int, int ) Write a character to a window. void wn_clear( WINDOWPTR ) Clears the window area to all spaces in the window normal attribute. void wn_check( WINDOW ** ) Checks to see if a window is in the current linked list of windows. void wn_clrerr( void ) Deletes the error window from the window list after removing it from the screen. void wn_csr( WINDOWPTR, int, int ) Sets the position of the window cursor. void wn_delete( WINDOWPTR ) Deletes a window from the window list. If the window was displayed on the screen it will be removed from the screen first. void wn_dsply( WINDOWPTR ) Displays a window currently in the window list. void wn_err( char * ) Displays an error message in the error window. void wn_front( WINDOWPTR ) Moves a window to the front of the display, in front of all other displayed windows. int wn_getch( WINDOWPTR, int, int ) Gets a character from a given row, col position in a window. void wn_hide( WINDOWPTR ) Removes a window from the screen. The window is not destroyed and may be redisplayed later. The window may also have text written to it while it is hidden. void wn_insert( WINDOWPTR, WINDOWPTR ) Insert a window into the window list after a given window which must be in the current list. WINDOWPTR wn_make( int, int, int, int ) Allocates a window structure from the passed row, col, height, and width coordinates. All other window structure values are assigned default values. void wn_margin( WINDOWPTR, int ) Assigns a margin value to the window structure for horizontal margins ( right and left ). void wn_mkbdr( WINDOWPTR, BORDERPTR ) Assigns a border type to the window. void wn_move( WINDOWPTR, int, int, int ) Moves a window in three directions, x, y and z axis. void wn_pchar( WINDOWPTR, int ) Writes a single character to a window. void wn_position( WINDOWPTR, int, int ) Moves a window to a given row, col location on the screen. void wn_printf( WINDOWPTR, char *, ... ) Similar to the normal printf function with the addition of a window parameter. This function will also write in the current attribute as do most of the window write functions. void wn_rposition( WINDOWPTR, int, int ) Moves a window by a relative distance for row, col on the screen. Negative displacements are allowed in order that windows may be moved up or to the left. void wn_scroll( WINDOWPTR, int ) Used to scroll a window up or down ( depending on the direction parameter ). void wn_swap( WINDOWPTR ) Swap a window with its save buffer. If hidden this will display the window, if displayed this will restore the background. void wn_unlist( WINDOWPTR ) Remove a window from the window list. void wn_wclr( WINDOWPTR, int ) Set the window normal attribute. void w_strc( char *str, int color, int page ) Write a string in color on a specified page using a BIOS call. void wv_str( char *, int, int ) Write a string using BIOS calls with wrap at end of screen. The caller specifies attribute and video page for the write. double yd_m( double ); Converts yards to meters. Implemented as a macro. int year( long ); Returns the year portion of a date in YYMMDD format. int zeller( int, int, int ) Returns the day of the week ( 0 to 6 ) for a passed year, month, and day.