USRP Hardware Driver and USRP Manual  Version: 4.1.0.0-264-g3e5e4eb06
UHD and USRP Manual
string_vector.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Ettus Research
3  * Copyright 2018 Ettus Research, a National Instruments Company
4  *
5  * SPDX-License-Identifier: GPL-3.0-or-later
6  */
7 
8 #pragma once
9 
10 #include <uhd/config.h>
11 #include <uhd/error.h>
12 
13 #include <stdlib.h>
14 
15 #ifdef __cplusplus
16 #include <string>
17 #include <vector>
18 
19 struct uhd_string_vector_t {
20  std::vector<std::string> string_vector_cpp;
21  std::string last_error;
22 };
23 
24 extern "C" {
25 #else
26 struct uhd_string_vector_t;
28 #endif
29 
31 
33 
36  uhd_string_vector_handle *h
37 );
38 
41  uhd_string_vector_handle *h
42 );
43 
46  uhd_string_vector_handle *h,
47  const char* value
48 );
49 
52  uhd_string_vector_handle h,
53  size_t index,
54  char* value_out,
55  size_t strbuffer_len
56 );
57 
60  uhd_string_vector_handle h,
61  size_t *size_out
62 );
63 
66  uhd_string_vector_handle h,
67  char* error_out,
68  size_t strbuffer_len
69 );
70 
71 #ifdef __cplusplus
72 }
73 #endif
UHD_API uhd_error uhd_string_vector_push_back(uhd_string_vector_handle *h, const char *value)
Add a string to the list.
struct uhd_string_vector_t uhd_string_vector_t
Definition: string_vector.h:30
UHD_API uhd_error uhd_string_vector_size(uhd_string_vector_handle h, size_t *size_out)
Get the number of strings in this list.
uhd_error
UHD error codes.
Definition: error.h:20
UHD_API uhd_error uhd_string_vector_at(uhd_string_vector_handle h, size_t index, char *value_out, size_t strbuffer_len)
Get the string at the given index.
UHD_API uhd_error uhd_string_vector_last_error(uhd_string_vector_handle h, char *error_out, size_t strbuffer_len)
Get the last error reported by the underlying object.
UHD_API uhd_error uhd_string_vector_make(uhd_string_vector_handle *h)
Instantiate a string_vector handle.
uhd_string_vector_t * uhd_string_vector_handle
Definition: string_vector.h:32
#define UHD_API
Definition: config.h:70
UHD_API uhd_error uhd_string_vector_free(uhd_string_vector_handle *h)
Safely destroy a string_vector handle.