Debian Codegraph @

source/mqtt5_client.h

raw symbols SCIP
1 #ifndef AWS_CRT_PYTHON_MQTT5_CLIENT_H
2 #define AWS_CRT_PYTHON_MQTT5_CLIENT_H
3 /**
4 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
5 * SPDX-License-Identifier: Apache-2.0.
6 */
7
8 #include "module.h"
9
10 #include <aws/mqtt/mqtt.h>
11
12 /**
13 * Parse a Python AWSIoTMetrics object into a C aws_mqtt_iot_metrics struct.
14 *
15 * WARNING: This function calls AWS_ZERO_STRUCT on out_metrics, which
16 * unconditionally zeroes all fields. The caller must pass a pointer to an
17 * uninitialized (or already cleaned-up) struct. If out_metrics currently owns
18 * heap-allocated memory (e.g. a previous metadata_entries array), that memory
19 * will be leaked because the pointer is overwritten without being freed.
20 *
21 * On success the caller is responsible for calling aws_py_metrics_clean_up()
22 * to release any memory allocated here (metadata_entries).
23 *
24 */
25 bool aws_py_metrics_parse(PyObject *metrics_py, struct aws_mqtt_iot_metrics *out_metrics);
26
27 /**
28 * Clean up resources allocated by aws_py_metrics_parse().
29 */
30 void aws_py_metrics_clean_up(struct aws_mqtt_iot_metrics *metrics);
31
32 PyObject *aws_py_mqtt5_client_new(PyObject *self, PyObject *args);
33 PyObject *aws_py_mqtt5_client_start(PyObject *self, PyObject *args);
34 PyObject *aws_py_mqtt5_client_stop(PyObject *self, PyObject *args);
35 PyObject *aws_py_mqtt5_client_publish(PyObject *self, PyObject *args);
36 PyObject *aws_py_mqtt5_client_subscribe(PyObject *self, PyObject *args);
37 PyObject *aws_py_mqtt5_client_unsubscribe(PyObject *self, PyObject *args);
38 PyObject *aws_py_mqtt5_client_get_stats(PyObject *self, PyObject *args);
39 PyObject *aws_py_mqtt5_client_invoke_publish_acknowledgement(PyObject *self, PyObject *args);
40
41 PyObject *aws_py_mqtt5_ws_handshake_transform_complete(PyObject *self, PyObject *args);
42
43 /* Given a python object, return a pointer to its underlying native type.
44 * If NULL is returned, a python error has been set */
45 struct aws_mqtt5_client *aws_py_get_mqtt5_client(PyObject *mqtt5_client);
46
47 #endif /* AWS_CRT_PYTHON_MQTT5_CLIENT_H */