ndn_Error ndn_ControlParameters_setFromControlParameters (struct ndn_ControlParameters *self, const struct ndn_ControlParameters *other) { ndn_Error error; if (other == self) // Setting to itself. Do nothing. return NDN_ERROR_success; self->hasName = other->hasName; if (other->hasName) { if ((error = ndn_Name_setFromName(&self->name, &other->name))) return error; } self->faceId = other->faceId; ndn_Blob_setFromBlob(&self->uri, &other->uri); self->localControlFeature = other->localControlFeature; self->origin = other->origin; self->cost = other->cost; self->flags = other->flags; if ((error = ndn_Name_setFromName(&self->strategy, &other->strategy))) return error; self->expirationPeriod = other->expirationPeriod; return NDN_ERROR_success; }
ndn_Error NameLite::set(const NameLite& other) { return ndn_Name_setFromName(this, &other); }