| 1 |
#------------------------------------------------------------------------- |
| 2 |
# Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 |
# Licensed under the MIT License. See License.txt in the project root for |
| 4 |
# license information. |
| 5 |
#-------------------------------------------------------------------------- |
| 6 |
|
| 7 |
from libc cimport stdint |
| 8 |
|
| 9 |
cimport c_amqpvalue |
| 10 |
|
| 11 |
|
| 12 |
cdef extern from "azure_uamqp_c/amqp_definitions.h": |
| 13 |
|
| 14 |
ctypedef stdint.uint_fast32_t tickcounter_ms_t |
| 15 |
|
| 16 |
# role |
| 17 |
ctypedef bint role |
| 18 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_role(role value) |
| 19 |
cdef bint role_sender |
| 20 |
cdef bint role_receiver |
| 21 |
#cdef c_amqpvalue.amqpvalue_get_boolean amqpvalue_get_role |
| 22 |
|
| 23 |
# sender-settle-mode |
| 24 |
ctypedef stdint.uint8_t sender_settle_mode |
| 25 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_sender_settle_mode(sender_settle_mode value) |
| 26 |
cdef stdint.uint8_t sender_settle_mode_unsettled |
| 27 |
cdef stdint.uint8_t sender_settle_mode_settled |
| 28 |
cdef stdint.uint8_t sender_settle_mode_mixed |
| 29 |
#cdef amqpvalue_get_sender_settle_mode |
| 30 |
|
| 31 |
# receiver-settle-mode |
| 32 |
ctypedef stdint.uint8_t receiver_settle_mode |
| 33 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_receiver_settle_mode(receiver_settle_mode value) |
| 34 |
cdef int receiver_settle_mode_first |
| 35 |
cdef int receiver_settle_mode_second |
| 36 |
#cdef amqpvalue_get_receiver_settle_mode |
| 37 |
|
| 38 |
# handle |
| 39 |
ctypedef stdint.uint32_t handle |
| 40 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_handle(handle value) |
| 41 |
#cdef amqpvalue_get_handle |
| 42 |
# seconds |
| 43 |
ctypedef stdint.uint32_t seconds |
| 44 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_seconds(seconds value) |
| 45 |
#cdef amqpvalue_get_seconds |
| 46 |
|
| 47 |
# milliseconds |
| 48 |
ctypedef stdint.uint32_t milliseconds |
| 49 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_milliseconds(milliseconds value) |
| 50 |
#cdef amqpvalue_get_milliseconds |
| 51 |
|
| 52 |
# delivery-tag |
| 53 |
ctypedef c_amqpvalue.amqp_binary delivery_tag |
| 54 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_delivery_tag(delivery_tag value) |
| 55 |
#cdef amqpvalue_get_delivery_tag |
| 56 |
|
| 57 |
# sequence-no |
| 58 |
ctypedef stdint.uint32_t sequence_no |
| 59 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_sequence_no(sequence_no value) |
| 60 |
#cdef amqpvalue_get_sequence_no |
| 61 |
|
| 62 |
# delivery-number |
| 63 |
ctypedef sequence_no delivery_number |
| 64 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_delivery_number(delivery_number value) |
| 65 |
#cdef amqpvalue_get_delivery_number |
| 66 |
|
| 67 |
# transfer-number |
| 68 |
ctypedef sequence_no transfer_number |
| 69 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_transfer_number(transfer_number value) |
| 70 |
#cdef amqpvalue_get_transfer_number |
| 71 |
|
| 72 |
# message-format |
| 73 |
ctypedef stdint.uint32_t message_format |
| 74 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_format(message_format value) |
| 75 |
#cdef amqpvalue_get_message_format |
| 76 |
|
| 77 |
# ietf-language-tag |
| 78 |
ctypedef char* ietf_language_tag |
| 79 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_ietf_language_tag(ietf_language_tag value) |
| 80 |
#cdef amqpvalue_get_ietf_language_tag |
| 81 |
|
| 82 |
# fields |
| 83 |
ctypedef c_amqpvalue.AMQP_VALUE fields |
| 84 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_fields(c_amqpvalue.AMQP_VALUE value) |
| 85 |
#cdef fields_clone |
| 86 |
#cdef fields_destroy |
| 87 |
#cdef amqpvalue_get_fields |
| 88 |
|
| 89 |
# annotations |
| 90 |
ctypedef c_amqpvalue.AMQP_VALUE annotations |
| 91 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_annotations(c_amqpvalue.AMQP_VALUE value) |
| 92 |
# cdef amqpvalue_get_annotations c_amqpvalue.amqpvalue_get_map TODO |
| 93 |
|
| 94 |
|
| 95 |
# message-id-ulong |
| 96 |
ctypedef stdint.uint64_t message_id_ulong |
| 97 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_id_ulong(message_id_ulong value) |
| 98 |
#cdef amqpvalue_get_message_id_ulong |
| 99 |
|
| 100 |
|
| 101 |
# message-id-uuid |
| 102 |
ctypedef c_amqpvalue.uuid message_id_uuid |
| 103 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_id_uuid(message_id_uuid value) |
| 104 |
#cdef amqpvalue_get_message_id_uuid |
| 105 |
|
| 106 |
|
| 107 |
# message-id-binary |
| 108 |
ctypedef c_amqpvalue.amqp_binary message_id_binary |
| 109 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_id_binary(message_id_binary value) |
| 110 |
#cdef amqpvalue_get_message_id_binary |
| 111 |
|
| 112 |
|
| 113 |
# message-id-string |
| 114 |
ctypedef char* message_id_string |
| 115 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_id_string(message_id_string value) |
| 116 |
#cdef amqpvalue_get_message_id_string |
| 117 |
|
| 118 |
|
| 119 |
# address-string |
| 120 |
ctypedef char* address_string |
| 121 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_address_string(address_string value) |
| 122 |
#cdef amqpvalue_get_address_string |
| 123 |
|
| 124 |
# error |
| 125 |
ctypedef struct ERROR_HANDLE: |
| 126 |
pass |
| 127 |
|
| 128 |
ERROR_HANDLE error_create(const char* condition_value) |
| 129 |
ERROR_HANDLE error_clone(ERROR_HANDLE value) |
| 130 |
void error_destroy(ERROR_HANDLE error) |
| 131 |
int error_get_condition(ERROR_HANDLE error, const char** condition_value) |
| 132 |
int error_set_condition(ERROR_HANDLE error, const char* condition_value) |
| 133 |
int error_get_description(ERROR_HANDLE error, const char** description_value) |
| 134 |
int error_set_description(ERROR_HANDLE error, const char* description_value) |
| 135 |
int error_get_info(ERROR_HANDLE error, fields* info_value) |
| 136 |
int error_set_info(ERROR_HANDLE error, fields info_value) |
| 137 |
|
| 138 |
# header |
| 139 |
ctypedef struct HEADER_HANDLE: |
| 140 |
pass |
| 141 |
|
| 142 |
HEADER_HANDLE header_create() |
| 143 |
HEADER_HANDLE header_clone(HEADER_HANDLE value) |
| 144 |
void header_destroy(HEADER_HANDLE header) |
| 145 |
bint is_header_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 146 |
int amqpvalue_get_header(c_amqpvalue.AMQP_VALUE value, HEADER_HANDLE* HEADER_handle) |
| 147 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_header(HEADER_HANDLE header) |
| 148 |
int header_get_durable(HEADER_HANDLE header, bint* durable_value) |
| 149 |
int header_set_durable(HEADER_HANDLE header, bint durable_value) |
| 150 |
int header_get_priority(HEADER_HANDLE header, stdint.uint8_t* priority_value) |
| 151 |
int header_set_priority(HEADER_HANDLE header, stdint.uint8_t priority_value) |
| 152 |
int header_get_ttl(HEADER_HANDLE header, milliseconds* ttl_value) |
| 153 |
int header_set_ttl(HEADER_HANDLE header, milliseconds ttl_value) |
| 154 |
int header_get_first_acquirer(HEADER_HANDLE header, bint* first_acquirer_value) |
| 155 |
int header_set_first_acquirer(HEADER_HANDLE header, bint first_acquirer_value) |
| 156 |
int header_get_delivery_count(HEADER_HANDLE header, stdint.uint32_t* delivery_count_value) |
| 157 |
int header_set_delivery_count(HEADER_HANDLE header, stdint.uint32_t delivery_count_value) |
| 158 |
|
| 159 |
# delivery-annotations |
| 160 |
ctypedef annotations delivery_annotations |
| 161 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_delivery_annotations(delivery_annotations value) |
| 162 |
bint is_delivery_annotations_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 163 |
#cdef amqpvalue_get_delivery_annotations amqpvalue_get_annotations TODO |
| 164 |
|
| 165 |
# message-annotations |
| 166 |
ctypedef annotations message_annotations |
| 167 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_message_annotations(message_annotations value) |
| 168 |
bint is_message_annotations_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 169 |
#cdef amqpvalue_get_message_annotations amqpvalue_get_annotations TODO |
| 170 |
|
| 171 |
# application-properties |
| 172 |
ctypedef c_amqpvalue.AMQP_VALUE application_properties |
| 173 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_application_properties(c_amqpvalue.AMQP_VALUE value) |
| 174 |
#cdef application_properties_clone |
| 175 |
#cdef application_properties_destroy |
| 176 |
bint is_application_properties_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 177 |
#cdef amqpvalue_get_application_properties |
| 178 |
|
| 179 |
# data |
| 180 |
ctypedef c_amqpvalue.amqp_binary data |
| 181 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_data(data value) |
| 182 |
bint is_data_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 183 |
#cdef amqpvalue_get_data |
| 184 |
|
| 185 |
# amqp-sequence |
| 186 |
ctypedef c_amqpvalue.AMQP_VALUE amqp_sequence |
| 187 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_amqp_sequence(c_amqpvalue.AMQP_VALUE value) |
| 188 |
#cdef amqp_sequence_clone |
| 189 |
#cdef amqp_sequence_destroy |
| 190 |
bint is_amqp_sequence_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 191 |
#cdef amqpvalue_get_amqp_sequence |
| 192 |
|
| 193 |
# amqp-value |
| 194 |
ctypedef c_amqpvalue.AMQP_VALUE amqp_value |
| 195 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_amqp_value(c_amqpvalue.AMQP_VALUE value) |
| 196 |
#cdef amqp_value_clone |
| 197 |
#cdef amqp_value_destroy |
| 198 |
bint is_amqp_value_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 199 |
#cdef amqpvalue_get_amqp_value |
| 200 |
|
| 201 |
# footer |
| 202 |
ctypedef annotations footer |
| 203 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_footer(footer value) |
| 204 |
bint is_footer_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 205 |
#cdef amqpvalue_get_footer |
| 206 |
|
| 207 |
# properties |
| 208 |
ctypedef struct PROPERTIES_HANDLE: |
| 209 |
pass |
| 210 |
PROPERTIES_HANDLE properties_create() |
| 211 |
PROPERTIES_HANDLE properties_clone(PROPERTIES_HANDLE value) |
| 212 |
void properties_destroy(PROPERTIES_HANDLE properties) |
| 213 |
bint is_properties_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 214 |
int amqpvalue_get_properties(c_amqpvalue.AMQP_VALUE value, PROPERTIES_HANDLE* PROPERTIES_handle) |
| 215 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_properties(PROPERTIES_HANDLE properties) |
| 216 |
int properties_get_message_id(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE* message_id_value) |
| 217 |
int properties_set_message_id(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE message_id_value) |
| 218 |
int properties_get_user_id(PROPERTIES_HANDLE properties, c_amqpvalue.amqp_binary* user_id_value) |
| 219 |
int properties_set_user_id(PROPERTIES_HANDLE properties, c_amqpvalue.amqp_binary user_id_value) |
| 220 |
int properties_get_to(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE* to_value) |
| 221 |
int properties_set_to(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE to_value) |
| 222 |
int properties_get_subject(PROPERTIES_HANDLE properties, char** subject_value) |
| 223 |
int properties_set_subject(PROPERTIES_HANDLE properties, char* subject_value) |
| 224 |
int properties_get_reply_to(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE* reply_to_value) |
| 225 |
int properties_set_reply_to(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE reply_to_value) |
| 226 |
int properties_get_correlation_id(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE* correlation_id_value) |
| 227 |
int properties_set_correlation_id(PROPERTIES_HANDLE properties, c_amqpvalue.AMQP_VALUE correlation_id_value) |
| 228 |
int properties_get_content_type(PROPERTIES_HANDLE properties, char** content_type_value) |
| 229 |
int properties_set_content_type(PROPERTIES_HANDLE properties, char* content_type_value) |
| 230 |
int properties_get_content_encoding(PROPERTIES_HANDLE properties, char** content_encoding_value) |
| 231 |
int properties_set_content_encoding(PROPERTIES_HANDLE properties, char* content_encoding_value) |
| 232 |
int properties_get_absolute_expiry_time(PROPERTIES_HANDLE properties, c_amqpvalue.timestamp* absolute_expiry_time_value) |
| 233 |
int properties_set_absolute_expiry_time(PROPERTIES_HANDLE properties, c_amqpvalue.timestamp absolute_expiry_time_value) |
| 234 |
int properties_get_creation_time(PROPERTIES_HANDLE properties, c_amqpvalue.timestamp* creation_time_value) |
| 235 |
int properties_set_creation_time(PROPERTIES_HANDLE properties, c_amqpvalue.timestamp creation_time_value) |
| 236 |
int properties_get_group_id(PROPERTIES_HANDLE properties, char** group_id_value) |
| 237 |
int properties_set_group_id(PROPERTIES_HANDLE properties, char* group_id_value) |
| 238 |
int properties_get_group_sequence(PROPERTIES_HANDLE properties, sequence_no* group_sequence_value) |
| 239 |
int properties_set_group_sequence(PROPERTIES_HANDLE properties, sequence_no group_sequence_value) |
| 240 |
int properties_get_reply_to_group_id(PROPERTIES_HANDLE properties, char** reply_to_group_id_value) |
| 241 |
int properties_set_reply_to_group_id(PROPERTIES_HANDLE properties, char* reply_to_group_id_value) |
| 242 |
|
| 243 |
|
| 244 |
# source/target types |
| 245 |
ctypedef stdint.uint32_t terminus_durability |
| 246 |
cdef stdint.uint32_t terminus_durability_none |
| 247 |
cdef stdint.uint32_t terminus_durability_configuration |
| 248 |
cdef stdint.uint32_t terminus_durability_unsettled_state |
| 249 |
|
| 250 |
ctypedef const char* terminus_expiry_policy |
| 251 |
cdef const char* terminus_expiry_policy_link_detach |
| 252 |
cdef const char* terminus_expiry_policy_session_end |
| 253 |
cdef const char* terminus_expiry_policy_connection_close |
| 254 |
cdef const char* terminus_expiry_policy_never |
| 255 |
|
| 256 |
ctypedef fields node_properties |
| 257 |
ctypedef c_amqpvalue.AMQP_VALUE filter_set # Map |
| 258 |
|
| 259 |
# source |
| 260 |
ctypedef struct SOURCE_HANDLE: |
| 261 |
pass |
| 262 |
|
| 263 |
SOURCE_HANDLE source_create() |
| 264 |
SOURCE_HANDLE source_clone(SOURCE_HANDLE value) |
| 265 |
void source_destroy(SOURCE_HANDLE source) |
| 266 |
bint is_source_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 267 |
int amqpvalue_get_source(c_amqpvalue.AMQP_VALUE value, SOURCE_HANDLE* SOURCE_handle) |
| 268 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_source(SOURCE_HANDLE source) |
| 269 |
|
| 270 |
int source_get_address(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE* address_value) |
| 271 |
int source_set_address(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE address_value) |
| 272 |
int source_get_durable(SOURCE_HANDLE source, terminus_durability* durable_value) |
| 273 |
int source_set_durable(SOURCE_HANDLE source, terminus_durability durable_value) |
| 274 |
int source_get_expiry_policy(SOURCE_HANDLE source, terminus_expiry_policy* expiry_policy_value) |
| 275 |
int source_set_expiry_policy(SOURCE_HANDLE source, terminus_expiry_policy expiry_policy_value) |
| 276 |
int source_get_timeout(SOURCE_HANDLE source, seconds* timeout_value) |
| 277 |
int source_set_timeout(SOURCE_HANDLE source, seconds timeout_value) |
| 278 |
int source_get_dynamic(SOURCE_HANDLE source, bint* dynamic_value) |
| 279 |
int source_set_dynamic(SOURCE_HANDLE source, bint dynamic_value) |
| 280 |
int source_get_dynamic_node_properties(SOURCE_HANDLE source, node_properties* dynamic_node_properties_value) |
| 281 |
int source_set_dynamic_node_properties(SOURCE_HANDLE source, node_properties dynamic_node_properties_value) |
| 282 |
int source_get_distribution_mode(SOURCE_HANDLE source, const char** distribution_mode_value) |
| 283 |
int source_set_distribution_mode(SOURCE_HANDLE source, const char* distribution_mode_value) |
| 284 |
int source_get_filter(SOURCE_HANDLE source, filter_set* filter_value) |
| 285 |
int source_set_filter(SOURCE_HANDLE source, filter_set filter_value) |
| 286 |
#int source_get_default_outcome(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE* default_outcome_value) |
| 287 |
#int source_set_default_outcome(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE default_outcome_value) |
| 288 |
#int source_get_outcomes(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE* outcomes_value) |
| 289 |
#int source_set_outcomes(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE outcomes_value) |
| 290 |
#int source_get_capabilities(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE* capabilities_value) |
| 291 |
#int source_set_capabilities(SOURCE_HANDLE source, c_amqpvalue.AMQP_VALUE capabilities_value) |
| 292 |
|
| 293 |
# target |
| 294 |
ctypedef struct TARGET_HANDLE: |
| 295 |
pass |
| 296 |
|
| 297 |
TARGET_HANDLE target_create() |
| 298 |
TARGET_HANDLE target_clone(TARGET_HANDLE value) |
| 299 |
void target_destroy(TARGET_HANDLE target) |
| 300 |
bint is_target_type_by_descriptor(c_amqpvalue.AMQP_VALUE descriptor) |
| 301 |
int amqpvalue_get_target(c_amqpvalue.AMQP_VALUE value, TARGET_HANDLE* TARGET_handle) |
| 302 |
c_amqpvalue.AMQP_VALUE amqpvalue_create_target(TARGET_HANDLE target) |
| 303 |
|
| 304 |
int target_get_address(TARGET_HANDLE target, c_amqpvalue.AMQP_VALUE* address_value) |
| 305 |
int target_set_address(TARGET_HANDLE target, c_amqpvalue.AMQP_VALUE address_value) |
| 306 |
int target_get_durable(TARGET_HANDLE target, terminus_durability* durable_value) |
| 307 |
int target_set_durable(TARGET_HANDLE target, terminus_durability durable_value) |
| 308 |
int target_get_expiry_policy(TARGET_HANDLE target, terminus_expiry_policy* expiry_policy_value) |
| 309 |
int target_set_expiry_policy(TARGET_HANDLE target, terminus_expiry_policy expiry_policy_value) |
| 310 |
int target_get_timeout(TARGET_HANDLE target, seconds* timeout_value) |
| 311 |
int target_set_timeout(TARGET_HANDLE target, seconds timeout_value) |
| 312 |
int target_get_dynamic(TARGET_HANDLE target, bint* dynamic_value) |
| 313 |
int target_set_dynamic(TARGET_HANDLE target, bint dynamic_value) |
| 314 |
int target_get_dynamic_node_properties(TARGET_HANDLE target, node_properties* dynamic_node_properties_value) |
| 315 |
int target_set_dynamic_node_properties(TARGET_HANDLE target, node_properties dynamic_node_properties_value) |
| 316 |
#int target_get_capabilities(TARGET_HANDLE target, c_amqpvalue.AMQP_VALUE* capabilities_value) |
| 317 |
#int target_set_capabilities(TARGET_HANDLE target, c_amqpvalue.AMQP_VALUE capabilities_value) |