You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2022/06/08 20:36:48 UTC

[qpid-proton] 07/08: PROTON-2559: Rearrange using object.h

This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit 4641f1c3490496e8d81edaffc94c5417745adcb8
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Fri Apr 8 18:10:15 2022 -0400

    PROTON-2559: Rearrange using object.h
    
    This is in preparation for removing the pn_object_t pn_class_t internals
    from the public API of proton.
---
 c/examples/broker.c                   |  1 +
 c/examples/direct.c                   |  1 +
 c/examples/receive.c                  |  1 +
 c/include/proton/codec.h              |  1 -
 c/include/proton/event.h              |  2 +-
 c/include/proton/link.h               |  1 -
 c/include/proton/logger.h             |  1 -
 c/include/proton/object.h             |  3 ---
 c/include/proton/reactor.h            |  1 +
 c/include/proton/selectable.h         |  1 -
 c/include/proton/session.h            |  1 -
 c/include/proton/types.h              | 15 +++++++++++++++
 c/src/core/decoder.c                  |  1 -
 c/src/core/encoder.c                  |  1 -
 c/src/core/error.c                    |  1 -
 c/src/messenger/subscription.h        |  1 +
 c/src/reactor/io/windows/iocp.c       |  1 -
 c/src/reactor/io/windows/iocp.h       |  1 +
 c/src/reactor/selectable.c            |  1 +
 c/src/reactor/selectable.h            |  1 +
 c/tests/fuzz/fuzz-connection-driver.c |  1 +
 c/tests/pn_test.hpp                   |  2 ++
 cpp/src/contexts.hpp                  |  2 ++
 cpp/src/object_test.cpp               |  2 ++
 24 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/c/examples/broker.c b/c/examples/broker.c
index fd6aba2ab..b2843d3c6 100644
--- a/c/examples/broker.c
+++ b/c/examples/broker.c
@@ -22,6 +22,7 @@
 #include <proton/engine.h>
 #include <proton/listener.h>
 #include <proton/netaddr.h>
+#include <proton/object.h>
 #include <proton/proactor.h>
 #include <proton/sasl.h>
 #include <proton/ssl.h>
diff --git a/c/examples/direct.c b/c/examples/direct.c
index 977b85c8d..0cbda0998 100644
--- a/c/examples/direct.c
+++ b/c/examples/direct.c
@@ -26,6 +26,7 @@
 #include <proton/listener.h>
 #include <proton/netaddr.h>
 #include <proton/message.h>
+#include <proton/object.h>
 #include <proton/proactor.h>
 #include <proton/sasl.h>
 #include <proton/session.h>
diff --git a/c/examples/receive.c b/c/examples/receive.c
index c6f31f433..8e83a999e 100644
--- a/c/examples/receive.c
+++ b/c/examples/receive.c
@@ -24,6 +24,7 @@
 #include <proton/delivery.h>
 #include <proton/link.h>
 #include <proton/message.h>
+#include <proton/object.h>
 #include <proton/proactor.h>
 #include <proton/session.h>
 #include <proton/transport.h>
diff --git a/c/include/proton/codec.h b/c/include/proton/codec.h
index 5cd54ad5f..6a2fb0945 100644
--- a/c/include/proton/codec.h
+++ b/c/include/proton/codec.h
@@ -23,7 +23,6 @@
  */
 
 #include <proton/import_export.h>
-#include <proton/object.h>
 #include <proton/types.h>
 #include <proton/error.h>
 #include <proton/type_compat.h>
diff --git a/c/include/proton/event.h b/c/include/proton/event.h
index 048a60eea..a506e8d72 100644
--- a/c/include/proton/event.h
+++ b/c/include/proton/event.h
@@ -23,8 +23,8 @@
  */
 
 #include <proton/import_export.h>
+#include <proton/types.h>
 #include <proton/type_compat.h>
-#include <proton/object.h>
 #include <stddef.h>
 
 #ifdef __cplusplus
diff --git a/c/include/proton/link.h b/c/include/proton/link.h
index 014397643..9a17a4aa7 100644
--- a/c/include/proton/link.h
+++ b/c/include/proton/link.h
@@ -27,7 +27,6 @@
 #include <proton/condition.h>
 #include <proton/terminus.h>
 #include <proton/types.h>
-#include <proton/object.h>
 #include <stddef.h>
 
 #ifdef __cplusplus
