USRP Hardware Driver and USRP Manual: string_vector.h Source File

| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
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
19struct uhd_string_vector_t
20{
21 std::vector<std::string> string_vector_cpp;
22 std::string last_error;
23};
24
25extern "C" {
26#else
28struct uhd_string_vector_t;
29#endif
30
31 typedef struct uhd_string_vector_t uhd_string_vector_t;
32
33 typedef uhd_string_vector_t* uhd_string_vector_handle;
34
36 UHD_API uhd_error uhd_string_vector_make(uhd_string_vector_handle* h);
37
39 UHD_API uhd_error uhd_string_vector_free(uhd_string_vector_handle* h);
40
42 UHD_API uhd_error uhd_string_vector_push_back(
43 uhd_string_vector_handle* h, const char* value);
44
46 UHD_API uhd_error uhd_string_vector_at(
47 uhd_string_vector_handle h, size_t index, char* value_out, size_t strbuffer_len);
48
50 UHD_API uhd_error uhd_string_vector_size(uhd_string_vector_handle h, size_t* size_out);
51
53 UHD_API uhd_error uhd_string_vector_last_error(
54 uhd_string_vector_handle h, char* error_out, size_t strbuffer_len);
55
56#ifdef __cplusplus
57}
58#endif
config.h
UHD_API
#define UHD_API
Definition config.h:87
error.h
uhd_error
uhd_error
UHD error codes.
Definition error.h:20
uhd_string_vector_at
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_string_vector_last_error
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_string_vector_make
UHD_API uhd_error uhd_string_vector_make(uhd_string_vector_handle *h)
Instantiate a string_vector handle.
uhd_string_vector_free
UHD_API uhd_error uhd_string_vector_free(uhd_string_vector_handle *h)
Safely destroy a string_vector handle.
uhd_string_vector_size
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_string_vector_push_back
UHD_API uhd_error uhd_string_vector_push_back(uhd_string_vector_handle *h, const char *value)
Add a string to the list.
uhd_string_vector_t
struct uhd_string_vector_t uhd_string_vector_t
Definition string_vector.h:31
uhd_string_vector_handle
uhd_string_vector_t * uhd_string_vector_handle
Definition string_vector.h:33