Browse Source

In structures, put minSuffixComponents before maxSuffixComponents

pull/1/head
Jeff Thompson 12 years ago
parent
commit
f2e5e28862
  1. 4
      ndn-cpp/Interest.cpp
  2. 3
      ndn-cpp/Interest.hpp
  3. 4
      ndn-cpp/c/Interest.h

4
ndn-cpp/Interest.cpp

@ -12,8 +12,8 @@ namespace ndn {
void Interest::set(struct ndn_Interest &interestStruct)
{
name_.set(interestStruct.name);
maxSuffixComponents_ = interestStruct.maxSuffixComponents;
minSuffixComponents_ = interestStruct.minSuffixComponents;
maxSuffixComponents_ = interestStruct.maxSuffixComponents;
publisherPublicKeyDigest_.clear();
if (interestStruct.publisherPublicKeyDigest)
@ -33,8 +33,8 @@ void Interest::set(struct ndn_Interest &interestStruct)
void Interest::get(struct ndn_Interest &interestStruct)
{
name_.get(interestStruct.name);
interestStruct.maxSuffixComponents = maxSuffixComponents_;
interestStruct.minSuffixComponents = minSuffixComponents_;
interestStruct.maxSuffixComponents = maxSuffixComponents_;
interestStruct.publisherPublicKeyDigestLength = publisherPublicKeyDigest_.size();
if (publisherPublicKeyDigest_.size() > 0)

3
ndn-cpp/Interest.hpp

@ -59,9 +59,8 @@ public:
private:
Name name_;
int maxSuffixComponents_;
int minSuffixComponents_;
int maxSuffixComponents_;
std::vector<unsigned char> publisherPublicKeyDigest_;
// TODO: implement exclude
int childSelector_;

4
ndn-cpp/c/Interest.h

@ -14,8 +14,8 @@ extern "C" {
struct ndn_Interest {
struct ndn_Name name;
int maxSuffixComponents; /**< -1 for none */
int minSuffixComponents; /**< -1 for none */
int maxSuffixComponents; /**< -1 for none */
unsigned char *publisherPublicKeyDigest; /**< pointer to pre-allocated buffer. 0 for none */
unsigned int publisherPublicKeyDigestLength; /**< length of publisherPublicKeyDigest. 0 for none */
// TODO: implement exclude
@ -30,8 +30,8 @@ struct ndn_Interest {
static inline void ndn_Interest_init(struct ndn_Interest *self, struct ndn_NameComponent *nameComponents, unsigned int maxNameComponents)
{
ndn_Name_init(&self->name, nameComponents, maxNameComponents);
self->maxSuffixComponents = -1;
self->minSuffixComponents = -1;
self->maxSuffixComponents = -1;
self->publisherPublicKeyDigest = 0;
self->publisherPublicKeyDigestLength = 0;
// TODO: implement exclude

Loading…
Cancel
Save