Main Page   Modules   Compound List   File List   File Members  

Utility API


Functions

int tqsl_init ()
int tqsl_setDirectory (const char *dir)
const char* tqsl_getErrorString ()
const char* tqsl_getErrorString_v (int err)
int tqsl_encodeBase64 (const unsigned char *data, int datalen, char *output, int outputlen)
int tqsl_decodeBase64 (const char *input, unsigned char *data, int *datalen)
int tqsl_initDate (tQSL_Date *date, const char *str)
int tqsl_initTime (tQSL_Time *time, const char *str)
int tqsl_compareDates (const tQSL_Date *a, const tQSL_Date *b)
char* tqsl_convertDateToText (const tQSL_Date *date, char *buf, int bufsiz)
int tqsl_isDateValid (const tQSL_Date *d)
int tqsl_isDateNull (const tQSL_Date *d)
int tqsl_isTimeValid (const tQSL_Time *t)
char* tqsl_convertTimeToText (const tQSL_Time *time, char *buf, int bufsiz)
int tqsl_getVersion (int *major, int *minor)
int tqsl_getConfigVersion (int *major, int *minor)

Variables

DLLEXPORT int tQSL_Error
 Error code from most recent tQSL library call. More...

DLLEXPORT TQSL_ADIF_GET_FIELD_ERROR tQSL_ADIF_Error
 The ADIF error code.

DLLEXPORT TQSL_CABRILLO_ERROR_TYPE tQSL_Cabrillo_Error
 The ADIF error code.

DLLEXPORT char tQSL_ErrorFile [256]
 File name of file giving error. (May be empty.).

DLLEXPORT char tQSL_CustomError [256]
 Custom error message string.


Function Documentation

int tqsl_compareDates ( const tQSL_Date * a,
const tQSL_Date * b )
 

Compare two tQSL_Date objects.

Returns:

  • -1 if a < b
  • 0 if a == b
  • 1 if a > b

char * tqsl_convertDateToText ( const tQSL_Date * date,
char * buf,
int bufsiz )
 

Converts a tQSL_Date object to a YYYY-MM-DD string.

Returns a pointer to buf or NULL on error

char * tqsl_convertTimeToText ( const tQSL_Time * time,
char * buf,
int bufsiz )
 

Converts a tQSL_Time object to a HH:MM:SSZ string.

Returns a pointer to buf or NULL on error

int tqsl_decodeBase64 ( const char * input,
unsigned char * data,
int * datalen )
 

Decode Base64 text into binary data.

  • input = NUL-terminated text string of Base64-encoded data
  • data = pointer to output buffer
  • datalen = pointer to int containing the size of the output buffer in bytes
Places the number of resulting data bytes into *datalen.

int tqsl_encodeBase64 ( const unsigned char * data,
int datalen,
char * output,
int outputlen )
 

Encode a block of data into Base64 text.

  • data = block of data to encode
  • datalen = length of data in bytes
  • output = pointer to output buffer
  • outputlen = size of output buffer in bytes

int tqsl_getConfigVersion ( int * major,
int * minor )
 

Returns the configuration-file version. major and/or minor may be NULL.

const char * tqsl_getErrorString ( )
 

Gets the error string for the current tQSL library error and resets the error status. See tqsl_getErrorString_v().

const char * tqsl_getErrorString_v ( int err )
 

Gets the error string corresponding to the given error number. The error string is available only until the next call to tqsl_getErrorString_v or tqsl_getErrorString.

int tqsl_getVersion ( int * major,
int * minor )
 

Returns the library version. major and/or minor may be NULL.

int tqsl_init ( )
 

Initialize the tQSL library

This function should be called prior to calling any other library functions.

int tqsl_initDate ( tQSL_Date * date,
const char * str )
 

Initialize a tQSL_Date object from a date string.

The date string must be YYYY-MM-DD or YYYYMMDD format.

Returns 0 on success, nonzero on failure

int tqsl_initTime ( tQSL_Time * time,
const char * str )
 

Initialize a tQSL_Time object from a time string.

The time string must be HH[:]MM[[:]SS] format.

Returns 0 on success, nonzero on failure

int tqsl_isDateNull ( const tQSL_Date * d )
 

Test whether a tQSL_Date is empty (contains all zeroes)

Returns 1 if the date is null

int tqsl_isDateValid ( const tQSL_Date * d )
 

Test whether a tQSL_Date contains a valid date value

Returns 1 if the date is valid

int tqsl_isTimeValid ( const tQSL_Time * t )
 

Test whether a tQSL_Time contains a valid time value

Returns 1 if the time is valid

int tqsl_setDirectory ( const char * dir )
 

Set the directory where the TQSL files are kept. May be called either before of after tqsl_init(), but should be called before calling any other functions in the library.

Note that this is purely optional. The library will figure out an approriate directory if tqsl_setDirectory isn't called. Unless there is some particular need to set the directory explicitly, programs should refrain from doing so.


Variable Documentation

DLLEXPORT int tQSL_Error
 

Error code from most recent tQSL library call.

The values for the error code are defined in tqslerrno.h


Generated at Sun Oct 12 10:02:48 2003 for TrustedQSL Library API by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001