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 2014/12/11 05:12:16 UTC

[3/6] qpid-proton git commit: PROTON-696: Remove pn_buffer_t and pn_frame_t from the public API (they are currently only used privately) - Don't want to expose a potentially changing internal detail - XXX Currently left the DLL exports in because of prot

PROTON-696: Remove pn_buffer_t and pn_frame_t from the public API
(they are currently only used privately)
- Don't want to expose a potentially changing internal detail
- XXX Currently left the DLL exports in because of proton and proton-dump


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/815e97ef
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/815e97ef
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/815e97ef

Branch: refs/heads/master
Commit: 815e97efeeb964d782861353751d44b253fc2c24
Parents: c705dd5
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Dec 8 17:56:23 2014 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Wed Dec 10 16:43:31 2014 -0500

----------------------------------------------------------------------
 proton-c/include/proton/buffer.h      | 59 ------------------------------
 proton-c/include/proton/framing.h     | 52 --------------------------
 proton-c/src/buffer.c                 |  3 +-
 proton-c/src/buffer.h                 | 59 ++++++++++++++++++++++++++++++
 proton-c/src/codec/data.h             |  3 +-
 proton-c/src/dispatcher/dispatcher.c  |  7 +---
 proton-c/src/dispatcher/dispatcher.h  |  4 +-
 proton-c/src/engine/engine-internal.h |  2 +-
 proton-c/src/framing/framing.c        |  3 +-
 proton-c/src/framing/framing.h        | 52 ++++++++++++++++++++++++++
 proton-c/src/messenger/store.h        |  2 +-
 proton-c/src/messenger/transform.h    |  2 +-
 proton-c/src/proton-dump.c            |  4 +-
 proton-c/src/proton.c                 |  2 +-
 proton-c/src/sasl/sasl.c              |  5 ++-
 proton-c/src/transport/transport.c    |  3 +-
 16 files changed, 129 insertions(+), 133 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/include/proton/buffer.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/buffer.h b/proton-c/include/proton/buffer.h
