Files
@ 0021301bc812
Branch filter:
Location: CSY/reowolf/huang
0021301bc812
3.6 KiB
text/plain
tearing down correctly now
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 | /* CBindgen generated */
#ifndef REOWOLF_HEADER_DEFINED
#define REOWOLF_HEADER_DEFINED
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct Connector Connector;
typedef uint32_t ControllerId;
/**
* Provides a binding annotation for the port with the given index with "active":
* (The port will conenct to a "passive" port at the given address during connect())
* Returns:
* - 0 for success
* - 1 if the port was already bound and was left unchanged
* # Safety
* TODO
*/
int connector_bind_active(Connector *connector, unsigned int proto_port_index, const char *address);
/**
* Provides a binding annotation for the port with the given index with "native":
* (The port is exposed for reading and writing from the application)
* Returns:
* # Safety
* TODO
*/
int connector_bind_native(Connector *connector, uintptr_t proto_port_index);
/**
* Provides a binding annotation for the port with the given index with "native":
* (The port is exposed for reading and writing from the application)
* Returns:
* # Safety
* TODO
*/
int connector_bind_passive(Connector *connector,
unsigned int proto_port_index,
const char *address);
/**
* Configures the given Reowolf connector with a protocol description in PDL.
* Returns:
* # Safety
* TODO
*/
int connector_configure(Connector *connector, char *pdl, char *main);
/**
* Provides a binding annotation for the port with the given index with "active":
* (The port will conenct to a "passive" port at the given address during connect())
* Returns:
* - 0 SUCCESS: connected successfully
* - TODO error codes
* # Safety
* TODO
*/
int connector_connect(Connector *connector, uint64_t timeout_millis);
/**
* Destroys the given connector, freeing its underlying resources.
* # Safety
* TODO
*/
void connector_destroy(Connector *connector);
/**
* Resets the error message buffer.
* Returns:
* - 0 if an error was cleared
* - 1 if there was no error to clear
* # Safety
* TODO
*/
int connector_error_clear(void);
/**
* Returns a pointer into the error buffer for reading as a null-terminated string
* Returns null if there is no error in the buffer.
* # Safety
* TODO
*/
const char *connector_error_peek(void);
/**
* Prepares to synchronously put a message at the given port, writing it to the given buffer.
* - 0 SUCCESS
* - 1 this port has the wrong direction
* - 2 this port is already marked to get
* # Safety
* TODO
*/
int connector_get(Connector *connector, unsigned int proto_port_index);
/**
* # Safety
* TODO
*/
int connector_gotten(Connector *connector,
unsigned int proto_port_index,
const unsigned char **buf_ptr_outptr,
unsigned int *len_outptr);
/**
* Creates and returns Reowolf Connector structure allocated on the heap.
*/
Connector *connector_new(void);
/**
* # Safety
* TODO
*/
int connector_next_batch(Connector *connector);
/**
* Prepares to synchronously put a message at the given port, reading it from the given buffer.
* # Safety
* TODO
*/
int connector_put(Connector *connector,
unsigned int proto_port_index,
unsigned char *buf_ptr,
unsigned int msg_len);
/**
* # Safety
* TODO
*/
int connector_sync(Connector *connector, uint64_t timeout_millis);
/**
* Creates and returns Reowolf Connector structure allocated on the heap.
*/
Connector *connector_with_controller_id(ControllerId controller_id);
/**
* # Safety
* TODO
*/
int port_close(Connector *connector, unsigned int _proto_port_index);
#endif /* REOWOLF_HEADER_DEFINED */
|