Convert tabs to spaces.
diff --git a/ndn-cpp/c/encoding/binary-xml-element-reader.h b/ndn-cpp/c/encoding/binary-xml-element-reader.h
index 2b09e25..85ea934 100644
--- a/ndn-cpp/c/encoding/binary-xml-element-reader.h
+++ b/ndn-cpp/c/encoding/binary-xml-element-reader.h
@@ -4,13 +4,13 @@
*/
#ifndef NDN_BINARYXMLELEMENTREADER_H
-#define NDN_BINARYXMLELEMENTREADER_H
+#define NDN_BINARYXMLELEMENTREADER_H
#include "../errors.h"
#include "binary-xml-structure-decoder.h"
#include "../util/dynamic-uchar-array.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -76,7 +76,7 @@
ndn_Error ndn_BinaryXmlElementReader_onReceivedData
(struct ndn_BinaryXmlElementReader *self, unsigned char *data, unsigned int dataLength);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.c b/ndn-cpp/c/encoding/binary-xml-encoder.c
index 0734bca..6754e20 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.c
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.c
@@ -30,7 +30,7 @@
return error;
ndn_memcpy(self->output.array + self->offset, array, arrayLength);
- self->offset += arrayLength;
+ self->offset += arrayLength;
return NDN_ERROR_success;
}
@@ -41,24 +41,24 @@
static unsigned int getNHeaderEncodingBytes(unsigned int x)
{
// Do a quick check for pre-compiled results.
- if (x <= ENCODING_LIMIT_1_BYTE)
+ if (x <= ENCODING_LIMIT_1_BYTE)
return 1;
- if (x <= ENCODING_LIMIT_2_BYTES)
+ if (x <= ENCODING_LIMIT_2_BYTES)
return 2;
- if (x <= ENCODING_LIMIT_3_BYTES)
+ if (x <= ENCODING_LIMIT_3_BYTES)
return 3;
-
- unsigned int nBytes = 1;
-
- // Last byte gives you TT_VALUE_BITS.
- // Remainder each gives you REGULAR_VALUE_BITS.
- x >>= ndn_BinaryXml_TT_VALUE_BITS;
- while (x != 0) {
- ++nBytes;
- x >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
- }
- return nBytes;
+ unsigned int nBytes = 1;
+
+ // Last byte gives you TT_VALUE_BITS.
+ // Remainder each gives you REGULAR_VALUE_BITS.
+ x >>= ndn_BinaryXml_TT_VALUE_BITS;
+ while (x != 0) {
+ ++nBytes;
+ x >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
+ }
+
+ return nBytes;
}
/**
@@ -172,34 +172,34 @@
ndn_Error ndn_BinaryXmlEncoder_encodeTypeAndValue(struct ndn_BinaryXmlEncoder *self, unsigned int type, unsigned int value)
{
- if (type > ndn_BinaryXml_UDATA)
- return NDN_ERROR_header_type_is_out_of_range;
+ if (type > ndn_BinaryXml_UDATA)
+ return NDN_ERROR_header_type_is_out_of_range;
- // Encode backwards. Calculate how many bytes we need.
- unsigned int nEncodingBytes = getNHeaderEncodingBytes(value);
+ // Encode backwards. Calculate how many bytes we need.
+ unsigned int nEncodingBytes = getNHeaderEncodingBytes(value);
ndn_Error error;
if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + nEncodingBytes)))
return error;
- // Bottom 4 bits of value go in last byte with tag.
- self->output.array[self->offset + nEncodingBytes - 1] =
- (ndn_BinaryXml_TT_MASK & type |
- ((ndn_BinaryXml_TT_VALUE_MASK & value) << ndn_BinaryXml_TT_BITS)) |
- ndn_BinaryXml_TT_FINAL; // set top bit for last byte
- value >>= ndn_BinaryXml_TT_VALUE_BITS;
-
- // Rest of value goes into preceding bytes, 7 bits per byte. (Zero top bit is "more" flag.)
- unsigned int i = self->offset + nEncodingBytes - 2;
- while (value != 0 && i >= self->offset) {
- self->output.array[i] = (value & ndn_BinaryXml_REGULAR_VALUE_MASK);
- value >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
- --i;
- }
- if (value != 0)
+ // Bottom 4 bits of value go in last byte with tag.
+ self->output.array[self->offset + nEncodingBytes - 1] =
+ (ndn_BinaryXml_TT_MASK & type |
+ ((ndn_BinaryXml_TT_VALUE_MASK & value) << ndn_BinaryXml_TT_BITS)) |
+ ndn_BinaryXml_TT_FINAL; // set top bit for last byte
+ value >>= ndn_BinaryXml_TT_VALUE_BITS;
+
+ // Rest of value goes into preceding bytes, 7 bits per byte. (Zero top bit is "more" flag.)
+ unsigned int i = self->offset + nEncodingBytes - 2;
+ while (value != 0 && i >= self->offset) {
+ self->output.array[i] = (value & ndn_BinaryXml_REGULAR_VALUE_MASK);
+ value >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
+ --i;
+ }
+ if (value != 0)
// This should not happen if getNHeaderEncodingBytes is correct.
- return NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes;
-
- self->offset+= nEncodingBytes;
+ return NDN_ERROR_encodeTypeAndValue_miscalculated_N_encoding_bytes;
+
+ self->offset+= nEncodingBytes;
return NDN_ERROR_success;
}
@@ -210,8 +210,8 @@
if ((error = ndn_DynamicUCharArray_ensureLength(&self->output, self->offset + 1)))
return error;
- self->output.array[self->offset] = ndn_BinaryXml_CLOSE;
- self->offset += 1;
+ self->output.array[self->offset] = ndn_BinaryXml_CLOSE;
+ self->offset += 1;
return NDN_ERROR_success;
}
diff --git a/ndn-cpp/c/encoding/binary-xml-encoder.h b/ndn-cpp/c/encoding/binary-xml-encoder.h
index 309a789..ba67e8f 100644
--- a/ndn-cpp/c/encoding/binary-xml-encoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-encoder.h
@@ -4,13 +4,13 @@
*/
#ifndef NDN_BINARYXMLENCODER_H
-#define NDN_BINARYXMLENCODER_H
+#define NDN_BINARYXMLENCODER_H
#include "../errors.h"
#include "../util/dynamic-uchar-array.h"
#include "binary-xml.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -172,7 +172,7 @@
return NDN_ERROR_success;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.c b/ndn-cpp/c/encoding/binary-xml-interest.c
index b5c17a4..a540222 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.c
+++ b/ndn-cpp/c/encoding/binary-xml-interest.c
@@ -32,14 +32,14 @@
else if (entry->type == ndn_Exclude_ANY) {
if ((error = ndn_BinaryXmlEncoder_writeElementStartDTag(encoder, ndn_BinaryXml_DTag_Any)))
return error;
- if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
+ if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;
}
else
return NDN_ERROR_unrecognized_ndn_ExcludeType;
- }
+ }
- if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
+ if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;
return NDN_ERROR_success;
@@ -163,7 +163,7 @@
(encoder, ndn_BinaryXml_DTag_Nonce, interest->nonce, interest->nonceLength)))
return error;
- if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
+ if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;
return NDN_ERROR_success;
diff --git a/ndn-cpp/c/encoding/binary-xml-interest.h b/ndn-cpp/c/encoding/binary-xml-interest.h
index a1c9631..e8c955b 100644
--- a/ndn-cpp/c/encoding/binary-xml-interest.h
+++ b/ndn-cpp/c/encoding/binary-xml-interest.h
@@ -4,14 +4,14 @@
*/
#ifndef NDN_BINARYXMLINTEREST_H
-#define NDN_BINARYXMLINTEREST_H
+#define NDN_BINARYXMLINTEREST_H
#include "../errors.h"
#include "../interest.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -19,7 +19,7 @@
ndn_Error ndn_decodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_BinaryXmlDecoder *decoder);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-key.c b/ndn-cpp/c/encoding/binary-xml-key.c
index 4375c6c..5b6de79 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.c
+++ b/ndn-cpp/c/encoding/binary-xml-key.c
@@ -33,7 +33,7 @@
else
return NDN_ERROR_unrecognized_ndn_KeyLocatorType;
- if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
+ if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;
return NDN_ERROR_success;
diff --git a/ndn-cpp/c/encoding/binary-xml-key.h b/ndn-cpp/c/encoding/binary-xml-key.h
index 38c7420..c069356 100644
--- a/ndn-cpp/c/encoding/binary-xml-key.h
+++ b/ndn-cpp/c/encoding/binary-xml-key.h
@@ -4,14 +4,14 @@
*/
#ifndef NDN_BINARYXMLKEY_H
-#define NDN_BINARYXMLKEY_H
+#define NDN_BINARYXMLKEY_H
#include "../errors.h"
#include "../key.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -40,7 +40,7 @@
*/
ndn_Error ndn_decodeOptionalBinaryXmlKeyLocator(struct ndn_KeyLocator *keyLocator, struct ndn_BinaryXmlDecoder *decoder);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-name.c b/ndn-cpp/c/encoding/binary-xml-name.c
index 776965a..fb99070 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.c
+++ b/ndn-cpp/c/encoding/binary-xml-name.c
@@ -19,9 +19,9 @@
if ((error = ndn_BinaryXmlEncoder_writeBlobDTagElement
(encoder, ndn_BinaryXml_DTag_Component, name->components[i].value, name->components[i].valueLength)))
return error;
- }
+ }
- if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
+ if ((error = ndn_BinaryXmlEncoder_writeElementClose(encoder)))
return error;
return NDN_ERROR_success;
diff --git a/ndn-cpp/c/encoding/binary-xml-name.h b/ndn-cpp/c/encoding/binary-xml-name.h
index db2d3cd..6590aaa 100644
--- a/ndn-cpp/c/encoding/binary-xml-name.h
+++ b/ndn-cpp/c/encoding/binary-xml-name.h
@@ -4,14 +4,14 @@
*/
#ifndef NDN_BINARYXMLNAME_H
-#define NDN_BINARYXMLNAME_H
+#define NDN_BINARYXMLNAME_H
#include "../errors.h"
#include "../name.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -19,7 +19,7 @@
ndn_Error ndn_decodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlDecoder *decoder);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.h b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.h
index c6017b1..a649003 100644
--- a/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.h
+++ b/ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.h
@@ -4,14 +4,14 @@
*/
#ifndef NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
-#define NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
+#define NDN_BINARYXMLPUBLISHERPUBLICKEYDIGEST_H
#include "../errors.h"
#include "../publisher-public-key-digest.h"
#include "binary-xml-encoder.h"
#include "binary-xml-decoder.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -44,7 +44,7 @@
ndn_Error ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest
(struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
index 8c561a1..54c8648 100644
--- a/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
+++ b/ndn-cpp/c/encoding/binary-xml-structure-decoder.h
@@ -4,11 +4,11 @@
*/
#ifndef NDN_BINARYXMLSTRUCTUREDECODER_H
-#define NDN_BINARYXMLSTRUCTUREDECODER_H
+#define NDN_BINARYXMLSTRUCTUREDECODER_H
#include "../errors.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -54,7 +54,7 @@
self->offset = offset;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/interest.h b/ndn-cpp/c/interest.h
index 3248835..b596c50 100644
--- a/ndn-cpp/c/interest.h
+++ b/ndn-cpp/c/interest.h
@@ -4,12 +4,12 @@
*/
#ifndef NDN_INTEREST_H
-#define NDN_INTEREST_H
+#define NDN_INTEREST_H
#include "name.h"
#include "publisher-public-key-digest.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -67,8 +67,8 @@
ndn_Interest_CHILD_SELECTOR_RIGHT = 1,
ndn_Interest_ANSWER_CONTENT_STORE = 1,
ndn_Interest_ANSWER_GENERATED = 2,
- ndn_Interest_ANSWER_STALE = 4, // Stale answer OK
- ndn_Interest_MARK_STALE = 16, // Must have scope 0. Michael calls this a "hack"
+ ndn_Interest_ANSWER_STALE = 4, // Stale answer OK
+ ndn_Interest_MARK_STALE = 16, // Must have scope 0. Michael calls this a "hack"
ndn_Interest_DEFAULT_ANSWER_ORIGIN_KIND = ndn_Interest_ANSWER_CONTENT_STORE | ndn_Interest_ANSWER_GENERATED
};
@@ -78,15 +78,15 @@
*/
struct ndn_Interest {
struct ndn_Name name;
- int minSuffixComponents; /**< -1 for none */
- int maxSuffixComponents; /**< -1 for none */
+ int minSuffixComponents; /**< -1 for none */
+ int maxSuffixComponents; /**< -1 for none */
struct ndn_PublisherPublicKeyDigest publisherPublicKeyDigest;
- struct ndn_Exclude exclude;
- int childSelector; /**< -1 for none */
- int answerOriginKind; /**< -1 for none */
- int scope; /**< -1 for none */
- double interestLifetimeMilliseconds; /**< milliseconds. -1.0 for none */
- unsigned char *nonce; /**< pointer to pre-allocated buffer. 0 for none */
+ struct ndn_Exclude exclude;
+ int childSelector; /**< -1 for none */
+ int answerOriginKind; /**< -1 for none */
+ int scope; /**< -1 for none */
+ double interestLifetimeMilliseconds; /**< milliseconds. -1.0 for none */
+ unsigned char *nonce; /**< pointer to pre-allocated buffer. 0 for none */
unsigned int nonceLength; /**< length of nonce. 0 for none */
};
@@ -104,19 +104,19 @@
struct ndn_ExcludeEntry *excludeEntries, unsigned int maxExcludeEntries)
{
ndn_Name_init(&self->name, nameComponents, maxNameComponents);
- self->minSuffixComponents = -1;
+ self->minSuffixComponents = -1;
self->maxSuffixComponents = -1;
ndn_PublisherPublicKeyDigest_init(&self->publisherPublicKeyDigest);
ndn_Exclude_init(&self->exclude, excludeEntries, maxExcludeEntries);
- self->childSelector = -1;
- self->answerOriginKind = -1;
- self->scope = -1;
- self->interestLifetimeMilliseconds = -1.0;
- self->nonce = 0;
- self->nonceLength = 0;
+ self->childSelector = -1;
+ self->answerOriginKind = -1;
+ self->scope = -1;
+ self->interestLifetimeMilliseconds = -1.0;
+ self->nonce = 0;
+ self->nonceLength = 0;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/key.h b/ndn-cpp/c/key.h
index 22ac0c4..0f599d5 100644
--- a/ndn-cpp/c/key.h
+++ b/ndn-cpp/c/key.h
@@ -4,9 +4,9 @@
*/
#ifndef NDN_KEY_H
-#define NDN_KEY_H
+#define NDN_KEY_H
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -31,7 +31,7 @@
// TODO: Implement keyName.
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/name.h b/ndn-cpp/c/name.h
index 8096393..b7be236 100644
--- a/ndn-cpp/c/name.h
+++ b/ndn-cpp/c/name.h
@@ -4,9 +4,9 @@
*/
#ifndef NDN_NAME_H
-#define NDN_NAME_H
+#define NDN_NAME_H
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -52,7 +52,7 @@
self->nComponents = 0;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/publisher-public-key-digest.h b/ndn-cpp/c/publisher-public-key-digest.h
index 57b85f2..d54bfc8 100644
--- a/ndn-cpp/c/publisher-public-key-digest.h
+++ b/ndn-cpp/c/publisher-public-key-digest.h
@@ -4,9 +4,9 @@
*/
#ifndef NDN_PUBLISHERPUBLICKEYDIGEST_H
-#define NDN_PUBLISHERPUBLICKEYDIGEST_H
+#define NDN_PUBLISHERPUBLICKEYDIGEST_H
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -15,7 +15,7 @@
* We make a separate struct since this is used by multiple other structs.
*/
struct ndn_PublisherPublicKeyDigest {
- unsigned char *publisherPublicKeyDigest; /**< pointer to pre-allocated buffer. 0 for none */
+ unsigned char *publisherPublicKeyDigest; /**< pointer to pre-allocated buffer. 0 for none */
unsigned int publisherPublicKeyDigestLength; /**< length of publisherPublicKeyDigest. 0 for none */
};
@@ -28,7 +28,7 @@
self->publisherPublicKeyDigestLength = 0;
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/transport/socket-transport.c b/ndn-cpp/c/transport/socket-transport.c
index d48c794..a6fcbac 100644
--- a/ndn-cpp/c/transport/socket-transport.c
+++ b/ndn-cpp/c/transport/socket-transport.c
@@ -22,9 +22,9 @@
self->socketDescriptor = -1;
}
- struct addrinfo hints;
- ndn_memset((unsigned char *)&hints, 0, sizeof(hints));
- hints.ai_family = AF_UNSPEC;
+ struct addrinfo hints;
+ ndn_memset((unsigned char *)&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC;
if (socketType == SOCKET_TCP)
hints.ai_socktype = SOCK_STREAM;
else if (socketType == SOCKET_UDP)
@@ -35,31 +35,31 @@
char portString[10];
sprintf(portString, "%d", port);
- struct addrinfo *serverInfo;
- if (getaddrinfo(host, portString, &hints, &serverInfo) != 0)
- return NDN_ERROR_SocketTransport_error_in_getaddrinfo;
+ struct addrinfo *serverInfo;
+ if (getaddrinfo(host, portString, &hints, &serverInfo) != 0)
+ return NDN_ERROR_SocketTransport_error_in_getaddrinfo;
- // loop through all the results and connect to the first we can
- struct addrinfo *p;
+ // loop through all the results and connect to the first we can
+ struct addrinfo *p;
int socketDescriptor;
- for(p = serverInfo; p != NULL; p = p->ai_next) {
- if ((socketDescriptor = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
- continue;
+ for(p = serverInfo; p != NULL; p = p->ai_next) {
+ if ((socketDescriptor = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1)
+ continue;
- if (connect(socketDescriptor, p->ai_addr, p->ai_addrlen) == -1) {
- close(socketDescriptor);
- continue;
- }
+ if (connect(socketDescriptor, p->ai_addr, p->ai_addrlen) == -1) {
+ close(socketDescriptor);
+ continue;
+ }
- break;
- }
-
- if (p == NULL) {
- freeaddrinfo(serverInfo);
- return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
+ break;
}
- freeaddrinfo(serverInfo);
+ if (p == NULL) {
+ freeaddrinfo(serverInfo);
+ return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
+ }
+
+ freeaddrinfo(serverInfo);
self->socketDescriptor = socketDescriptor;
return NDN_ERROR_success;
@@ -91,12 +91,12 @@
return NDN_ERROR_SocketTransport_socket_is_not_open;
int nBytes;
- if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
+ if ((nBytes = recv(self->socketDescriptor, buffer, bufferLength, 0)) == -1)
return NDN_ERROR_SocketTransport_error_in_recv;
*nBytesOut = (unsigned int)nBytes;
- return NDN_ERROR_success;
+ return NDN_ERROR_success;
}
ndn_Error ndn_SocketTransport_close(struct ndn_SocketTransport *self)
diff --git a/ndn-cpp/c/transport/socket-transport.h b/ndn-cpp/c/transport/socket-transport.h
index 6973d19..0011e26 100644
--- a/ndn-cpp/c/transport/socket-transport.h
+++ b/ndn-cpp/c/transport/socket-transport.h
@@ -4,12 +4,12 @@
*/
#ifndef NDN_SOCKETTRANSPORT_H
-#define NDN_SOCKETTRANSPORT_H
+#define NDN_SOCKETTRANSPORT_H
#include <sys/socket.h>
#include "../errors.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -36,7 +36,7 @@
ndn_Error ndn_SocketTransport_close(struct ndn_SocketTransport *self);
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/transport/tcp-transport.h b/ndn-cpp/c/transport/tcp-transport.h
index 9a4787b..f0b5d0c 100644
--- a/ndn-cpp/c/transport/tcp-transport.h
+++ b/ndn-cpp/c/transport/tcp-transport.h
@@ -6,11 +6,11 @@
*/
#ifndef NDN_TCPTRANSPORT_H
-#define NDN_TCPTRANSPORT_H
+#define NDN_TCPTRANSPORT_H
#include "socket-transport.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -44,7 +44,7 @@
return ndn_SocketTransport_close(&self->base);
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/transport/udp-transport.h b/ndn-cpp/c/transport/udp-transport.h
index c6e77bf..82aee19 100644
--- a/ndn-cpp/c/transport/udp-transport.h
+++ b/ndn-cpp/c/transport/udp-transport.h
@@ -6,11 +6,11 @@
*/
#ifndef NDN_UDPTRANSPORT_H
-#define NDN_UDPTRANSPORT_H
+#define NDN_UDPTRANSPORT_H
#include "socket-transport.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -44,7 +44,7 @@
return ndn_SocketTransport_close(&self->base);
}
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/c/util/dynamic-uchar-array.h b/ndn-cpp/c/util/dynamic-uchar-array.h
index 9543721..cdcdcdd 100644
--- a/ndn-cpp/c/util/dynamic-uchar-array.h
+++ b/ndn-cpp/c/util/dynamic-uchar-array.h
@@ -4,12 +4,12 @@
*/
#ifndef NDN_DYNAMICUCHARARRAY_H
-#define NDN_DYNAMICUCHARARRAY_H
+#define NDN_DYNAMICUCHARARRAY_H
#include "../errors.h"
#include "ndn_memory.h"
-#ifdef __cplusplus
+#ifdef __cplusplus
extern "C" {
#endif
@@ -81,7 +81,7 @@
return NDN_ERROR_success;
};
-#ifdef __cplusplus
+#ifdef __cplusplus
}
#endif
diff --git a/ndn-cpp/closure.hpp b/ndn-cpp/closure.hpp
index 9055157..e8cc191 100644
--- a/ndn-cpp/closure.hpp
+++ b/ndn-cpp/closure.hpp
@@ -8,7 +8,7 @@
*/
#ifndef NDN_CLOSURE_HPP
-#define NDN_CLOSURE_HPP
+#define NDN_CLOSURE_HPP
#include "common.hpp"
diff --git a/ndn-cpp/encoding/binary-xml-element-reader.hpp b/ndn-cpp/encoding/binary-xml-element-reader.hpp
index 96c0a5e..36342ab 100644
--- a/ndn-cpp/encoding/binary-xml-element-reader.hpp
+++ b/ndn-cpp/encoding/binary-xml-element-reader.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_BINARYXMLELEMENTREADER_HPP
-#define NDN_BINARYXMLELEMENTREADER_HPP
+#define NDN_BINARYXMLELEMENTREADER_HPP
#include "../c/encoding/binary-xml-element-reader.h"
diff --git a/ndn-cpp/encoding/binary-xml-encoder.hpp b/ndn-cpp/encoding/binary-xml-encoder.hpp
index 3bf1f45..6373466 100644
--- a/ndn-cpp/encoding/binary-xml-encoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-encoder.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_BINARYXMLENCODER_HPP
-#define NDN_BINARYXMLENCODER_HPP
+#define NDN_BINARYXMLENCODER_HPP
#include <vector>
#include "../common.hpp"
diff --git a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
index e83dd5b..10ab5b5 100644
--- a/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
+++ b/ndn-cpp/encoding/binary-xml-structure-decoder.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_BINARYXMLSTRUCTUREDECODER_HPP
-#define NDN_BINARYXMLSTRUCTUREDECODER_HPP
+#define NDN_BINARYXMLSTRUCTUREDECODER_HPP
#include <stdexcept>
#include "../c/encoding/BinaryXMLStructureDecoder.h"
diff --git a/ndn-cpp/encoding/binary-xml-wire-format.hpp b/ndn-cpp/encoding/binary-xml-wire-format.hpp
index e9e4802..c327d17 100644
--- a/ndn-cpp/encoding/binary-xml-wire-format.hpp
+++ b/ndn-cpp/encoding/binary-xml-wire-format.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_BINARYXMLWIREFORMAT_HPP
-#define NDN_BINARYXMLWIREFORMAT_HPP
+#define NDN_BINARYXMLWIREFORMAT_HPP
#include "wire-format.hpp"
diff --git a/ndn-cpp/encoding/wire-format.hpp b/ndn-cpp/encoding/wire-format.hpp
index 32bf82f..c229131 100644
--- a/ndn-cpp/encoding/wire-format.hpp
+++ b/ndn-cpp/encoding/wire-format.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_WIREFORMAT_HPP
-#define NDN_WIREFORMAT_HPP
+#define NDN_WIREFORMAT_HPP
#include "../common.hpp"
#include <vector>
diff --git a/ndn-cpp/interest.cpp b/ndn-cpp/interest.cpp
index 7aa7e35..5417fa0 100644
--- a/ndn-cpp/interest.cpp
+++ b/ndn-cpp/interest.cpp
@@ -39,16 +39,16 @@
void Interest::set(const struct ndn_Interest &interestStruct)
{
name_.set(interestStruct.name);
- minSuffixComponents_ = interestStruct.minSuffixComponents;
- maxSuffixComponents_ = interestStruct.maxSuffixComponents;
-
- publisherPublicKeyDigest_.set(interestStruct.publisherPublicKeyDigest);
+ minSuffixComponents_ = interestStruct.minSuffixComponents;
+ maxSuffixComponents_ = interestStruct.maxSuffixComponents;
+
+ publisherPublicKeyDigest_.set(interestStruct.publisherPublicKeyDigest);
exclude_.set(interestStruct.exclude);
- childSelector_ = interestStruct.childSelector;
- answerOriginKind_ = interestStruct.answerOriginKind;
- scope_ = interestStruct.scope;
- interestLifetimeMilliseconds_ = interestStruct.interestLifetimeMilliseconds;
+ childSelector_ = interestStruct.childSelector;
+ answerOriginKind_ = interestStruct.answerOriginKind;
+ scope_ = interestStruct.scope;
+ interestLifetimeMilliseconds_ = interestStruct.interestLifetimeMilliseconds;
setVector(nonce_, interestStruct.nonce, interestStruct.nonceLength);
}
diff --git a/ndn-cpp/interest.hpp b/ndn-cpp/interest.hpp
index ddc6fce..ed5835b 100644
--- a/ndn-cpp/interest.hpp
+++ b/ndn-cpp/interest.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_INTEREST_HPP
-#define NDN_INTEREST_HPP
+#define NDN_INTEREST_HPP
#include "name.hpp"
#include "publisher-public-key-digest.hpp"
@@ -110,7 +110,7 @@
}
private:
- std::vector<ExcludeEntry> entries_;
+ std::vector<ExcludeEntry> entries_;
};
/**
@@ -120,14 +120,14 @@
public:
Interest()
{
- construct();
+ construct();
}
Interest(const Name &name)
: name_(name)
{
name_ = name;
- construct();
+ construct();
}
Interest(const Name &name, int minSuffixComponents, int maxSuffixComponents,
@@ -218,24 +218,24 @@
private:
void construct()
{
- minSuffixComponents_ = -1;
- maxSuffixComponents_ = -1;
- childSelector_ = -1;
- answerOriginKind_ = -1;
- scope_ = -1;
- interestLifetimeMilliseconds_ = -1.0;
+ minSuffixComponents_ = -1;
+ maxSuffixComponents_ = -1;
+ childSelector_ = -1;
+ answerOriginKind_ = -1;
+ scope_ = -1;
+ interestLifetimeMilliseconds_ = -1.0;
}
Name name_;
- int minSuffixComponents_;
- int maxSuffixComponents_;
- PublisherPublicKeyDigest publisherPublicKeyDigest_;
+ int minSuffixComponents_;
+ int maxSuffixComponents_;
+ PublisherPublicKeyDigest publisherPublicKeyDigest_;
Exclude exclude_;
- int childSelector_;
- int answerOriginKind_;
- int scope_;
- double interestLifetimeMilliseconds_;
- std::vector<unsigned char> nonce_;
+ int childSelector_;
+ int answerOriginKind_;
+ int scope_;
+ double interestLifetimeMilliseconds_;
+ std::vector<unsigned char> nonce_;
};
}
diff --git a/ndn-cpp/key-chain.hpp b/ndn-cpp/key-chain.hpp
index 63863aa..97991e9 100644
--- a/ndn-cpp/key-chain.hpp
+++ b/ndn-cpp/key-chain.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_KEY_CHAIN_HPP
-#define NDN_KEY_CHAIN_HPP
+#define NDN_KEY_CHAIN_HPP
#include "data.hpp"
diff --git a/ndn-cpp/key.hpp b/ndn-cpp/key.hpp
index d137b60..a715bf3 100644
--- a/ndn-cpp/key.hpp
+++ b/ndn-cpp/key.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_KEY_HPP
-#define NDN_KEY_HPP
+#define NDN_KEY_HPP
#include <vector>
#include "c/key.h"
diff --git a/ndn-cpp/name.hpp b/ndn-cpp/name.hpp
index f287f47..5d707a3 100644
--- a/ndn-cpp/name.hpp
+++ b/ndn-cpp/name.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_NAME_HPP
-#define NDN_NAME_HPP
+#define NDN_NAME_HPP
#include <vector>
#include <string>
diff --git a/ndn-cpp/publisher-public-key-digest.hpp b/ndn-cpp/publisher-public-key-digest.hpp
index 0926f43..02009b9 100644
--- a/ndn-cpp/publisher-public-key-digest.hpp
+++ b/ndn-cpp/publisher-public-key-digest.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_PUBLISHERPUBLICKEYDIGEST_HPP
-#define NDN_PUBLISHERPUBLICKEYDIGEST_HPP
+#define NDN_PUBLISHERPUBLICKEYDIGEST_HPP
#include <vector>
#include "common.hpp"
@@ -55,7 +55,7 @@
}
private:
- std::vector<unsigned char> publisherPublicKeyDigest_;
+ std::vector<unsigned char> publisherPublicKeyDigest_;
};
}
diff --git a/ndn-cpp/transport/tcp-transport.hpp b/ndn-cpp/transport/tcp-transport.hpp
index d695b58..6cc5fc9 100644
--- a/ndn-cpp/transport/tcp-transport.hpp
+++ b/ndn-cpp/transport/tcp-transport.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_TCPTRANSPORT_HPP
-#define NDN_TCPTRANSPORT_HPP
+#define NDN_TCPTRANSPORT_HPP
#include "../c/transport/tcp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"
diff --git a/ndn-cpp/transport/transport.hpp b/ndn-cpp/transport/transport.hpp
index de2b7e5..c465aa4 100644
--- a/ndn-cpp/transport/transport.hpp
+++ b/ndn-cpp/transport/transport.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_TRANSPORT_HPP
-#define NDN_TRANSPORT_HPP
+#define NDN_TRANSPORT_HPP
#include <vector>
diff --git a/ndn-cpp/transport/udp-transport.hpp b/ndn-cpp/transport/udp-transport.hpp
index 7e31cf7..0aaa2f4 100644
--- a/ndn-cpp/transport/udp-transport.hpp
+++ b/ndn-cpp/transport/udp-transport.hpp
@@ -4,7 +4,7 @@
*/
#ifndef NDN_UDPTRANSPORT_HPP
-#define NDN_UDPTRANSPORT_HPP
+#define NDN_UDPTRANSPORT_HPP
#include "../c/transport/udp-transport.h"
#include "../c/encoding/binary-xml-element-reader.h"