SoapySDR: Types.h Source File

| SoapySDR 0.7.2-ARCH Vendor and platform neutral SDR interface library

Types.h
Go to the documentation of this file.
1
11 #pragma once
12 #include <SoapySDR/Config.h>
13 #include <stddef.h> //size_t
14
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18
20 typedef struct
21 {
22 double minimum;
23 double maximum;
24 double step;
25 } SoapySDRRange;
26
28 typedef struct
29 {
30 size_t size;
31 char **keys;
32 char **vals;
33 } SoapySDRKwargs;
34
39 SOAPY_SDR_API SoapySDRKwargs SoapySDRKwargs_fromString(const char *markup);
40
45 SOAPY_SDR_API char *SoapySDRKwargs_toString(const SoapySDRKwargs *args);
46
48 typedef enum
49 {
50 SOAPY_SDR_ARG_INFO_BOOL,
51 SOAPY_SDR_ARG_INFO_INT,
52 SOAPY_SDR_ARG_INFO_FLOAT,
53 SOAPY_SDR_ARG_INFO_STRING
54 } SoapySDRArgInfoType;
55
57 typedef struct
58 {
60 char *key;
61
67 char *value;
68
70 char *name;
71
73 char *description;
74
76 char *units;
77
79 SoapySDRArgInfoType type;
80
86 SoapySDRRange range;
87
89 size_t numOptions;
90
95 char **options;
96
101 char **optionNames;
102
103 } SoapySDRArgInfo;
104
109 SOAPY_SDR_API void SoapySDRStrings_clear(char ***elems, const size_t length);
110
120 SOAPY_SDR_API int SoapySDRKwargs_set(SoapySDRKwargs *args, const char *key, const char *val);
121
126 SOAPY_SDR_API const char *SoapySDRKwargs_get(const SoapySDRKwargs *args, const char *key);
127
132 SOAPY_SDR_API void SoapySDRKwargs_clear(SoapySDRKwargs *args);
133
138 SOAPY_SDR_API void SoapySDRKwargsList_clear(SoapySDRKwargs *args, const size_t length);
139
144 SOAPY_SDR_API void SoapySDRArgInfo_clear(SoapySDRArgInfo *info);
145
150 SOAPY_SDR_API void SoapySDRArgInfoList_clear(SoapySDRArgInfo *info, const size_t length);
151
152 #ifdef __cplusplus
153 }
154 #endif
SOAPY_SDR_API
#define SOAPY_SDR_API
Definition: Config.h:41
SoapySDRKwargs_get
SOAPY_SDR_API const char * SoapySDRKwargs_get(const SoapySDRKwargs *args, const char *key)
SoapySDRStrings_clear
SOAPY_SDR_API void SoapySDRStrings_clear(char ***elems, const size_t length)
SoapySDRKwargsList_clear
SOAPY_SDR_API void SoapySDRKwargsList_clear(SoapySDRKwargs *args, const size_t length)
SoapySDRArgInfo::value
char * value
Definition: Types.h:67
SoapySDRKwargs_set
SOAPY_SDR_API int SoapySDRKwargs_set(SoapySDRKwargs *args, const char *key, const char *val)
SoapySDRArgInfo::options
char ** options
Definition: Types.h:95
SoapySDRArgInfo_clear
SOAPY_SDR_API void SoapySDRArgInfo_clear(SoapySDRArgInfo *info)
SoapySDRKwargs_toString
SOAPY_SDR_API char * SoapySDRKwargs_toString(const SoapySDRKwargs *args)
SoapySDRKwargs
Definition for a key/value string map.
Definition: Types.h:29
SoapySDRArgInfo::numOptions
size_t numOptions
The size of the options set, or 0 when not used.
Definition: Types.h:89
SoapySDRArgInfo::optionNames
char ** optionNames
Definition: Types.h:101
SoapySDRArgInfoType
SoapySDRArgInfoType
Possible data types for argument info.
Definition: Types.h:49
SOAPY_SDR_ARG_INFO_INT
@ SOAPY_SDR_ARG_INFO_INT
Definition: Types.h:51
SoapySDRArgInfo::type
SoapySDRArgInfoType type
The data type of the argument (required)
Definition: Types.h:79
SoapySDRKwargs_clear
SOAPY_SDR_API void SoapySDRKwargs_clear(SoapySDRKwargs *args)
SoapySDRArgInfo::name
char * name
The displayable name of the argument (optional, use key if empty)
Definition: Types.h:70
SoapySDRKwargs::vals
char ** vals
Definition: Types.h:32
SoapySDRArgInfoList_clear
SOAPY_SDR_API void SoapySDRArgInfoList_clear(SoapySDRArgInfo *info, const size_t length)
SoapySDRRange::step
double step
Definition: Types.h:24
SoapySDRRange
Definition for a min/max numeric range.
Definition: Types.h:21
SOAPY_SDR_ARG_INFO_STRING
@ SOAPY_SDR_ARG_INFO_STRING
Definition: Types.h:53
SoapySDRRange::minimum
double minimum
Definition: Types.h:22
SOAPY_SDR_ARG_INFO_BOOL
@ SOAPY_SDR_ARG_INFO_BOOL
Definition: Types.h:50
SoapySDRArgInfo::description
char * description
A brief description about the argument (optional)
Definition: Types.h:73
Config.h
SoapySDRKwargs_fromString
SOAPY_SDR_API SoapySDRKwargs SoapySDRKwargs_fromString(const char *markup)
SoapySDRArgInfo::units
char * units
The units of the argument: dB, Hz, etc (optional)
Definition: Types.h:76
SoapySDRArgInfo
Definition for argument info.
Definition: Types.h:58
SoapySDRArgInfo::key
char * key
The key used to identify the argument (required)
Definition: Types.h:60
SoapySDRKwargs::size
size_t size
Definition: Types.h:30
SoapySDRArgInfo::range
SoapySDRRange range
Definition: Types.h:86
SoapySDRRange::maximum
double maximum
Definition: Types.h:23
SOAPY_SDR_ARG_INFO_FLOAT
@ SOAPY_SDR_ARG_INFO_FLOAT
Definition: Types.h:52
SoapySDRKwargs::keys
char ** keys
Definition: Types.h:31