Browse Source

Convert tabs to spaces.

pull/1/head
Jeff Thompson 12 years ago
parent
commit
2d27e2f70a
  1. 6
      ndn-cpp/c/encoding/binary-xml-element-reader.h
  2. 76
      ndn-cpp/c/encoding/binary-xml-encoder.c
  3. 6
      ndn-cpp/c/encoding/binary-xml-encoder.h
  4. 8
      ndn-cpp/c/encoding/binary-xml-interest.c
  5. 6
      ndn-cpp/c/encoding/binary-xml-interest.h
  6. 2
      ndn-cpp/c/encoding/binary-xml-key.c
  7. 6
      ndn-cpp/c/encoding/binary-xml-key.h
  8. 4
      ndn-cpp/c/encoding/binary-xml-name.c
  9. 6
      ndn-cpp/c/encoding/binary-xml-name.h
  10. 6
      ndn-cpp/c/encoding/binary-xml-publisher-public-key-digest.h
  11. 6
      ndn-cpp/c/encoding/binary-xml-structure-decoder.h
  12. 40
      ndn-cpp/c/interest.h
  13. 6
      ndn-cpp/c/key.h
  14. 6
      ndn-cpp/c/name.h
  15. 8
      ndn-cpp/c/publisher-public-key-digest.h
  16. 44
      ndn-cpp/c/transport/socket-transport.c
  17. 6
      ndn-cpp/c/transport/socket-transport.h
  18. 6
      ndn-cpp/c/transport/tcp-transport.h
  19. 6
      ndn-cpp/c/transport/udp-transport.h
  20. 6
      ndn-cpp/c/util/dynamic-uchar-array.h
  21. 2
      ndn-cpp/closure.hpp
  22. 2
      ndn-cpp/encoding/binary-xml-element-reader.hpp
  23. 2
      ndn-cpp/encoding/binary-xml-encoder.hpp
  24. 2
      ndn-cpp/encoding/binary-xml-structure-decoder.hpp
  25. 2
      ndn-cpp/encoding/binary-xml-wire-format.hpp
  26. 2
      ndn-cpp/encoding/wire-format.hpp
  27. 16
      ndn-cpp/interest.cpp
  28. 36
      ndn-cpp/interest.hpp
  29. 2
      ndn-cpp/key-chain.hpp
  30. 2
      ndn-cpp/key.hpp
  31. 2
      ndn-cpp/name.hpp
  32. 4
      ndn-cpp/publisher-public-key-digest.hpp
  33. 2
      ndn-cpp/transport/tcp-transport.hpp
  34. 2
      ndn-cpp/transport/transport.hpp
  35. 2
      ndn-cpp/transport/udp-transport.hpp

6
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 @@ static inline void ndn_BinaryXmlElementReader_init
ndn_Error ndn_BinaryXmlElementReader_onReceivedData
(struct ndn_BinaryXmlElementReader *self, unsigned char *data, unsigned int dataLength);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

76
ndn-cpp/c/encoding/binary-xml-encoder.c

@ -30,7 +30,7 @@ static ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, unsigned char *ar
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 ndn_Error writeArray(struct ndn_BinaryXmlEncoder *self, unsigned char *ar
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) {
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;
}
x >>= ndn_BinaryXml_REGULAR_VALUE_BITS;
}
return nBytes;
return nBytes;
}
/**
@ -172,34 +172,34 @@ static inline void splitAbsDouble(double x, unsigned long *hi32, unsigned long *
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 @@ ndn_Error ndn_BinaryXmlEncoder_writeElementClose(struct ndn_BinaryXmlEncoder *se
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;
}

6
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 @@ static inline ndn_Error ndn_BinaryXmlEncoder_writeOptionalTimeMillisecondsDTagEl
return NDN_ERROR_success;
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

8
ndn-cpp/c/encoding/binary-xml-interest.c

@ -32,14 +32,14 @@ static ndn_Error encodeExclude(struct ndn_Exclude *exclude, struct ndn_BinaryXml
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 @@ ndn_Error ndn_encodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_
(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;

6
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_encodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_
ndn_Error ndn_decodeBinaryXmlInterest(struct ndn_Interest *interest, struct ndn_BinaryXmlDecoder *decoder);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

2
ndn-cpp/c/encoding/binary-xml-key.c

@ -33,7 +33,7 @@ ndn_Error ndn_encodeBinaryXmlKeyLocator(struct ndn_KeyLocator *keyLocator, struc
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;

6
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_decodeBinaryXmlKeyLocator(struct ndn_KeyLocator *keyLocator, struc
*/
ndn_Error ndn_decodeOptionalBinaryXmlKeyLocator(struct ndn_KeyLocator *keyLocator, struct ndn_BinaryXmlDecoder *decoder);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

