ndn-lite
Functions
ndn-trust-schema-pattern-component.c File Reference
#include "ndn-trust-schema-pattern-component.h"
#include <string.h>
#include <stdlib.h>
#include "../../ndn-constants.h"
#include "../../ndn-error-code.h"

Functions

int ndn_trust_schema_pattern_component_from_string (ndn_trust_schema_pattern_component_t *component, const char *string, uint32_t size)
 Init an NDN Trust Schema Pattern Component structure from string. More...
 
int ndn_trust_schema_pattern_component_copy (const ndn_trust_schema_pattern_component_t *lhs, ndn_trust_schema_pattern_component_t *rhs)
 Copy lhs pattern component to rhs pattern component. More...
 
int ndn_trust_schema_pattern_component_compare (const ndn_trust_schema_pattern_component_t *pattern_component, const name_component_t *name_component)
 Compare a trust schema pattern component and a name component. More...
 

Function Documentation

◆ ndn_trust_schema_pattern_component_compare()

int ndn_trust_schema_pattern_component_compare ( const ndn_trust_schema_pattern_component_t pattern_component,
const name_component_t name_component 
)

Compare a trust schema pattern component and a name component.

This function will return false for any pattern components that require extra context to be matched properly (i.e., subpattern indexes).

Parameters
pattern_component.Input. The pattern component for comparison.
name_component.Input. The name component for comparison.
Returns
0 if the pattern component matches the name component.

◆ ndn_trust_schema_pattern_component_copy()

int ndn_trust_schema_pattern_component_copy ( const ndn_trust_schema_pattern_component_t lhs,
ndn_trust_schema_pattern_component_t rhs 
)

Copy lhs pattern component to rhs pattern component.

Parameters
lhs.Input. The pattern component to be copied.
rhs.Output. The pattern component to be copied to.
Returns
0 if there is no error.

◆ ndn_trust_schema_pattern_component_from_string()

int ndn_trust_schema_pattern_component_from_string ( ndn_trust_schema_pattern_component_t component,
const char *  string,
uint32_t  size 
)

Init an NDN Trust Schema Pattern Component structure from string.

The size should not include the terminating '\0' character. The function will do memory copy.

Parameters
component.Output. The NDN Trust Schema Pattern Component structure to be inited.
string.Input. String variable which NDN Trust Schema pattern component initing from.
size.Input. Size of input string.
Returns
0 if there is no error.