TrustedQSL Library API
adif.h
Go to the documentation of this file.
1 /***************************************************************************
2  adif.h - description
3  -------------------
4  begin : Wed May 15 2002
5  copyright : (C) 2002 by ARRL
6  email : MSimcik@localhost.localdomain
7  revision : $Id$
8  ***************************************************************************/
9 
10 #ifndef __ADIF_H
11 #define __ADIF_H
12 
13 #include "tqsllib.h"
14 
15 #include <stdio.h>
16 #include <stdlib.h>
17 
28 #define TQSL_ADIF_FIELD_NAME_LENGTH_MAX 64
29 #define TQSL_ADIF_FIELD_SIZE_LENGTH_MAX 10
30 #define TQSL_ADIF_FIELD_TYPE_LENGTH_MAX 1
31 
32 
35 #ifndef TQSL_ADIF_BOOLEAN
36 typedef enum {
37  TQSL_FALSE,
38  TQSL_TRUE
40 #endif
41 
42 typedef void * tQSL_ADIF;
43 
45 typedef enum {
46  TQSL_ADIF_RANGE_TYPE_NONE,
47  TQSL_ADIF_RANGE_TYPE_MINMAX,
48  TQSL_ADIF_RANGE_TYPE_ENUMERATION
50 
52 typedef enum {
53  TQSL_ADIF_GET_FIELD_SUCCESS,
54  TQSL_ADIF_GET_FIELD_NO_NAME_MATCH,
55  TQSL_ADIF_GET_FIELD_NO_TYPE_MATCH,
56  TQSL_ADIF_GET_FIELD_NO_RANGE_MATCH,
57  TQSL_ADIF_GET_FIELD_NO_ENUMERATION_MATCH,
58  TQSL_ADIF_GET_FIELD_NO_RESULT_ALLOCATION,
59  TQSL_ADIF_GET_FIELD_NAME_LENGTH_OVERFLOW,
60  TQSL_ADIF_GET_FIELD_DATA_LENGTH_OVERFLOW,
61  TQSL_ADIF_GET_FIELD_SIZE_OVERFLOW,
62  TQSL_ADIF_GET_FIELD_TYPE_OVERFLOW,
63  TQSL_ADIF_GET_FIELD_ERRONEOUS_STATE,
64  TQSL_ADIF_GET_FIELD_EOF
66 
68 typedef struct {
72  unsigned int max_length;
73  long signed min_value;
74  long signed max_value;
75  const char **enumStrings;
76  void *userPointer;
78 
80 typedef struct {
84  unsigned char *data;
85  unsigned int adifNameIndex;
86  void *userPointer;
88 
89 
90 /* function prototypes */
91 
92 #ifdef __cplusplus
93 extern "C" {
94 #endif
95 
98 
100 DLLEXPORT int CALLCONVENTION tqsl_beginADIF(tQSL_ADIF *adifp, const char *filename);
101 
119  const tqsl_adifFieldDefinitions *adifFields, const char * const *typesDefined,
120  unsigned char *(*allocator)(size_t) );
121 
123 DLLEXPORT int CALLCONVENTION tqsl_getADIFLine(tQSL_ADIF adif, int *lineno);
124 
127 
133 DLLEXPORT int CALLCONVENTION tqsl_adifMakeField(const char *fieldname, char type, const unsigned char *value, int len,
134  unsigned char *buf, int buflen);
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
142 #endif /* __ADIF_H */
const char ** enumStrings
Enumerated values.
Definition: adif.h:75
void * tQSL_ADIF
Opaque ADIF type.
Definition: adif.h:42
TQSL_ADIF_BOOLEAN
Definition: adif.h:36
DLLEXPORT int CALLCONVENTION tqsl_beginADIF(tQSL_ADIF *adifp, const char *filename)
unsigned int adifNameIndex
Name index.
Definition: adif.h:85
long signed max_value
Max value.
Definition: adif.h:74
DLLEXPORT int CALLCONVENTION tqsl_getADIFLine(tQSL_ADIF adif, int *lineno)
Definition: adif.h:80
unsigned int max_length
Max length.
Definition: adif.h:72
#define TQSL_ADIF_FIELD_TYPE_LENGTH_MAX
Max length of field type.
Definition: adif.h:30
TQSL_ADIF_GET_FIELD_ERROR
Response values returned from tqsl_getADIFField()
Definition: adif.h:52
void * userPointer
User pointer.
Definition: adif.h:86
void * userPointer
user poitner
Definition: adif.h:76
DLLEXPORT int CALLCONVENTION tqsl_endADIF(tQSL_ADIF *adifp)
DLLEXPORT const char *CALLCONVENTION tqsl_adifGetError(TQSL_ADIF_GET_FIELD_ERROR status)
DLLEXPORT int CALLCONVENTION tqsl_getADIFField(tQSL_ADIF adif, tqsl_adifFieldResults *field, TQSL_ADIF_GET_FIELD_ERROR *status, const tqsl_adifFieldDefinitions *adifFields, const char *const *typesDefined, unsigned char *(*allocator)(size_t))
TQSL_ADIF_RANGE_TYPE rangeType
Range type.
Definition: adif.h:71
#define CALLCONVENTION
Symbol exports - Windows only.
Definition: tqsllib.h:27
#define TQSL_ADIF_FIELD_NAME_LENGTH_MAX
Max length of ADIF field.
Definition: adif.h:28
DLLEXPORT int CALLCONVENTION tqsl_adifMakeField(const char *fieldname, char type, const unsigned char *value, int len, unsigned char *buf, int buflen)
#define TQSL_ADIF_FIELD_SIZE_LENGTH_MAX
Max length of field name.
Definition: adif.h:29
long signed min_value
Min value.
Definition: adif.h:73
Definition: adif.h:68
#define DLLEXPORT
Symbol exports - Windows only.
Definition: tqsllib.h:25
TQSL_ADIF_RANGE_TYPE
Specifies the type of range limits to apply to a field.
Definition: adif.h:45
unsigned char * data
data
Definition: adif.h:84