Cody style: Replace init with initialize.
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