Weather API Library Module

The weather API library module has the file name wlib.c. This module performs various weather conversions. Any conversion that will uses floating-point numbers is coded to make use of the fixed-point math API.

Here is a list of functions in the weather API library module:

Module Dependencies

The following modules are required along with this module:

Module Header Files

This module requires the header files:

Module Functions

wlib_wdir_desc_2_deg

Prototype  : int wlib_wdir_desc_2_deg(char *ddesc, struct fxp **ddeg)
Parameters :
      Name : ddesc
Description: input wind direction alpha

      Name : ddeg
Description: output wind direction degrees

Returns    : TRUE upon success, FALSE otherwise

This function will convert the input wind direction alpha to degrees. There are sixteen possible alpha descriptions. Upon success the wind direction in degrees will be loaded into the newly allocated output wind direction degrees (the caller is responsible to de-allocate this). The scale of the output wind direction degrees is defined as one.

wlib_get_field

Prototype  : int wlib_get_field(char *line, char *outfield,
                                int which, char delim)
Parameters :
      Name : line
Description: input ASCII line

      Name : outfield
Description: output field data

      Name : which
Description: field number

      Name : delim
Description: field delimiter

Returns    : wlib_get_field code defined in wlib.h

This function will obtain the field number field within the input ASCII line of a WeatherLink report. Each field in the input ASCII line is delimited by the field delimiter. Upon success, the result field will be loaded into the output field data which must already be allocated to sufficient size by the caller.

wlib_report_trailer

Prototype  : int wlib_report_trailer(FILE *out, char *apname, char *ver,
                                     int do_copy)
Parameters :
      Name : out
Description: output report stream

      Name : apname
Description: application name

      Name : ver
Description: version ID string

      Name : do_copy
Description: copyright flag

Returns    : TRUE upon success, FALSE otherwise

This function will place a standard trailer on a weather report with or without a copyright notice. If the copyright flag is turned off, the program platform will not be reported.

wlib_pack_datime

Prototype  : int wlib_pack_datime(char *line, char *datime, char delim)
Parameters :
      Name : line
Description: input ASCII line

      Name : datime
Description: output date/time string

      Name : delim
Description: field delimiter

Returns    : TRUE upon success, FALSE otherwise

This function will take the date and time in the WeatherLink report and pack them into a string in the form yyyymmddhhmm. WeatherLink uses the Windoze regional settings to determine the date and time format. My Windoze machine uses yy-mm-dd and hh:mm[a|p]. Upon success the packed date/time will be loaded into the output date/time string (which must already be allocated by the caller).

Goto Top | GPL Software Overview | GPL Library
Future Lab Home | Contact Webmaster | Feedback

Copyright © 2003-2006 Future Lab, Last Updated Jun 30, 2006