USRP Hardware Driver and USRP Manual  Version: 003.009.004-0-g2b5a88bb
UHD and USRP Manual
string_vector.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015 Ettus Research
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #ifndef INCLUDED_UHD_TYPES_STRING_VECTOR_H
19 #define INCLUDED_UHD_TYPES_STRING_VECTOR_H
20 
21 #include <uhd/config.h>
22 #include <uhd/error.h>
23 
24 #include <stdlib.h>
25 
26 #ifdef __cplusplus
27 #include <string>
28 #include <vector>
29 
30 struct uhd_string_vector_t {
31  std::vector<std::string> string_vector_cpp;
32  std::string last_error;
33 };
34 
35 extern "C" {
36 #else
37 struct uhd_string_vector_t;
39 #endif
40 
42 
44 
47  uhd_string_vector_handle *h
48 );
49 
52  uhd_string_vector_handle *h
53 );
54 
57  uhd_string_vector_handle *h,
58  const char* value
59 );
60 
63  uhd_string_vector_handle h,
64  size_t index,
65  char* value_out,
66  size_t strbuffer_len
67 );
68 
71  uhd_string_vector_handle h,
72  size_t *size_out
73 );
74 
77  uhd_string_vector_handle h,
78  char* error_out,
79  size_t strbuffer_len
80 );
81 
82 #ifdef __cplusplus
83 }
84 #endif
85 
86 #endif /* INCLUDED_UHD_TYPES_STRING_VECTOR_H */
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:41
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:31
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:43
#define UHD_API
Definition: config.h:66
UHD_API uhd_error uhd_string_vector_free(uhd_string_vector_handle *h)
Safely destroy a string_vector handle.