ndn-lite
Functions
ndn-trust-schema-pattern.c File Reference
#include "ndn-trust-schema-pattern.h"
#include <stdbool.h>
#include <stdio.h>

Functions

int ndn_trust_schema_pattern_from_string (ndn_trust_schema_pattern_t *pattern, const char *string, uint32_t size)
 Init an NDN Trust Schema pattern from a string. More...
 
int ndn_trust_schema_pattern_copy (const ndn_trust_schema_pattern_t *lhs, ndn_trust_schema_pattern_t *rhs)
 Copy the lhs pattern to the rhs pattern. More...
 
int index_of_pattern_component_type (const ndn_trust_schema_pattern_t *pattern, uint32_t type)
 Find the first index in a trust schema pattern of a particular type. More...
 
int last_index_of_pattern_component_type (const ndn_trust_schema_pattern_t *pattern, uint32_t type)
 Find the last index in a trust schema pattern of a particular type. More...
 

Function Documentation

◆ index_of_pattern_component_type()

int index_of_pattern_component_type ( const ndn_trust_schema_pattern_t pattern,
uint32_t  type 
)

Find the first index in a trust schema pattern of a particular type.

Parameters
pattern.Input. The NDN Trust Schema pattern to be parsed.
type.Input. The pattern component type to search for.
Returns
Index of first pattern component of given type if successfully found, -1 otherwise.

◆ last_index_of_pattern_component_type()

int last_index_of_pattern_component_type ( const ndn_trust_schema_pattern_t pattern,
uint32_t  type 
)

Find the last index in a trust schema pattern of a particular type.

Parameters
pattern.Input. The NDN Trust Schema pattern to be parsed.
type.Input. The pattern component type to search for.
Returns
Index of last pattern component of given type if successfully found, -1 otherwise.

◆ ndn_trust_schema_pattern_copy()

int ndn_trust_schema_pattern_copy ( const ndn_trust_schema_pattern_t lhs,
ndn_trust_schema_pattern_t rhs 
)

Copy the lhs pattern to the rhs pattern.

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

◆ ndn_trust_schema_pattern_from_string()

int ndn_trust_schema_pattern_from_string ( ndn_trust_schema_pattern_t pattern,
const char *  string,
uint32_t  size 
)

Init an NDN Trust Schema pattern from a string.

This function will do memory copy and only support regular string; not support URI currently.

Parameters
pattern.Output. The NDN Trust Schema pattern to be inited.
string.Input. The string from which the NDN Trust Schema pattern is inited.
size.Input. Size of the input string.
Returns
0 if there is no error.