4
ndn-cpp/c/encoding/binary-xml-name.c

@ -19,9 +19,9 @@ ndn_Error ndn_encodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlEnc
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;

6
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_encodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlEnc
ndn_Error ndn_decodeBinaryXmlName(struct ndn_Name *name, struct ndn_BinaryXmlDecoder *decoder);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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_decodeBinaryXmlPublisherPublicKeyDigest
ndn_Error ndn_decodeOptionalBinaryXmlPublisherPublicKeyDigest
(struct ndn_PublisherPublicKeyDigest *publisherPublicKeyDigest, struct ndn_BinaryXmlDecoder *decoder);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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 @@ static inline void ndn_BinaryXmlStructureDecoder_seek(struct ndn_BinaryXmlStruct
self->offset = offset;
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

40
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 @@ enum {
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 @@ enum {
*/
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 @@ static inline void ndn_Interest_init
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

6
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 @@ static inline void ndn_KeyLocator_init(struct ndn_KeyLocator *self) {
// TODO: Implement keyName.
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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 @@ static inline void ndn_Name_init(struct ndn_Name *self, struct ndn_NameComponent
self->nComponents = 0;
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

8
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 @@ extern "C" {
* 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 @@ static inline void ndn_PublisherPublicKeyDigest_init(struct ndn_PublisherPublicK
self->publisherPublicKeyDigestLength = 0;
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

44
ndn-cpp/c/transport/socket-transport.c

@ -22,9 +22,9 @@ ndn_Error ndn_SocketTransport_connect(struct ndn_SocketTransport *self, ndn_Sock
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 @@ ndn_Error ndn_SocketTransport_connect(struct ndn_SocketTransport *self, ndn_Sock
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;
}
break;
}
if (p == NULL) {
if (p == NULL) {
freeaddrinfo(serverInfo);
return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
return NDN_ERROR_SocketTransport_cannot_connect_to_socket;
}
freeaddrinfo(serverInfo);
freeaddrinfo(serverInfo);
self->socketDescriptor = socketDescriptor;
return NDN_ERROR_success;
@ -91,12 +91,12 @@ ndn_Error ndn_SocketTransport_receive
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)

6
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_receive
ndn_Error ndn_SocketTransport_close(struct ndn_SocketTransport *self);
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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 @@ static inline ndn_Error ndn_TcpTransport_close(struct ndn_TcpTransport *self)
return ndn_SocketTransport_close(&self->base);
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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 @@ static inline ndn_Error ndn_UdpTransport_close(struct ndn_UdpTransport *self)
return ndn_SocketTransport_close(&self->base);
}
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

6
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 @@ static inline ndn_Error ndn_DynamicUCharArray_set
return NDN_ERROR_success;
};
#ifdef __cplusplus
#ifdef __cplusplus
}
#endif

2
ndn-cpp/closure.hpp

@ -8,7 +8,7 @@
*/
#ifndef NDN_CLOSURE_HPP
#define NDN_CLOSURE_HPP
#define NDN_CLOSURE_HPP
#include "common.hpp"

2
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"

2
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"

2
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"

2
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"

2
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>

16
ndn-cpp/interest.cpp

@ -39,16 +39,16 @@ void Exclude::set(const struct ndn_Exclude &excludeStruct)
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);
}

36
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 @@ public:
}
private:
std::vector<ExcludeEntry> entries_;
std::vector<ExcludeEntry> entries_;
};
/**
@ -120,14 +120,14 @@ class Interest {
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 @@ public:
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_;
};
}

2
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"

2
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"

2
ndn-cpp/name.hpp

@ -4,7 +4,7 @@
*/
#ifndef NDN_NAME_HPP
#define NDN_NAME_HPP
#define NDN_NAME_HPP
#include <vector>
#include <string>

4
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 @@ public:
}
private:
std::vector<unsigned char> publisherPublicKeyDigest_;
std::vector<unsigned char> publisherPublicKeyDigest_;
};
}

2
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"

2
ndn-cpp/transport/transport.hpp

@ -4,7 +4,7 @@
*/
#ifndef NDN_TRANSPORT_HPP
#define NDN_TRANSPORT_HPP
#define NDN_TRANSPORT_HPP
#include <vector>

2
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"

Loading…
Cancel
Save