diff --git a/c/include/proton/logger.h b/c/include/proton/logger.h
index cfc670642..f5ce9147c 100644
--- a/c/include/proton/logger.h
+++ b/c/include/proton/logger.h
@@ -29,7 +29,6 @@
  */
 
 #include <proton/import_export.h>
-#include <proton/object.h>
 
 #include <stdarg.h>
 #include <stdint.h>
diff --git a/c/include/proton/object.h b/c/include/proton/object.h
index 11f039624..771c692c3 100644
--- a/c/include/proton/object.h
+++ b/c/include/proton/object.h
@@ -37,17 +37,14 @@ extern "C" {
  * @cond INTERNAL
  */
 
-typedef const void* pn_handle_t;
 typedef intptr_t pn_shandle_t;
 
-typedef struct pn_class_t pn_class_t;
 typedef struct pn_string_t pn_string_t;
 typedef struct pn_list_t pn_list_t;
 typedef struct pn_map_t pn_map_t;
 typedef struct pn_hash_t pn_hash_t;
 typedef void *(*pn_iterator_next_t)(void *state);
 typedef struct pn_iterator_t pn_iterator_t;
-typedef struct pn_record_t pn_record_t;
 
 struct pn_class_t {
   const char *name;
diff --git a/c/include/proton/reactor.h b/c/include/proton/reactor.h
index e8a886467..fc96fa9e7 100644
--- a/c/include/proton/reactor.h
+++ b/c/include/proton/reactor.h
@@ -26,6 +26,7 @@
 #include <proton/type_compat.h>
 #include <proton/error.h>
 #include <proton/event.h>
+#include <proton/object.h>
 #include <proton/selectable.h>
 #include <proton/ssl.h>
 
diff --git a/c/include/proton/selectable.h b/c/include/proton/selectable.h
index c6d1722fd..2ca9588d2 100644
--- a/c/include/proton/selectable.h
+++ b/c/include/proton/selectable.h
@@ -23,7 +23,6 @@
  */
 
 #include <proton/import_export.h>
-#include <proton/object.h>
 #include <proton/event.h>
 #include <proton/type_compat.h>
 
diff --git a/c/include/proton/session.h b/c/include/proton/session.h
index 8cbdb5b76..e09d41113 100644
--- a/c/include/proton/session.h
+++ b/c/include/proton/session.h
@@ -25,7 +25,6 @@
 #include <proton/import_export.h>
 #include <proton/type_compat.h>
 #include <proton/types.h>
-#include <proton/object.h>
 #include <proton/error.h>
 #include <proton/condition.h>
 #include <stddef.h>
diff --git a/c/include/proton/types.h b/c/include/proton/types.h
index f4f496e1c..becf3fa63 100644
--- a/c/include/proton/types.h
+++ b/c/include/proton/types.h
@@ -461,6 +461,21 @@ typedef struct pn_raw_connection_t pn_raw_connection_t;
  */
 typedef struct pn_event_batch_t pn_event_batch_t;
 
+/**
+ * A type to represent the internal navigational state of a proton object
+ */
+typedef const void* pn_handle_t;
+
+/**
+ * A type representing the type of a proton internal object
+ */
+typedef struct pn_class_t pn_class_t;
+
+/**
+ * A type representing attached context information
+ */
+typedef struct pn_record_t pn_record_t;
+
 /**
  * @cond INTERNAL
  *
diff --git a/c/src/core/decoder.c b/c/src/core/decoder.c
index 6fe02bf7c..b487c96a7 100644
--- a/c/src/core/decoder.c
+++ b/c/src/core/decoder.c
@@ -20,7 +20,6 @@
  */
 
 #include <proton/error.h>
-#include <proton/object.h>
 #include <proton/codec.h>
 #include "encodings.h"
 #include "decoder.h"
diff --git a/c/src/core/encoder.c b/c/src/core/encoder.c
index 111ae25bd..8fb7acfc1 100644
--- a/c/src/core/encoder.c
+++ b/c/src/core/encoder.c
@@ -20,7 +20,6 @@
  */
 
 #include <proton/error.h>
-#include <proton/object.h>
 #include <proton/codec.h>
 #include "encodings.h"
 #include "encoder.h"
diff --git a/c/src/core/error.c b/c/src/core/error.c
index 9ebe90d7b..2d0d9b3fd 100644
--- a/c/src/core/error.c
+++ b/c/src/core/error.c
@@ -20,7 +20,6 @@
  */
 
 #include <proton/error.h>
-#include <proton/object.h>
 
 #include "memory.h"
 #include "platform/platform.h"
diff --git a/c/src/messenger/subscription.h b/c/src/messenger/subscription.h
index 8325c4df3..382b25a9c 100644
--- a/c/src/messenger/subscription.h
+++ b/c/src/messenger/subscription.h
@@ -23,6 +23,7 @@
  */
 
 #include <proton/messenger.h>
+#include <proton/object.h>
 
 extern const pn_class_t PN_CLASSCLASS(pn_subscription);
 
diff --git a/c/src/reactor/io/windows/iocp.c b/c/src/reactor/io/windows/iocp.c
index aeac84149..21fe46d5a 100644
--- a/c/src/reactor/io/windows/iocp.c
+++ b/c/src/reactor/io/windows/iocp.c
@@ -36,7 +36,6 @@
 #include "platform/platform.h"
 #include "core/util.h"
 
-#include <proton/object.h>
 #include <proton/error.h>
 #include <proton/transport.h>
 
diff --git a/c/src/reactor/io/windows/iocp.h b/c/src/reactor/io/windows/iocp.h
index 8f18d6962..327e89d3c 100644
--- a/c/src/reactor/io/windows/iocp.h
+++ b/c/src/reactor/io/windows/iocp.h
@@ -23,6 +23,7 @@
  */
 
 #include <proton/import_export.h>
+#include <proton/object.h>
 #include <proton/selectable.h>
 #include <proton/type_compat.h>
 
diff --git a/c/src/reactor/selectable.c b/c/src/reactor/selectable.c
index 3ecdc3f6c..220d1c9da 100644
--- a/c/src/reactor/selectable.c
+++ b/c/src/reactor/selectable.c
@@ -22,6 +22,7 @@
 #include "selectable.h"
 
 #include <proton/error.h>
+#include <proton/object.h>
 
 #include "io.h"
 
diff --git a/c/src/reactor/selectable.h b/c/src/reactor/selectable.h
index 2024a8ce6..251e6e238 100644
--- a/c/src/reactor/selectable.h
+++ b/c/src/reactor/selectable.h
@@ -27,6 +27,7 @@
 #endif
 
 #include <proton/selectable.h>
+#include <proton/object.h>
 
 extern const pn_class_t PN_CLASSCLASS(pn_selectable);
 
diff --git a/c/tests/fuzz/fuzz-connection-driver.c b/c/tests/fuzz/fuzz-connection-driver.c
index 8f8459fac..278dc69af 100644
--- a/c/tests/fuzz/fuzz-connection-driver.c
+++ b/c/tests/fuzz/fuzz-connection-driver.c
@@ -28,6 +28,7 @@
 #include "proton/engine.h"
 #include "proton/logger.h"
 #include "proton/message.h"
+#include "proton/object.h"
 
 #include "libFuzzingEngine.h"
 
diff --git a/c/tests/pn_test.hpp b/c/tests/pn_test.hpp
index c3dcf0176..b14012b16 100644
--- a/c/tests/pn_test.hpp
+++ b/c/tests/pn_test.hpp
@@ -30,6 +30,8 @@
 #include <proton/event.h>
 #include <proton/message.h>
 
+#include <proton/object.h>
+
 #include <iosfwd>
 #include <string>
 #include <vector>
diff --git a/cpp/src/contexts.hpp b/cpp/src/contexts.hpp
index dbba31dc4..4694ca969 100644
--- a/cpp/src/contexts.hpp
+++ b/cpp/src/contexts.hpp
@@ -27,6 +27,8 @@
 #include "proton/work_queue.hpp"
 #include "proton/message.hpp"
 
+#include "proton/object.h"
+
 #include <memory>
 
 struct pn_record_t;
diff --git a/cpp/src/object_test.cpp b/cpp/src/object_test.cpp
index 4c2737e88..3627a8539 100644
--- a/cpp/src/object_test.cpp
+++ b/cpp/src/object_test.cpp
@@ -22,6 +22,8 @@
 // for pn_data
 #include <proton/codec.h>
 
+#include <proton/object.h>
+
 namespace {
 
 TEST_CASE("pn_ptr_base(pn_data)", "[object]") {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org