tqsllib.h File Reference
`#include "adif.h"`
`#include "cabrillo.h"`

Go to the source code of this file.

## Classes

struct | tQSL_Date
struct | tQSL_Time
struct | tqsl_provider_st
struct | tqsl_cert_req_st
struct | TQSL_QSO_RECORD

## Macros

#define | DLLEXPORT
| Symbol exports - Windows only.
#define | DLLEXPORTDATA
| Symbol exports - Windows only.
#define | CALLCONVENTION
| Symbol exports - Windows only.
#define | TQSL_MAX_PATH_LEN 256
| Max length of a FS path.
#define | TQSL_PASSWORD_MAX 80
| Max password length.
#define | TQSL_NAME_ELEMENT_MAX 256
| Max Org name length.
#define | TQSL_CALLSIGN_MAX 13
| Max callsign length.
#define | TQSL_CRQ_NAME_MAX 60
| Max length of request name.
#define | TQSL_CRQ_ADDR_MAX 80
| Max length of request addr.
#define | TQSL_CRQ_CITY_MAX 80
| Max length of request city.
#define | TQSL_CRQ_STATE_MAX 80
| Max length of request state.
#define | TQSL_CRQ_POSTAL_MAX 20
| Max length of request zip.
#define | TQSL_CRQ_COUNTRY_MAX 80
| Max length of req entity.
#define | TQSL_CRQ_EMAIL_MAX 180
| Max length of req email.
#define | TQSL_BAND_MAX 6
| Max length of a band name.
#define | TQSL_MODE_MAX 16
| Max length of a mode name.
#define | TQSL_FREQ_MAX 20
| Max length of a frequency.
#define | TQSL_SATNAME_MAX 20
| Max length of a sat name.
#define | TQSL_PROPMODE_MAX 20
| Max length of a prop mode.
#define | TQSL_CERT_CB_USER 0
| Callback is for user cert.
#define | TQSL_CERT_CB_CA 1
| Callback is for CA cert.
#define | TQSL_CERT_CB_ROOT 2
| Callback is for root cert.
#define | TQSL_CERT_CB_PKEY 3
| Callback is for private key.
#define | TQSL_CERT_CB_CONFIG 4
| Callback for config file.
#define | TQSL_CERT_CB_CERT_TYPE(x) ((x) & 0xf)
| Type of the cert.
#define | TQSL_CERT_CB_MILESTONE 0
| New certificate.
#define | TQSL_CERT_CB_RESULT 0x10
| Cert import result.
#define | TQSL_CERT_CB_CALL_TYPE(x) ((x) & TQSL_CERT_CB_RESULT)
| Callback type.
#define | TQSL_CERT_CB_PROMPT 0
| Callback prompt.
#define | TQSL_CERT_CB_DUPLICATE 0x100
| Dupe cert callback.
#define | TQSL_CERT_CB_ERROR 0x200
| Error import callback.
#define | TQSL_CERT_CB_LOADED 0x300
| Cert loaded callback.
#define | TQSL_CERT_CB_RESULT_TYPE(x) ((x) & 0x0f00)
| Result type mask.
#define | TQSL_SELECT_CERT_WITHKEYS 1
| Private keys only (no cert)
#define | TQSL_SELECT_CERT_EXPIRED 2
| Include expired certs.
#define | TQSL_SELECT_CERT_SUPERCEDED 4
| Include superseded certs.
#define | TQSL_PK_TYPE_ERR 0
| Error retrieving private key.
#define | TQSL_PK_TYPE_NONE 1
| No private key.
#define | TQSL_PK_TYPE_UNENC 2
| Private key is not encrypted.
#define | TQSL_PK_TYPE_ENC 3
| Private key is encrypted.
#define | TQSL_CERT_STATUS_UNK 0
| Status is unknown.
#define | TQSL_CERT_STATUS_SUP 1
| Certificate is superceded.
#define | TQSL_CERT_STATUS_EXP 2
| Certificate is expired.
#define | TQSL_CERT_STATUS_OK 3
| Certificate is valid.
#define | TQSL_CERT_STATUS_INV 4
| Invalid serial number.
#define | TQSL_LOCATION_FIELD_TEXT 1
| Text type input field.
#define | TQSL_LOCATION_FIELD_DDLIST 2
| Dropdown list input field.
#define | TQSL_LOCATION_FIELD_LIST 3
| List type input field.
#define | TQSL_LOCATION_FIELD_BADZONE 4
| Used to return zone selection errors.
#define | TQSL_LOCATION_FIELD_CHAR 1
| Character field.
#define | TQSL_LOCATION_FIELD_INT 2
| Integer field.
#define | TQSL_MAX_PW_LENGTH 32
| Password buffer length.

