ndn-lite
Data Structures | Typedefs | Functions
ndn-trust-schema-pattern-component.h File Reference
#include <stdint.h>
#include <string.h>
#include "../../util/re.h"
#include "../../ndn-constants.h"
#include "../../ndn-error-code.h"
#include "../name-component.h"
#include "ndn-trust-schema-common.h"
#include <stdio.h>

Go to the source code of this file.

Data Structures

struct  ndn_trust_schema_pattern_component
 The structure to represent an NDN Trust Schema Pattern Component. More...
 

Typedefs

typedef struct ndn_trust_schema_pattern_component ndn_trust_schema_pattern_component_t
 The structure to represent an NDN Trust Schema Pattern Component. More...
 

Functions

static int ndn_trust_schema_pattern_component_from_buffer (ndn_trust_schema_pattern_component_t *component, uint32_t type, const uint8_t *value, uint32_t size)
 Init an NDN Trust Schema pattern Component structure from caller supplied memory block. More...
 
static uint32_t _probe_trust_schema_pattern_component_type (const char *string)
 Probes a string to get its trust schema pattern component type. More...
 
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...
 

Typedef Documentation

◆ ndn_trust_schema_pattern_component_t

The structure to represent an NDN Trust Schema Pattern Component.

Function Documentation

◆ _probe_trust_schema_pattern_component_type()

static uint32_t _probe_trust_schema_pattern_component_type ( const char *  string)
inlinestatic

Probes a string to get its trust schema pattern component type.

Parameters
string.Input. String variable which will be probed for trust schema pattern component type.
size.Input. Size of input string.
Returns
Returns the trust schema pattern component type if there is no error and the probing found a valid NDN trust schema pattern component type.

◆ 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_buffer()

static int ndn_trust_schema_pattern_component_from_buffer ( ndn_trust_schema_pattern_component_t component,
uint32_t  type,
const uint8_t *  value,
uint32_t  size 
)
inlinestatic

Init an NDN Trust Schema pattern Component structure from caller supplied memory block.

The function will do memory copy

Parameters
component.Output. The NDN Trust Schema pattern Component structure to be inited.
type.Input. NDN Trust Schema pattern Component Type to be set with.
value.Input. Memory block which holds the NDN Trust Schema Pattern Component Value.
size.Input. Size of input block.
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.