Cody style: Replace init with initialize.
diff --git a/ndn-cpp/c/data.h b/ndn-cpp/c/data.h
index 422952b..e8b2bf1 100644
--- a/ndn-cpp/c/data.h
+++ b/ndn-cpp/c/data.h
@@ -24,7 +24,7 @@
unsigned int signatureLength;
};
-static inline void ndn_Signature_init(struct ndn_Signature *self) {
+static inline void ndn_Signature_initialize(struct ndn_Signature *self) {
self->digestAlgorithm = 0;
self->digestAlgorithmLength = 0;
self->witness = 0;
@@ -58,14 +58,14 @@
* @param keyNameComponents The pre-allocated array of ndn_NameComponent for the keyLocator.
* @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
*/
-static inline void ndn_SignedInfo_init
+static inline void ndn_SignedInfo_initialize
(struct ndn_SignedInfo *self, struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents) {
- ndn_PublisherPublicKeyDigest_init(&self->publisherPublicKeyDigest);
+ ndn_PublisherPublicKeyDigest_initialize(&self->publisherPublicKeyDigest);
self->type = ndn_ContentType_DATA;
self->freshnessSeconds = -1;
self->finalBlockID = 0;
self->finalBlockIDLength = 0;
- ndn_KeyLocator_init(&self->keyLocator, keyNameComponents, maxKeyNameComponents);
+ ndn_KeyLocator_initialize(&self->keyLocator, keyNameComponents, maxKeyNameComponents);
}
struct ndn_Data {
@@ -85,13 +85,13 @@
* @param keyNameComponents The pre-allocated array of ndn_NameComponent for the signedInfo.keyLocator.
* @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
*/
-static inline void ndn_Data_init
+static inline void ndn_Data_initialize
(struct ndn_Data *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents,
struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents)
{
- ndn_Signature_init(&self->signature);
- ndn_Name_init(&self->name, nameComponents, maxNameComponents);
- ndn_SignedInfo_init(&self->signedInfo, keyNameComponents, maxKeyNameComponents);
+ ndn_Signature_initialize(&self->signature);
+ ndn_Name_initialize(&self->name, nameComponents, maxNameComponents);
+ ndn_SignedInfo_initialize(&self->signedInfo, keyNameComponents, maxKeyNameComponents);
self->content = 0;
self->contentLength = 0;
}
diff --git a/ndn-cpp/c/encoding/binary-xml-data.c b/ndn-cpp/c/encoding/binary-xml-data.c
index 7dd3983..31354d4 100644
--- a/ndn-cpp/c/encoding/binary-xml-data.c
+++ b/ndn-cpp/c/encoding/binary-xml-data.c
@@ -216,7 +216,7 @@
return error;
}
else
- ndn_Signature_init(&data->signature);
+ ndn_Signature_initialize(&data->signature);
*signedFieldsBeginOffset = decoder->offset;
@@ -230,7 +230,7 @@
return error;
}
else
- ndn_SignedInfo_init(&data->signedInfo, data->signedInfo.keyLocator.keyName.components, data->signedInfo.keyLocator.keyName.maxComponents);
+ ndn_SignedInfo_initialize(&data->signedInfo, data->signedInfo.keyLocator.keyName.components, data->signedInfo.keyLocator.keyName.maxComponents);
// Require a Content element, but set allowNull to allow a missing BLOB.
if ((error = ndn_BinaryXmlDecoder_readBinaryDTagElement
diff --git a/ndn-cpp/c/encoding/binary-xml-decoder.h b/ndn-cpp/c/encoding/binary-xml-decoder.h
index 31a17fe..68db6b8 100644
--- a/ndn-cpp/c/encoding/binary-xml-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-decoder.h
@@ -18,7 +18,7 @@
unsigned int offset;
};
-static inline void ndn_BinaryXmlDecoder_init(struct ndn_BinaryXmlDecoder *self, unsigned char *input, unsigned int inputLength)
+static inline void ndn_BinaryXmlDecoder_initialize(struct ndn_BinaryXmlDecoder *self, unsigned char *input, unsigned int inputLength)
{
self->input = input;
self->inputLength = inputLength;
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.c b/ndn-cpp/c/encoding/binary-xml-element-reader.c
index b7c062e..47d5d38 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.c
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.c
@@ -35,7 +35,7 @@
// Need to read a new object.
data += self->structureDecoder.offset;
dataLength -= self->structureDecoder.offset;
- ndn_BinaryXmlStructureDecoder_init(&self->structureDecoder);
+ ndn_BinaryXmlStructureDecoder_initialize(&self->structureDecoder);
if (dataLength == 0)
// No more data in the packet.
return NDN_ERROR_success;
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.h b/ndn-cpp/c/encoding/binary-xml-element-reader.h
index 4edd145..190a390 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.h
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.h
@@ -18,7 +18,7 @@
* will be passed to onReceivedElement.
*/
struct ndn_ElementListener {
- void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength); /**< see ndn_ElementListener_init */
+ void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength); /**< see ndn_ElementListener_initialize */
};
/**
@@ -27,7 +27,7 @@
* @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_init
+static inline void ndn_ElementListener_initialize
(struct ndn_ElementListener *self, void (*onReceivedElement)(struct ndn_ElementListener *self, unsigned char *element, unsigned int elementLength))
{
self->onReceivedElement = onReceivedElement;
@@ -55,14 +55,14 @@
* @param bufferLength the length of the buffer
* @param reallocFunction see ndn_DynamicUCharArray_ensureLength. This may be 0.
*/
-static inline void ndn_BinaryXmlElementReader_init
+static inline void ndn_BinaryXmlElementReader_initialize
(struct ndn_BinaryXmlElementReader *self, struct ndn_ElementListener *elementListener,
unsigned char *buffer, unsigned int bufferLength, unsigned char * (*reallocFunction)(struct ndn_DynamicUCharArray *self, unsigned char *, unsigned int))
{
self->elementListener = elementListener;
- ndn_BinaryXmlStructureDecoder_init(&self->structureDecoder);
+ ndn_BinaryXmlStructureDecoder_initialize(&self->structureDecoder);
self->usePartialData = 0;
- ndn_DynamicUCharArray_init(&self->partialData, buffer, bufferLength, reallocFunction);
+ ndn_DynamicUCharArray_initialize(&self->partialData, buffer, bufferLength, reallocFunction);
}
/**
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.h b/ndn-cpp/c/encoding/binary-xml-encoder.h
index d414dad..666e09d 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.h
@@ -15,7 +15,7 @@
#endif
/** An ndn_BinaryXmlEncoder struct is used by all the encoding functions. You should initialize it with
- * ndn_BinaryXmlEncoder_init.
+ * ndn_BinaryXmlEncoder_initialize.
*/
struct ndn_BinaryXmlEncoder {
struct ndn_DynamicUCharArray *output; /**< A pointer to a ndn_DynamicUCharArray which receives the encoded output */
@@ -23,13 +23,13 @@
};
/**
- * Initialize an ndn_BinaryXmlEncoder_init struct with the arguments for initializing the ndn_DynamicUCharArray.
+ * Initialize an ndn_BinaryXmlEncoder_initialize struct with the arguments for initializing the ndn_DynamicUCharArray.
* @param self pointer to the ndn_BinaryXmlEncoder struct
* @param output A pointer to a ndn_DynamicUCharArray struct which receives the encoded output. The struct must
* remain valid during the entire life of this ndn_BinaryXmlEncoder. If the output->realloc
* function pointer is null, its array must be large enough to receive the entire encoding.
*/
-static inline void ndn_BinaryXmlEncoder_init(struct ndn_BinaryXmlEncoder *self, struct ndn_DynamicUCharArray *output)
+static inline void ndn_BinaryXmlEncoder_initialize(struct ndn_BinaryXmlEncoder *self, struct ndn_DynamicUCharArray *output)
{
self->output = output;
self->offset = 0;
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index b835ebd..4fdbd44 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -67,7 +67,7 @@
// Add the component entry.
if (exclude->nEntries >= exclude->maxEntries)
return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
- ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_COMPONENT, component, componentLen);
+ ndn_ExcludeEntry_initialize(exclude->entries + exclude->nEntries, ndn_Exclude_COMPONENT, component, componentLen);
++exclude->nEntries;
continue;
@@ -85,7 +85,7 @@
// Add the any entry.
if (exclude->nEntries >= exclude->maxEntries)
return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
- ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
+ ndn_ExcludeEntry_initialize(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
++exclude->nEntries;
continue;
@@ -103,7 +103,7 @@
// Add the any entry.
if (exclude->nEntries >= exclude->maxEntries)
return NDN_ERROR_read_an_entry_past_the_maximum_number_of_entries_allowed_in_the_exclude;
- ndn_ExcludeEntry_init(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
+ ndn_ExcludeEntry_initialize(exclude->entries + exclude->nEntries, ndn_Exclude_ANY, 0, 0);
++exclude->nEntries;
continue;
diff --git a/ndn-cpp/c/encoding/binary-xml-key.c b/ndn-cpp/c/encoding/binary-xml-key.c
index 1f61e51..769ea16 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.c
+++ b/ndn-cpp/c/encoding/binary-xml-key.c
@@ -184,7 +184,7 @@
return error;
}
else
- ndn_KeyLocator_init(keyLocator, keyLocator->keyName.components, keyLocator->keyName.maxComponents);
+ ndn_KeyLocator_initialize(keyLocator, keyLocator->keyName.components, keyLocator->keyName.maxComponents);
return NDN_ERROR_success;
}
diff --git a/ndn-cpp/c/encoding/binary-xml-name.c b/ndn-cpp/c/encoding/binary-xml-name.c
index fb99070..50aca94 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -51,7 +51,7 @@
// Add the component to the name.
if (name->nComponents >= name->maxComponents)
return NDN_ERROR_read_a_component_past_the_maximum_number_of_components_allowed_in_the_name;
- ndn_NameComponent_init(name->components + name->nComponents, component, componentLen);
+ ndn_NameComponent_initialize(name->components + name->nComponents, component, componentLen);
++name->nComponents;
}
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.c b/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
index 6a3d417..9a3048f 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.c
@@ -8,7 +8,7 @@
#include "binary-xml-decoder.h"
#include "binary-xml-structure-decoder.h"
-void ndn_BinaryXmlStructureDecoder_init(struct ndn_BinaryXmlStructureDecoder *self)
+void ndn_BinaryXmlStructureDecoder_initialize(struct ndn_BinaryXmlStructureDecoder *self)
{
self->gotElementEnd = 0;
self->offset = 0;
@@ -37,7 +37,7 @@
return NDN_ERROR_success;
struct ndn_BinaryXmlDecoder decoder;
- ndn_BinaryXmlDecoder_init(&decoder, input, inputLength);
+ ndn_BinaryXmlDecoder_initialize(&decoder, input, inputLength);
while (1) {
if (self->offset >= inputLength)
@@ -93,7 +93,7 @@
// Use a local decoder just for the headerBuffer.
struct ndn_BinaryXmlDecoder bufferDecoder;
- ndn_BinaryXmlDecoder_init(&bufferDecoder, self->headerBuffer, sizeof(self->headerBuffer));
+ ndn_BinaryXmlDecoder_initialize(&bufferDecoder, self->headerBuffer, sizeof(self->headerBuffer));
if (ndn_BinaryXmlDecoder_decodeTypeAndValue(&bufferDecoder, &type, &value))
return NDN_ERROR_findElementEnd_cannot_read_header_type_and_value;
}
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
index 54c8648..6bff996 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
@@ -29,7 +29,7 @@
ndn_BinaryXmlStructureDecoder_READ_BYTES
};
-void ndn_BinaryXmlStructureDecoder_init(struct ndn_BinaryXmlStructureDecoder *self);
+void ndn_BinaryXmlStructureDecoder_initialize(struct ndn_BinaryXmlStructureDecoder *self);
/**
* Continue scanning input starting from self->offset to find the element end. On return, you must check
diff --git a/ndn-cpp/c/forwarding-entry.h b/ndn-cpp/c/forwarding-entry.h
index be82fee..0769fa0 100644
--- a/ndn-cpp/c/forwarding-entry.h
+++ b/ndn-cpp/c/forwarding-entry.h
@@ -33,13 +33,13 @@
* @param prefixNameComponents the pre-allocated array of ndn_NameComponent
* @param maxPrefixNameComponents the number of elements in the allocated prefixNameComponents array
*/
-static inline void ndn_ForwardingEntry_init
+static inline void ndn_ForwardingEntry_initialize
(struct ndn_ForwardingEntry *self, struct ndn_NameComponent *prefixNameComponents, unsigned int maxPrefixNameComponents)
{
self->action = 0;
self->actionLength = 0;
- ndn_Name_init(&self->prefix, prefixNameComponents, maxPrefixNameComponents);
- ndn_PublisherPublicKeyDigest_init(&self->publisherPublicKeyDigest);
+ ndn_Name_initialize(&self->prefix, prefixNameComponents, maxPrefixNameComponents);
+ ndn_PublisherPublicKeyDigest_initialize(&self->publisherPublicKeyDigest);
self->faceId = -1;
self->forwardingFlags = -1;
self->freshnessSeconds = -1;
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index 5def3a0..35b2c4b 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -33,10 +33,10 @@
* @param component the pre-allocated buffer for the component value, only used if type is ndn_Exclude_COMPONENT
* @param componentLength the number of bytes in value, only used if type is ndn_Exclude_COMPONENT
*/
-static inline void ndn_ExcludeEntry_init(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, unsigned char *component, unsigned int componentLength)
+static inline void ndn_ExcludeEntry_initialize(struct ndn_ExcludeEntry *self, ndn_ExcludeType type, unsigned char *component, unsigned int componentLength)
{
self->type = type;
- ndn_NameComponent_init(&self->component, component, componentLength);
+ ndn_NameComponent_initialize(&self->component, component, componentLength);
}
/**
@@ -53,7 +53,7 @@
* @param entries the pre-allocated array of ndn_ExcludeEntry
* @param maxEntries the number of elements in the allocated entries array
*/
-static inline void ndn_Exclude_init(struct ndn_Exclude *self, struct ndn_ExcludeEntry *entries, unsigned int maxEntries)
+static inline void ndn_Exclude_initialize(struct ndn_Exclude *self, struct ndn_ExcludeEntry *entries, unsigned int maxEntries)
{
self->entries = entries;
self->maxEntries = maxEntries;
@@ -114,15 +114,15 @@
* @param excludeEntries the pre-allocated array of ndn_ExcludeEntry
* @param maxExcludeEntries the number of elements in the allocated excludeEntries array
*/
-static inline void ndn_Interest_init
+static inline void ndn_Interest_initialize
(struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents,
struct ndn_ExcludeEntry *excludeEntries, unsigned int maxExcludeEntries)
{
- ndn_Name_init(&self->name, nameComponents, maxNameComponents);
+ ndn_Name_initialize(&self->name, nameComponents, maxNameComponents);
self->minSuffixComponents = -1;
self->maxSuffixComponents = -1;
- ndn_PublisherPublicKeyDigest_init(&self->publisherPublicKeyDigest);
- ndn_Exclude_init(&self->exclude, excludeEntries, maxExcludeEntries);
+ ndn_PublisherPublicKeyDigest_initialize(&self->publisherPublicKeyDigest);
+ ndn_Exclude_initialize(&self->exclude, excludeEntries, maxExcludeEntries);
self->childSelector = -1;
self->answerOriginKind = -1;
self->scope = -1;
diff --git a/ndn-cpp/c/key.h b/ndn-cpp/c/key.h
index f6df357..9533ccb 100644
--- a/ndn-cpp/c/key.h
+++ b/ndn-cpp/c/key.h
@@ -49,12 +49,12 @@
* @param keyNameComponents The pre-allocated array of ndn_NameComponent.
* @param maxKeyNameComponents The number of elements in the allocated keyNameComponents array.
*/
-static inline void ndn_KeyLocator_init
+static inline void ndn_KeyLocator_initialize
(struct ndn_KeyLocator *self, struct ndn_NameComponent *keyNameComponents, unsigned int maxKeyNameComponents) {
self->type = (ndn_KeyLocatorType)-1;
self->keyData = 0;
self->keyDataLength = 0;
- ndn_Name_init(&self->keyName, keyNameComponents, maxKeyNameComponents);
+ ndn_Name_initialize(&self->keyName, keyNameComponents, maxKeyNameComponents);
self->keyNameType = (ndn_KeyNameType)-1;
}
diff --git a/ndn-cpp/c/name.h b/ndn-cpp/c/name.h
index 8105d60..99199c8 100644
--- a/ndn-cpp/c/name.h
+++ b/ndn-cpp/c/name.h
@@ -24,7 +24,7 @@
* @param value the pre-allocated buffer for the component value
* @param valueLength the number of bytes in value
*/
-static inline void ndn_NameComponent_init(struct ndn_NameComponent *self, unsigned char *value, unsigned int valueLength)
+static inline void ndn_NameComponent_initialize(struct ndn_NameComponent *self, unsigned char *value, unsigned int valueLength)
{
self->value = value;
self->valueLength = valueLength;
@@ -45,7 +45,7 @@
* @param components the pre-allocated array of ndn_NameComponent
* @param maxComponents the number of elements in the allocated components array
*/
-static inline void ndn_Name_init(struct ndn_Name *self, struct ndn_NameComponent *components, unsigned int maxComponents)
+static inline void ndn_Name_initialize(struct ndn_Name *self, struct ndn_NameComponent *components, unsigned int maxComponents)
{
self->components = components;
self->maxComponents = maxComponents;
diff --git a/ndn-cpp/c/publisher-public-key-digest.h b/ndn-cpp/c/publisher-public-key-digest.h
index d54bfc8..099bf5d 100644
--- a/ndn-cpp/c/publisher-public-key-digest.h
+++ b/ndn-cpp/c/publisher-public-key-digest.h
@@ -22,7 +22,7 @@
/**
* Initialize an ndn_PublisherPublicKeyDigest struct with 0 for none.
*/
-static inline void ndn_PublisherPublicKeyDigest_init(struct ndn_PublisherPublicKeyDigest *self)
+static inline void ndn_PublisherPublicKeyDigest_initialize(struct ndn_PublisherPublicKeyDigest *self)
{
self->publisherPublicKeyDigest = 0;
self->publisherPublicKeyDigestLength = 0;
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index 148c3d3..9c99698 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -26,7 +26,7 @@
* Initialize the ndn_SocketTransport struct with default values for no connection yet.
* @param self A pointer to the ndn_SocketTransport struct.
*/
-static inline void ndn_SocketTransport_init(struct ndn_SocketTransport *self)
+static inline void ndn_SocketTransport_initialize(struct ndn_SocketTransport *self)
{
self->socketDescriptor = -1;
}
diff --git a/ndn-cpp/c/transport/tcp-transport.h b/ndn-cpp/c/transport/tcp-transport.h
index 73e4e7f..3f87a51 100644
--- a/ndn-cpp/c/transport/tcp-transport.h
+++ b/ndn-cpp/c/transport/tcp-transport.h
@@ -22,9 +22,9 @@
* Initialize the ndn_TcpTransport struct with default values for no connection yet.
* @param self A pointer to the ndn_TcpTransport struct.
*/
-static inline void ndn_TcpTransport_init(struct ndn_TcpTransport *self)
+static inline void ndn_TcpTransport_initialize(struct ndn_TcpTransport *self)
{
- ndn_SocketTransport_init(&self->base);
+ ndn_SocketTransport_initialize(&self->base);
}
/**
diff --git a/ndn-cpp/c/transport/udp-transport.h b/ndn-cpp/c/transport/udp-transport.h
index be60ab6..6a09574 100644
--- a/ndn-cpp/c/transport/udp-transport.h
+++ b/ndn-cpp/c/transport/udp-transport.h
@@ -22,9 +22,9 @@
* Initialize the ndn_UdpTransport struct with default values for no connection yet.
* @param self A pointer to the ndn_UdpTransport struct.
*/
-static inline void ndn_UdpTransport_init(struct ndn_UdpTransport *self)
+static inline void ndn_UdpTransport_initialize(struct ndn_UdpTransport *self)
{
- ndn_SocketTransport_init(&self->base);
+ ndn_SocketTransport_initialize(&self->base);
}
/**
diff --git a/ndn-cpp/c/util/dynamic-uchar-array.h b/ndn-cpp/c/util/dynamic-uchar-array.h
index 101b5f3..94f852f 100644
--- a/ndn-cpp/c/util/dynamic-uchar-array.h
+++ b/ndn-cpp/c/util/dynamic-uchar-array.h
@@ -31,7 +31,7 @@
* @param length the length of the allocated array buffer
* @param reallocFunction see ndn_DynamicUCharArray_ensureLength. This may be 0.
*/
-static inline void ndn_DynamicUCharArray_init
+static inline void ndn_DynamicUCharArray_initialize
(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length,
unsigned char * (*reallocFunction)(struct ndn_DynamicUCharArray *self, unsigned char *, unsigned int))
{
diff --git a/ndn-cpp/c/util/ndn_realloc.h b/ndn-cpp/c/util/ndn_realloc.h
index 148fc2c..39aa758 100644
--- a/ndn-cpp/c/util/ndn_realloc.h
+++ b/ndn-cpp/c/util/ndn_realloc.h
@@ -14,7 +14,7 @@
/**
* Wrap the C stdlib realloc to convert to/from void * to unsigned char *.
- * This can be used by ndn_DynamicUCharArray_init.
+ * This can be used by ndn_DynamicUCharArray_initialize.
* @param self This is ignored.
* @param array the allocated array buffer to realloc.
* @param length the length for the new array buffer.
diff --git a/ndn-cpp/encoding/binary-xml-decoder.hpp b/ndn-cpp/encoding/binary-xml-decoder.hpp
index ae04831..b95082b 100644
--- a/ndn-cpp/encoding/binary-xml-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-decoder.hpp
@@ -23,7 +23,7 @@
*/
BinaryXmlDecoder(const unsigned char *input, unsigned int inputLength)
{
- ndn_BinaryXmlDecoder_init(this, (unsigned char *)input, inputLength);
+ ndn_BinaryXmlDecoder_initialize(this, (unsigned char *)input, inputLength);
}
/**
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.hpp b/ndn-cpp/encoding/binary-xml-element-reader.hpp
index ef0f9a2..826eb50 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.hpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.hpp
@@ -18,7 +18,7 @@
public:
ElementListener()
{
- ndn_ElementListener_init(this, staticOnReceivedElement);
+ ndn_ElementListener_initialize(this, staticOnReceivedElement);
}
/**
diff --git a/ndn-cpp/encoding/binary-xml-encoder.hpp b/ndn-cpp/encoding/binary-xml-encoder.hpp
index 26cd932..cee590c 100644
--- a/ndn-cpp/encoding/binary-xml-encoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-encoder.hpp
@@ -24,7 +24,7 @@
BinaryXmlEncoder()
: output_(16)
{
- ndn_BinaryXmlEncoder_init(this, &output_);
+ ndn_BinaryXmlEncoder_initialize(this, &output_);
}
/**
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index 10ab5b5..432953f 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -18,7 +18,7 @@
public:
BinaryXmlStructureDecoder()
{
- ndn_BinaryXmlStructureDecoder_init(this);
+ ndn_BinaryXmlStructureDecoder_initialize(this);
}
/**
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.cpp b/ndn-cpp/encoding/binary-xml-wire-format.cpp
index 950d653..b331e08 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.cpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.cpp
@@ -29,7 +29,7 @@
struct ndn_NameComponent nameComponents[100];
struct ndn_ExcludeEntry excludeEntries[100];
struct ndn_Interest interestStruct;
- ndn_Interest_init
+ ndn_Interest_initialize
(&interestStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]),
excludeEntries, sizeof(excludeEntries) / sizeof(excludeEntries[0]));
interest.get(interestStruct);
@@ -47,7 +47,7 @@
struct ndn_NameComponent nameComponents[100];
struct ndn_ExcludeEntry excludeEntries[100];
struct ndn_Interest interestStruct;
- ndn_Interest_init
+ ndn_Interest_initialize
(&interestStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]),
excludeEntries, sizeof(excludeEntries) / sizeof(excludeEntries[0]));
@@ -65,7 +65,7 @@
struct ndn_NameComponent nameComponents[100];
struct ndn_NameComponent keyNameComponents[100];
struct ndn_Data dataStruct;
- ndn_Data_init
+ ndn_Data_initialize
(&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]),
keyNameComponents, sizeof(keyNameComponents) / sizeof(keyNameComponents[0]));
data.get(dataStruct);
@@ -84,7 +84,7 @@
struct ndn_NameComponent nameComponents[100];
struct ndn_NameComponent keyNameComponents[100];
struct ndn_Data dataStruct;
- ndn_Data_init
+ ndn_Data_initialize
(&dataStruct, nameComponents, sizeof(nameComponents) / sizeof(nameComponents[0]),
keyNameComponents, sizeof(keyNameComponents) / sizeof(keyNameComponents[0]));
@@ -100,7 +100,7 @@
{
struct ndn_NameComponent prefixNameComponents[100];
struct ndn_ForwardingEntry forwardingEntryStruct;
- ndn_ForwardingEntry_init
+ ndn_ForwardingEntry_initialize
(&forwardingEntryStruct, prefixNameComponents, sizeof(prefixNameComponents) / sizeof(prefixNameComponents[0]));
forwardingEntry.get(forwardingEntryStruct);
@@ -116,7 +116,7 @@
{
struct ndn_NameComponent prefixNameComponents[100];
struct ndn_ForwardingEntry forwardingEntryStruct;
- ndn_ForwardingEntry_init
+ ndn_ForwardingEntry_initialize
(&forwardingEntryStruct, prefixNameComponents, sizeof(prefixNameComponents) / sizeof(prefixNameComponents[0]));
BinaryXmlDecoder decoder(input, inputLength);
diff --git a/ndn-cpp/node.cpp b/ndn-cpp/node.cpp
index 92cd538..996fb64 100644
--- a/ndn-cpp/node.cpp
+++ b/ndn-cpp/node.cpp
@@ -156,7 +156,7 @@
vector<struct ndn_NameComponent> nameComponents;
nameComponents.reserve(name.getComponentCount());
struct ndn_Name nameStruct;
- ndn_Name_init(&nameStruct, &nameComponents[0], nameComponents.capacity());
+ ndn_Name_initialize(&nameStruct, &nameComponents[0], nameComponents.capacity());
name.get(nameStruct);
int iResult = -1;
@@ -206,7 +206,7 @@
// TODO: Doesn't this belong in the Interest class?
nameComponents_.reserve(interest_->getName().getComponentCount());
excludeEntries_.reserve(interest_->getExclude().getEntryCount());
- ndn_Interest_init
+ ndn_Interest_initialize
(&interestStruct_, &nameComponents_[0], nameComponents_.capacity(), &excludeEntries_[0], excludeEntries_.capacity());
interest_->get(interestStruct_);
}
diff --git a/ndn-cpp/transport/tcp-transport.cpp b/ndn-cpp/transport/tcp-transport.cpp
index 757823d..7c55d04 100644
--- a/ndn-cpp/transport/tcp-transport.cpp
+++ b/ndn-cpp/transport/tcp-transport.cpp
@@ -27,7 +27,7 @@
// TODO: This belongs in the socket listener.
const unsigned int initialLength = 1000;
// Automatically cast elementReader_ to (struct ndn_ElementListener *)
- ndn_BinaryXmlElementReader_init
+ ndn_BinaryXmlElementReader_initialize
(&elementReader_, &elementListener, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
isConnected_ = true;
diff --git a/ndn-cpp/transport/tcp-transport.hpp b/ndn-cpp/transport/tcp-transport.hpp
index fa3bd47..b9c12bb 100644
--- a/ndn-cpp/transport/tcp-transport.hpp
+++ b/ndn-cpp/transport/tcp-transport.hpp
@@ -52,7 +52,7 @@
TcpTransport()
: elementListener_(0), isConnected_(false)
{
- ndn_TcpTransport_init(&transport_);
+ ndn_TcpTransport_initialize(&transport_);
elementReader_.partialData.array = 0;
}
diff --git a/ndn-cpp/transport/udp-transport.cpp b/ndn-cpp/transport/udp-transport.cpp
index 4097b90..e877a1f 100644
--- a/ndn-cpp/transport/udp-transport.cpp
+++ b/ndn-cpp/transport/udp-transport.cpp
@@ -27,7 +27,7 @@
// TODO: This belongs in the socket listener.
const unsigned int initialLength = 1000;
// Automatically cast elementReader_ to (struct ndn_ElementListener *)
- ndn_BinaryXmlElementReader_init
+ ndn_BinaryXmlElementReader_initialize
(&elementReader_, &elementListener, (unsigned char *)malloc(initialLength), initialLength, ndn_realloc);
isConnected_ = true;
diff --git a/ndn-cpp/transport/udp-transport.hpp b/ndn-cpp/transport/udp-transport.hpp
index 80699d2..3df6f93 100644
--- a/ndn-cpp/transport/udp-transport.hpp
+++ b/ndn-cpp/transport/udp-transport.hpp
@@ -52,7 +52,7 @@
UdpTransport()
: elementListener_(0), isConnected_(false)
{
- ndn_UdpTransport_init(&transport_);
+ ndn_UdpTransport_initialize(&transport_);
elementReader_.partialData.array = 0;
}
diff --git a/ndn-cpp/util/dynamic-uchar-vector.cpp b/ndn-cpp/util/dynamic-uchar-vector.cpp
index b7957c5..200f1f9 100644
--- a/ndn-cpp/util/dynamic-uchar-vector.cpp
+++ b/ndn-cpp/util/dynamic-uchar-vector.cpp
@@ -12,7 +12,7 @@
DynamicUCharVector::DynamicUCharVector(unsigned int initialLength)
: vector_(new vector<unsigned char>(initialLength))
{
- ndn_DynamicUCharArray_init(this, &vector_->front(), initialLength, DynamicUCharVector::realloc);
+ ndn_DynamicUCharArray_initialize(this, &vector_->front(), initialLength, DynamicUCharVector::realloc);
}
unsigned char *DynamicUCharVector::realloc(struct ndn_DynamicUCharArray *self, unsigned char *array, unsigned int length)