make: Global change: Move all public headers to include folder. Change source to including public headers using #include <ndn-cpp/*>. Split some header files to minimize exposing C .h files.
diff --git a/ndn-cpp/c/common.h b/ndn-cpp/c/common.h
deleted file mode 100644
index 48e2ec2..0000000
--- a/ndn-cpp/c/common.h
+++ /dev/null
@@ -1,14 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_COMMON_H
-#define NDN_COMMON_H
-
-#include <ndn-cpp/ndn-cpp-config.h>
-#include <stdint.h>
-#include <stddef.h>
-
-#endif
diff --git a/ndn-cpp/c/data.h b/ndn-cpp/c/data.h
index e085f79..8d14e05 100644
--- a/ndn-cpp/c/data.h
+++ b/ndn-cpp/c/data.h
@@ -7,6 +7,7 @@
#ifndef NDN_DATA_H
#define NDN_DATA_H
+#include <ndn-cpp/c/data-types.h>
#include "name.h"
#include "publisher-public-key-digest.h"
#include "key.h"
@@ -41,15 +42,6 @@
ndn_KeyLocator_initialize(&self->keyLocator, keyNameComponents, maxKeyNameComponents);
}
-typedef enum {
- ndn_ContentType_DATA = 0,
- ndn_ContentType_ENCR = 1,
- ndn_ContentType_GONE = 2,
- ndn_ContentType_KEY = 3,
- ndn_ContentType_LINK = 4,
- ndn_ContentType_NACK = 5
-} ndn_ContentType;
-
/**
* An ndn_MetaInfo struct holds the meta info which is signed inside the data packet.
*/
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.h b/ndn-cpp/c/encoding/binary-xml-decoder.h
index 3e16497..38fd450 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.h
@@ -7,7 +7,7 @@
#ifndef NDN_BINARYXMLDECODER_H
#define NDN_BINARYXMLDECODER_H
-#include "../common.h"
+#include <ndn-cpp/c/common.h>
#include "../errors.h"
#include "../util/blob.h"
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.h b/ndn-cpp/c/encoding/binary-xml-element-reader.h
index c2b3777..89f8c8d 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.h
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.h
@@ -4,9 +4,10 @@
* See COPYING for copyright and distribution information.
*/
-#ifndef NDN_BINARYXMLELEMENTREADER_H
-#define NDN_BINARYXMLELEMENTREADER_H
+#ifndef NDN_BINARY_XML_ELEMENT_READER_H
+#define NDN_BINARY_XML_ELEMENT_READER_H
+#include <ndn-cpp/c/encoding/element-listener.h>
#include "../errors.h"
#include "binary-xml-structure-decoder.h"
#include "../util/dynamic-uint8-array.h"
@@ -14,25 +15,6 @@
#ifdef __cplusplus
extern "C" {
#endif
-
-/** An ndn_ElementListener struct holds a function pointer onReceivedElement. You can extend this struct with data that
- * will be passed to onReceivedElement.
- */
-struct ndn_ElementListener {
- void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength); /**< see ndn_ElementListener_initialize */
-};
-
-/**
- * Initialize an ndn_ElementListener struct to use the onReceivedElement function pointer.
- * @param self pointer to the ndn_ElementListener struct
- * @param onReceivedElement pointer to a function which is called when an entire binary XML element is received.
- * self is the pointer to this ndn_ElementListener struct. See ndn_BinaryXmlElementReader_onReceivedData.
- */
-static inline void ndn_ElementListener_initialize
- (struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, uint8_t *element, size_t elementLength))
-{
- self->onReceivedElement = onReceivedElement;
-}
/**
* A BinaryXmlElementReader lets you call ndn_BinaryXmlElementReader_onReceivedData multiple times which uses an
diff --git a/ndn-cpp/c/encoding/binary-xml-key.h b/ndn-cpp/c/encoding/binary-xml-key.h
index 6aecd20..391fa72 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.h
+++ b/ndn-cpp/c/encoding/binary-xml-key.h
@@ -7,8 +7,8 @@
#ifndef NDN_BINARYXMLKEY_H
#define NDN_BINARYXMLKEY_H
-#include "../errors.h"
#include "../key.h"
+#include "../errors.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
index 63420d2..54a92d5 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
@@ -7,7 +7,7 @@
#ifndef NDN_BINARYXMLSTRUCTUREDECODER_H
#define NDN_BINARYXMLSTRUCTUREDECODER_H
-#include "../common.h"
+#include <ndn-cpp/c/common.h>
#include "../errors.h"
#ifdef __cplusplus
diff --git a/ndn-cpp/c/forwarding-entry.h b/ndn-cpp/c/forwarding-entry.h
index 001fabc..48bbf5e 100644
--- a/ndn-cpp/c/forwarding-entry.h
+++ b/ndn-cpp/c/forwarding-entry.h
@@ -7,10 +7,10 @@
#ifndef NDN_FORWARDING_ENTRY_H
#define NDN_FORWARDING_ENTRY_H
-#include "common.h"
+#include <ndn-cpp/c/common.h>
+#include <ndn-cpp/c/forwarding-flags.h>
#include "name.h"
#include "publisher-public-key-digest.h"
-#include "forwarding-flags.h"
#ifdef __cplusplus
extern "C" {
diff --git a/ndn-cpp/c/forwarding-flags.c b/ndn-cpp/c/forwarding-flags.c
index e7477ed..4a7510d 100644
--- a/ndn-cpp/c/forwarding-flags.c
+++ b/ndn-cpp/c/forwarding-flags.c
@@ -5,7 +5,6 @@
*/
#include "forwarding-entry.h"
-#include "forwarding-flags.h"
void ndn_ForwardingFlags_initialize(struct ndn_ForwardingFlags *self)
{
diff --git a/ndn-cpp/c/forwarding-flags.h b/ndn-cpp/c/forwarding-flags.h
deleted file mode 100644
index ba6f6b5..0000000
--- a/ndn-cpp/c/forwarding-flags.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * Copyright (C) 2013 Regents of the University of California.
- * @author: Jeff Thompson <jefft0@remap.ucla.edu>
- * See COPYING for copyright and distribution information.
- */
-
-#ifndef NDN_FORWARDING_FLAGS_H
-#define NDN_FORWARDING_FLAGS_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * An ndn_ForwardingFlags object holds the flags which specify how the forwarding daemon should forward an interest for
- * a registered prefix. We use a separate ForwardingFlags object to retain future compatibility if the daemon forwarding
- * bits are changed, amended or deprecated.
- */
-struct ndn_ForwardingFlags {
- int active; /**< 1 if the flag is set, 0 if cleared. */
- int childInherit;
- int advertise;
- int last;
- int capture;
- int local;
- int tap;
- int captureOk;
-};
-
-/**
- * Initialize an ndn_ForwardingFlags struct with the default with "active" and "childInherit" set and all other flags cleared.
- * @param self A pointer to the ndn_ForwardingFlags struct.
- */
-void ndn_ForwardingFlags_initialize(struct ndn_ForwardingFlags *self);
-
-/**
- * Get an integer with the bits set according to the flags as used by the ForwardingEntry message.
- * @param self A pointer to the ndn_ForwardingFlags struct.
- * @return An integer with the bits set.
- */
-int ndn_ForwardingFlags_getForwardingEntryFlags(struct ndn_ForwardingFlags *self);
-
-/**
- * Set the flags according to the bits in forwardingEntryFlags as used by the ForwardingEntry message.
- * @param self A pointer to the ndn_ForwardingFlags struct.
- * @param flags An integer with the bits set.
- */
-void ndn_ForwardingFlags_setForwardingEntryFlags(struct ndn_ForwardingFlags *self, int forwardingEntryFlags);
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index 69428ac..12ca38e 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -7,6 +7,7 @@
#ifndef NDN_INTEREST_H
#define NDN_INTEREST_H
+#include <ndn-cpp/c/interest-types.h>
#include "name.h"
#include "publisher-public-key-digest.h"
@@ -14,11 +15,6 @@
extern "C" {
#endif
-typedef enum {
- ndn_Exclude_COMPONENT = 0,
- ndn_Exclude_ANY = 1
-} ndn_ExcludeType;
-
/**
* An ndn_ExcludeEntry holds an ndn_ExcludeType, and if it is a COMPONENT, it holds a pointer to the component value.
*/
diff --git a/ndn-cpp/c/key.h b/ndn-cpp/c/key.h
index a933489..b7f8751 100644
--- a/ndn-cpp/c/key.h
+++ b/ndn-cpp/c/key.h
@@ -7,25 +7,13 @@
#ifndef NDN_KEY_H
#define NDN_KEY_H
+#include <ndn-cpp/c/key-types.h>
#include "name.h"
#ifdef __cplusplus
extern "C" {
#endif
-typedef enum {
- ndn_KeyLocatorType_KEY = 1,
- ndn_KeyLocatorType_CERTIFICATE = 2,
- ndn_KeyLocatorType_KEYNAME = 3
-} ndn_KeyLocatorType;
-
-typedef enum {
- ndn_KeyNameType_PUBLISHER_PUBLIC_KEY_DIGEST = 1,
- ndn_KeyNameType_PUBLISHER_CERTIFICATE_DIGEST = 2,
- ndn_KeyNameType_PUBLISHER_ISSUER_KEY_DIGEST = 3,
- ndn_KeyNameType_PUBLISHER_ISSUER_CERTIFICATE_DIGEST = 4
-} ndn_KeyNameType;
-
/**
* An ndn_KeyLocator holds the type of key locator and related data.
*/
diff --git a/ndn-cpp/c/name.h b/ndn-cpp/c/name.h
index d6badc1..78fcc9c 100644
--- a/ndn-cpp/c/name.h
+++ b/ndn-cpp/c/name.h
@@ -7,6 +7,7 @@
#ifndef NDN_NAME_H
#define NDN_NAME_H
+#include <ndn-cpp/c/common.h>
#include "errors.h"
#include "util/blob.h"
diff --git a/ndn-cpp/c/publisher-public-key-digest.h b/ndn-cpp/c/publisher-public-key-digest.h
index 85891bf..95faf1d 100644
--- a/ndn-cpp/c/publisher-public-key-digest.h
+++ b/ndn-cpp/c/publisher-public-key-digest.h
@@ -7,7 +7,7 @@
#ifndef NDN_PUBLISHERPUBLICKEYDIGEST_H
#define NDN_PUBLISHERPUBLICKEYDIGEST_H
-#include "common.h"
+#include <ndn-cpp/c/common.h>
#include "util/blob.h"
#ifdef __cplusplus
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index b0a0979..85e297e 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -8,7 +8,7 @@
#define NDN_SOCKETTRANSPORT_H
#include <sys/socket.h>
-#include "../common.h"
+#include <ndn-cpp/c/common.h>
#include "../errors.h"
#ifdef __cplusplus
diff --git a/ndn-cpp/c/util/blob.h b/ndn-cpp/c/util/blob.h
index 06dbce1..18bcd03 100644
--- a/ndn-cpp/c/util/blob.h
+++ b/ndn-cpp/c/util/blob.h
@@ -7,6 +7,8 @@
#ifndef NDN_BLOB_H
#define NDN_BLOB_H
+#include <ndn-cpp/c/common.h>
+
#ifdef __cplusplus
extern "C" {
#endif
diff --git a/ndn-cpp/c/util/crypto.h b/ndn-cpp/c/util/crypto.h
index 5bec549..586108b 100644
--- a/ndn-cpp/c/util/crypto.h
+++ b/ndn-cpp/c/util/crypto.h
@@ -9,7 +9,7 @@
#include <openssl/ssl.h>
#include <openssl/rsa.h>
-#include "../common.h"
+#include <ndn-cpp/c/common.h>
#ifdef __cplusplus
extern "C" {
diff --git a/ndn-cpp/c/util/ndn_memory.h b/ndn-cpp/c/util/ndn_memory.h
index 9d23e2d..bdf6341 100644
--- a/ndn-cpp/c/util/ndn_memory.h
+++ b/ndn-cpp/c/util/ndn_memory.h
@@ -11,7 +11,7 @@
#ifndef NDN_MEMORY_H
#define NDN_MEMORY_H
-#include "../common.h"
+#include <ndn-cpp/c/common.h>
#ifdef __cplusplus
extern "C" {