deleted file mode 100644
index 26d4bb3..0000000
--- a/proton-c/include/proton/buffer.h
+++ /dev/null
@@ -1,59 +0,0 @@
-#ifndef PROTON_BUFFER_H
-#define PROTON_BUFFER_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct {
-    size_t size;
-    char *start;
-} pn_buffer_memory_t;
-
-typedef struct pn_buffer_t pn_buffer_t;
-
-PN_EXTERN pn_buffer_t *pn_buffer(size_t capacity);
-PN_EXTERN void pn_buffer_free(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_size(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_capacity(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_available(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
-PN_EXTERN int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
-PN_EXTERN int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
-PN_EXTERN size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
-PN_EXTERN int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
-PN_EXTERN void pn_buffer_clear(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_defrag(pn_buffer_t *buf);
-PN_EXTERN pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
-PN_EXTERN pn_buffer_memory_t pn_buffer_memory(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_print(pn_buffer_t *buf);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* buffer.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/include/proton/framing.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/framing.h b/proton-c/include/proton/framing.h
deleted file mode 100644
index 9650979..0000000
--- a/proton-c/include/proton/framing.h
+++ /dev/null
@@ -1,52 +0,0 @@
-#ifndef PROTON_FRAMING_H
-#define PROTON_FRAMING_H 1
-
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
- */
-
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define AMQP_HEADER_SIZE (8)
-#define AMQP_MIN_MAX_FRAME_SIZE ((uint32_t)512) // minimum allowable max-frame
-
-typedef struct {
-  uint8_t type;
-  uint16_t channel;
-  size_t ex_size;
-  const char *extended;
-  size_t size;
-  const char *payload;
-} pn_frame_t;
-
-PN_EXTERN size_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available);
-PN_EXTERN size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* framing.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/buffer.c
----------------------------------------------------------------------
diff --git a/proton-c/src/buffer.c b/proton-c/src/buffer.c
index b69034b..e37aa75 100644
--- a/proton-c/src/buffer.c
+++ b/proton-c/src/buffer.c
@@ -19,7 +19,6 @@
  *
  */
 
-#include <proton/buffer.h>
 #include <proton/error.h>
 #ifndef __cplusplus
 #include <stdbool.h>
@@ -27,6 +26,8 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
+
+#include "buffer.h"
 #include "util.h"
 
 struct pn_buffer_t {

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/buffer.h
----------------------------------------------------------------------
diff --git a/proton-c/src/buffer.h b/proton-c/src/buffer.h
new file mode 100644
index 0000000..26d4bb3
--- /dev/null
+++ b/proton-c/src/buffer.h
@@ -0,0 +1,59 @@
+#ifndef PROTON_BUFFER_H
+#define PROTON_BUFFER_H 1
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/import_export.h>
+#include <proton/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+    size_t size;
+    char *start;
+} pn_buffer_memory_t;
+
+typedef struct pn_buffer_t pn_buffer_t;
+
+PN_EXTERN pn_buffer_t *pn_buffer(size_t capacity);
+PN_EXTERN void pn_buffer_free(pn_buffer_t *buf);
+PN_EXTERN size_t pn_buffer_size(pn_buffer_t *buf);
+PN_EXTERN size_t pn_buffer_capacity(pn_buffer_t *buf);
+PN_EXTERN size_t pn_buffer_available(pn_buffer_t *buf);
+PN_EXTERN int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
+PN_EXTERN int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
+PN_EXTERN int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
+PN_EXTERN size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
+PN_EXTERN int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
+PN_EXTERN void pn_buffer_clear(pn_buffer_t *buf);
+PN_EXTERN int pn_buffer_defrag(pn_buffer_t *buf);
+PN_EXTERN pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
+PN_EXTERN pn_buffer_memory_t pn_buffer_memory(pn_buffer_t *buf);
+PN_EXTERN int pn_buffer_print(pn_buffer_t *buf);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* buffer.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/codec/data.h
----------------------------------------------------------------------
diff --git a/proton-c/src/codec/data.h b/proton-c/src/codec/data.h
index 99e8228..56e789b 100644
--- a/proton-c/src/codec/data.h
+++ b/proton-c/src/codec/data.h
@@ -22,8 +22,7 @@
  *
  */
 
-#include <proton/buffer.h>
-
+#include "buffer.h"
 #include "decoder.h"
 #include "encoder.h"
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/dispatcher/dispatcher.c
----------------------------------------------------------------------
diff --git a/proton-c/src/dispatcher/dispatcher.c b/proton-c/src/dispatcher/dispatcher.c
index 6368aa5..4efd288 100644
--- a/proton-c/src/dispatcher/dispatcher.c
+++ b/proton-c/src/dispatcher/dispatcher.c
@@ -19,12 +19,7 @@
  *
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <proton/framing.h>
-#include <proton/engine.h>
-#include <proton/buffer.h>
+#include "framing/framing.h"
 #include "dispatcher.h"
 #include "protocol.h"
 #include "util.h"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/dispatcher/dispatcher.h
----------------------------------------------------------------------
diff --git a/proton-c/src/dispatcher/dispatcher.h b/proton-c/src/dispatcher/dispatcher.h
index 9ec2dda..79008e6 100644
--- a/proton-c/src/dispatcher/dispatcher.h
+++ b/proton-c/src/dispatcher/dispatcher.h
@@ -26,9 +26,9 @@
 #ifndef __cplusplus
 #include <stdbool.h>
 #endif
-#include "proton/buffer.h"
-#include "proton/codec.h"
+
 #include "proton/transport.h"
+#include "buffer.h"
 
 typedef struct pn_dispatcher_t pn_dispatcher_t;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/engine/engine-internal.h
----------------------------------------------------------------------
diff --git a/proton-c/src/engine/engine-internal.h b/proton-c/src/engine/engine-internal.h
index aa2c91d..428a2f3 100644
--- a/proton-c/src/engine/engine-internal.h
+++ b/proton-c/src/engine/engine-internal.h
@@ -23,9 +23,9 @@
  */
 
 #include <proton/object.h>
-#include <proton/buffer.h>
 #include <proton/engine.h>
 #include <proton/types.h>
+#include "buffer.h"
 #include "dispatcher/dispatcher.h"
 #include "util.h"
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/framing/framing.c
----------------------------------------------------------------------
diff --git a/proton-c/src/framing/framing.c b/proton-c/src/framing/framing.c
index f56aa81..dde6e6f 100644
--- a/proton-c/src/framing/framing.c
+++ b/proton-c/src/framing/framing.c
@@ -21,7 +21,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <proton/framing.h>
+
+#include "framing.h"
 
 // TODO: These are near duplicates of code in codec.c - they should be
 // deduplicated.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/framing/framing.h
----------------------------------------------------------------------
diff --git a/proton-c/src/framing/framing.h b/proton-c/src/framing/framing.h
new file mode 100644
index 0000000..9650979
--- /dev/null
+++ b/proton-c/src/framing/framing.h
@@ -0,0 +1,52 @@
+#ifndef PROTON_FRAMING_H
+#define PROTON_FRAMING_H 1
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <proton/import_export.h>
+#include <proton/type_compat.h>
+#include <sys/types.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define AMQP_HEADER_SIZE (8)
+#define AMQP_MIN_MAX_FRAME_SIZE ((uint32_t)512) // minimum allowable max-frame
+
+typedef struct {
+  uint8_t type;
+  uint16_t channel;
+  size_t ex_size;
+  const char *extended;
+  size_t size;
+  const char *payload;
+} pn_frame_t;
+
+PN_EXTERN size_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available);
+PN_EXTERN size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* framing.h */

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/messenger/store.h
----------------------------------------------------------------------
diff --git a/proton-c/src/messenger/store.h b/proton-c/src/messenger/store.h
index 8130410..2ca243b 100644
--- a/proton-c/src/messenger/store.h
+++ b/proton-c/src/messenger/store.h
@@ -22,7 +22,7 @@
  *
  */
 
-#include <proton/buffer.h>
+#include "buffer.h"
 
 typedef struct pni_store_t pni_store_t;
 typedef struct pni_entry_t pni_entry_t;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/messenger/transform.h
----------------------------------------------------------------------
diff --git a/proton-c/src/messenger/transform.h b/proton-c/src/messenger/transform.h
index 8160be3..c9350ef 100644
--- a/proton-c/src/messenger/transform.h
+++ b/proton-c/src/messenger/transform.h
@@ -23,7 +23,7 @@
  */
 
 #include <proton/object.h>
-#include <proton/buffer.h>
+#include "buffer.h"
 
 typedef struct pn_transform_t pn_transform_t;
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/proton-dump.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proton-dump.c b/proton-c/src/proton-dump.c
index 4e8a04f..520299c 100644
--- a/proton-c/src/proton-dump.c
+++ b/proton-c/src/proton-dump.c
@@ -22,10 +22,10 @@
 #include "pncompat/misc_funcs.inc"
 
 #include <stdio.h>
-#include <proton/buffer.h>
 #include <proton/codec.h>
 #include <proton/error.h>
-#include <proton/framing.h>
+#include "buffer.h"
+#include "framing/framing.h"
 #include "util.h"
 
 void fatal_error(const char *msg, const char *arg, int err)

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/proton.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proton.c b/proton-c/src/proton.c
index 6e4f69d..013a7ca 100644
--- a/proton-c/src/proton.c
+++ b/proton-c/src/proton.c
@@ -32,12 +32,12 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include "proton/buffer.h"
 #include "proton/codec.h"
 #include "proton/driver.h"
 #include "proton/engine.h"
 #include "proton/message.h"
 #include "proton/version.h"
+#include "buffer.h"
 #include "util.h"
 #include "platform_fmt.h"
 

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/sasl/sasl.c
----------------------------------------------------------------------
diff --git a/proton-c/src/sasl/sasl.c b/proton-c/src/sasl/sasl.c
index 4ed9f84..4dabdca 100644
--- a/proton-c/src/sasl/sasl.c
+++ b/proton-c/src/sasl/sasl.c
@@ -23,12 +23,13 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
-#include <proton/buffer.h>
-#include <proton/framing.h>
 #include <proton/error.h>
 #include <proton/sasl.h>
+
+#include "buffer.h"
 #include "protocol.h"
 #include "dispatch_actions.h"
+#include "framing/framing.h"
 #include "engine/engine-internal.h"
 #include "dispatcher/dispatcher.h"
 #include "util.h"

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/815e97ef/proton-c/src/transport/transport.c
----------------------------------------------------------------------
diff --git a/proton-c/src/transport/transport.c b/proton-c/src/transport/transport.c
index ec0ec3e..35ad060 100644
--- a/proton-c/src/transport/transport.c
+++ b/proton-c/src/transport/transport.c
@@ -19,9 +19,8 @@
  *
  */
 
-#include "proton/framing.h"
-
 #include "engine/engine-internal.h"
+#include "framing/framing.h"
 #include "sasl/sasl-internal.h"
 #include "ssl/ssl-internal.h"
 


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