## Typedefs

typedef void * | tQSL_Cert
| Opaque certificate type.
typedef void * | tQSL_Location
| Opaque location type.
typedef char * | tQSL_StationDataEnc
| Opaque station data type.
typedef struct tqsl_provider_st | TQSL_PROVIDER
typedef struct tqsl_cert_req_st | TQSL_CERT_REQ

## Functions

DLLEXPORT int CALLCONVENTION | tqsl_init ()
DLLEXPORT int CALLCONVENTION | tqsl_setDirectory (const char *dir)
DLLEXPORT const char *CALLCONVENTION | tqsl_getErrorString ()
DLLEXPORT const char *CALLCONVENTION | tqsl_getErrorString_v (int err)
DLLEXPORT int CALLCONVENTION | tqsl_encodeBase64 (const unsigned char *data, int datalen, char *output, int outputlen)
DLLEXPORT int CALLCONVENTION | tqsl_decodeBase64 (const char *input, unsigned char *data, int *datalen)
DLLEXPORT int CALLCONVENTION | tqsl_initDate (tQSL_Date *date, const char *str)
DLLEXPORT int CALLCONVENTION | tqsl_initTime (tQSL_Time *time, const char *str)
DLLEXPORT int CALLCONVENTION | tqsl_compareDates (const tQSL_Date *a, const tQSL_Date *b)
DLLEXPORT int CALLCONVENTION | tqsl_subtractDates (const tQSL_Date *a, const tQSL_Date *b, int *diff)
DLLEXPORT char *CALLCONVENTION | tqsl_convertDateToText (const tQSL_Date *date, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_isDateValid (const tQSL_Date *d)
DLLEXPORT int CALLCONVENTION | tqsl_isDateNull (const tQSL_Date *d)
DLLEXPORT int CALLCONVENTION | tqsl_isTimeValid (const tQSL_Time *t)
DLLEXPORT char *CALLCONVENTION | tqsl_convertTimeToText (const tQSL_Time *time, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getVersion (int *major, int *minor)
DLLEXPORT int CALLCONVENTION | tqsl_getConfigVersion (int *major, int *minor)
DLLEXPORT int CALLCONVENTION | tqsl_selectCertificates (tQSL_Cert **certlist, int *ncerts, const char *callsign, int dxcc, const tQSL_Date *date, const TQSL_PROVIDER *issuer, int flag)
DLLEXPORT int CALLCONVENTION | tqsl_selectCACertificates (tQSL_Cert **certlist, int *ncerts, const char *type)
DLLEXPORT int CALLCONVENTION | tqsl_getSelectedCertificate (tQSL_Cert *cert, const tQSL_Cert **certlist, int idx)
DLLEXPORT int CALLCONVENTION | tqsl_isCertificateExpired (tQSL_Cert cert, int *status)
DLLEXPORT int CALLCONVENTION | tqsl_isCertificateSuperceded (tQSL_Cert cert, int *status)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateKeyOnly (tQSL_Cert cert, int *keyonly)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateEncoded (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getKeyEncoded (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_importKeyPairEncoded (const char *callsign, const char *type, const char *keybuf, const char *certbuf)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateSerial (tQSL_Cert cert, long *serial)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateSerialExt (tQSL_Cert cert, char *serial, int serialsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateSerialLength (tQSL_Cert cert)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateIssuer (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateIssuerOrganization (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateIssuerOrganizationalUnit (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateCallSign (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateAROName (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateEmailAddress (tQSL_Cert cert, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateQSONotBeforeDate (tQSL_Cert cert, tQSL_Date *date)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateQSONotAfterDate (tQSL_Cert cert, tQSL_Date *date)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateNotBeforeDate (tQSL_Cert cert, tQSL_Date *date)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateNotAfterDate (tQSL_Cert cert, tQSL_Date *date)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateDXCCEntity (tQSL_Cert cert, int *dxcc)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestAddress1 (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestAddress2 (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestCity (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestState (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestPostalCode (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateRequestCountry (tQSL_Cert cert, char *str, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificatePrivateKeyType (tQSL_Cert cert)
DLLEXPORT void CALLCONVENTION | tqsl_freeCertificate (tQSL_Cert cert)
DLLEXPORT int CALLCONVENTION | tqsl_getCertificateStatus (long serial)
DLLEXPORT int CALLCONVENTION | tqsl_setCertificateStatus (long serial, const char *status)
DLLEXPORT int CALLCONVENTION | tqsl_importTQSLFile (const char *file, int(*cb)(int type, const char *message, void *userdata), void *user)
DLLEXPORT int CALLCONVENTION | tqsl_getSerialFromTQSLFile (const char *file, long *serial)
DLLEXPORT int CALLCONVENTION | tqsl_getNumProviders (int *n)
DLLEXPORT int CALLCONVENTION | tqsl_getProvider (int idx, TQSL_PROVIDER *provider)
DLLEXPORT int CALLCONVENTION | tqsl_createCertRequest (const char *filename, TQSL_CERT_REQ *req, int(*pwcb)(char *pwbuf, int pwsize, void *userdata), void *user)
DLLEXPORT int CALLCONVENTION | tqsl_exportPKCS12File (tQSL_Cert cert, const char *filename, const char *p12password)
DLLEXPORT int CALLCONVENTION | tqsl_exportPKCS12Base64 (tQSL_Cert cert, char *base64, int b64len, const char *p12password)
DLLEXPORT int CALLCONVENTION | tqsl_importPKCS12File (const char *filename, const char *p12password, const char *password, int(*pwcb)(char *buf, int bufsiz, void *userdata), int(*cb)(int type, const char *message, void *userdata), void *user)
DLLEXPORT int CALLCONVENTION | tqsl_importPKCS12Base64 (const char *base64, const char *p12password, const char *password, int(*pwcb)(char *buf, int bufsiz, void *userdata), int(*cb)(int type, const char *message, void *userdata), void *user)
DLLEXPORT int CALLCONVENTION | tqsl_deleteCertificate (tQSL_Cert cert)
DLLEXPORT int CALLCONVENTION | tqsl_beginSigning (tQSL_Cert cert, char *password, int(*pwcb)(char *pwbuf, int pwsize, void *userdata), void *user)
DLLEXPORT int CALLCONVENTION | tqsl_checkSigningStatus (tQSL_Cert cert)
DLLEXPORT int CALLCONVENTION | tqsl_getMaxSignatureSize (tQSL_Cert cert, int *sigsize)
DLLEXPORT int CALLCONVENTION | tqsl_signDataBlock (tQSL_Cert cert, const unsigned char *data, int datalen, unsigned char *sig, int *siglen)
DLLEXPORT int CALLCONVENTION | tqsl_verifyDataBlock (tQSL_Cert cert, const unsigned char *data, int datalen, unsigned char *sig, int siglen)
DLLEXPORT int CALLCONVENTION | tqsl_signQSORecord (tQSL_Cert cert, tQSL_Location loc, TQSL_QSO_RECORD *rec, unsigned char *sig, int *siglen)
DLLEXPORT int CALLCONVENTION | tqsl_endSigning (tQSL_Cert cert)
DLLEXPORT int CALLCONVENTION | tqsl_initStationLocationCapture (tQSL_Location *locp)
DLLEXPORT int CALLCONVENTION | tqsl_endStationLocationCapture (tQSL_Location *locp)
DLLEXPORT int CALLCONVENTION | tqsl_updateStationLocationCapture (tQSL_Location loc)
DLLEXPORT int CALLCONVENTION | tqsl_getNumStationLocationCapturePages (tQSL_Location loc, int *npages)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationCapturePage (tQSL_Location loc, int *page)
DLLEXPORT int CALLCONVENTION | tqsl_setStationLocationCapturePage (tQSL_Location loc, int page)
DLLEXPORT int CALLCONVENTION | tqsl_setStationLocationCertFlags (tQSL_Location loc, int flags)
DLLEXPORT int CALLCONVENTION | tqsl_nextStationLocationCapture (tQSL_Location loc)
DLLEXPORT int CALLCONVENTION | tqsl_prevStationLocationCapture (tQSL_Location loc)
DLLEXPORT int CALLCONVENTION | tqsl_hasNextStationLocationCapture (tQSL_Location loc, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_hasPrevStationLocationCapture (tQSL_Location loc, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_saveStationLocationCapture (tQSL_Location loc, int overwrite)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationCaptureName (tQSL_Location loc, char *namebuf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_setStationLocationCaptureName (tQSL_Location loc, const char *name)
DLLEXPORT int CALLCONVENTION | tqsl_getNumStationLocations (tQSL_Location loc, int *nloc)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationName (tQSL_Location loc, int idx, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationCallSign (tQSL_Location loc, int idx, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationField (tQSL_Location locp, const char *name, char *namebuf, int bufsize)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocation (tQSL_Location *loc, const char *name)
DLLEXPORT int CALLCONVENTION | tqsl_getStationLocationErrors (tQSL_Location loc, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getStationDataEnc (tQSL_StationDataEnc *sdata)
DLLEXPORT int CALLCONVENTION | tqsl_freeStationDataEnc (tQSL_StationDataEnc sdata)
DLLEXPORT int CALLCONVENTION | tqsl_mergeStationLocations (const char *locdata)
DLLEXPORT int CALLCONVENTION | tqsl_deleteStationLocation (const char *name)
DLLEXPORT int CALLCONVENTION | tqsl_getNumLocationField (tQSL_Location loc, int *numf)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataLabelSize (tQSL_Location loc, int field_num, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataLabel (tQSL_Location loc, int field_num, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataGABBISize (tQSL_Location loc, int field_num, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataGABBI (tQSL_Location loc, int field_num, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldInputType (tQSL_Location loc, int field_num, int *type)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataType (tQSL_Location loc, int field_num, int *type)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldFlags (tQSL_Location loc, int field_num, int *flags)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldDataLength (tQSL_Location loc, int field_num, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldCharData (tQSL_Location loc, int field_num, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldIntData (tQSL_Location loc, int field_num, int *dat)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldIndex (tQSL_Location loc, int field_num, int *dat)
DLLEXPORT int CALLCONVENTION | tqsl_getNumLocationFieldListItems (tQSL_Location loc, int field_num, int *rval)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldListItem (tQSL_Location loc, int field_num, int item_idx, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_setLocationFieldCharData (tQSL_Location loc, int field_num, const char *buf)
DLLEXPORT int CALLCONVENTION | tqsl_setLocationFieldIntData (tQSL_Location loc, int field_num, int dat)
DLLEXPORT int CALLCONVENTION | tqsl_setLocationFieldIndex (tQSL_Location loc, int field_num, int dat)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationFieldChanged (tQSL_Location loc, int field_num, int *changed)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationCallSign (tQSL_Location loc, char *buf, int bufsiz)
DLLEXPORT int CALLCONVENTION | tqsl_getLocationDXCCEntity (tQSL_Location loc, int *dxcc)
DLLEXPORT int CALLCONVENTION | tqsl_getNumDXCCEntity (int *number)
DLLEXPORT int CALLCONVENTION | tqsl_getDXCCEntity (int index, int *number, const char **name)
DLLEXPORT int CALLCONVENTION | tqsl_getDXCCEntityName (int number, const char **name)
DLLEXPORT int CALLCONVENTION | tqsl_getDXCCZoneMap (int number, const char **zonemap)
DLLEXPORT int CALLCONVENTION | tqsl_getNumBand (int *number)
DLLEXPORT int CALLCONVENTION | tqsl_getBand (int index, const char **name, const char **spectrum, int *low, int *high)
DLLEXPORT int CALLCONVENTION | tqsl_getNumMode (int *number)
DLLEXPORT int CALLCONVENTION | tqsl_getMode (int index, const char **mode, const char **group)
DLLEXPORT int CALLCONVENTION | tqsl_getNumPropagationMode (int *number)
DLLEXPORT int CALLCONVENTION | tqsl_getPropagationMode (int index, const char **name, const char **descrip)
DLLEXPORT int CALLCONVENTION | tqsl_getNumSatellite (int *number)
DLLEXPORT int CALLCONVENTION | tqsl_getSatellite (int index, const char **name, const char **descrip, tQSL_Date *start, tQSL_Date *end)
DLLEXPORT int CALLCONVENTION | tqsl_clearCabrilloMap ()
DLLEXPORT int CALLCONVENTION | tqsl_setCabrilloMapEntry (const char *contest, int field, int contest_type)
DLLEXPORT int CALLCONVENTION | tqsl_getCabrilloMapEntry (const char *contest, int *fieldnum, int *contest_type)
DLLEXPORT int CALLCONVENTION | tqsl_clearADIFModes ()
DLLEXPORT int CALLCONVENTION | tqsl_setADIFMode (const char *adif_item, const char *mode)
DLLEXPORT int CALLCONVENTION | tqsl_getADIFMode (const char *adif_item, char *mode, int nmode)
DLLEXPORT const char *CALLCONVENTION | tqsl_getGABBItCERT (tQSL_Cert cert, int uid)
DLLEXPORT const char *CALLCONVENTION | tqsl_getGABBItSTATION (tQSL_Location loc, int uid, int certuid)
DLLEXPORT const char *CALLCONVENTION | tqsl_getGABBItCONTACT (tQSL_Cert cert, tQSL_Location loc, TQSL_QSO_RECORD *qso, int stationuid)
DLLEXPORT const char *CALLCONVENTION | tqsl_getGABBItCONTACTData (tQSL_Cert cert, tQSL_Location loc, TQSL_QSO_RECORD *qso, int stationuid, char *signdata, int sdlen)

## Variables

DLLEXPORTDATA const char * | tQSL_BaseDir
| Base directory for tQSL library working files.
DLLEXPORTDATA int | tQSL_Error
| Error code from most recent tQSL library call. More...
DLLEXPORTDATA TQSL_ADIF_GET_FIELD_ERROR | tQSL_ADIF_Error
| The ADIF error code.
DLLEXPORTDATA TQSL_CABRILLO_ERROR_TYPE | tQSL_Cabrillo_Error
| The ADIF error code.
DLLEXPORTDATA char | tQSL_ErrorFile [256]
| File name of file giving error. (May be empty.)
DLLEXPORTDATA char | tQSL_CustomError [256]
| Custom error message string.
DLLEXPORTDATA int | tQSL_Errno
| System errno - stored when tQSL_Error == TQSL_SYSTEM_ERROR.
DLLEXPORTDATA char | tQSL_ImportCall [256]
| Callsign used in import - used for missing public key error.

## Detailed Description

tQSL library functions.

## Typedef Documentation

typedef struct tqsl_cert_req_st TQSL_CERT_REQ

Certificate request data

typedef struct tqsl_provider_st TQSL_PROVIDER

Certificate provider data