Go to the documentation of this file.
98 #include <sys/types.h>
187 const char *buf,
size_t maxlen);
258 ssize_t
clif_get_target(
const char *input,
size_t input_len,
char **output);
ssize_t clif_add_attr(clif_attr_t *attr, char *buf, size_t maxlen)
Adds a given attr to a given buffer buf using link format.
ssize_t clif_add_target(const char *target, char *buf, size_t maxlen)
Adds a given target to a given buffer buf using link format.
ssize_t clif_decode_link(clif_t *link, clif_attr_t *attrs, unsigned attrs_len, const char *buf, size_t maxlen)
Decodes a string of link format.
ssize_t clif_attr_type_to_str(clif_attr_type_t type, const char **str)
Returns a constant string of a given attribute type.
unsigned key_len
length of the attribute name
@ CLIF_NOT_FOUND
could not find a component in a buffer
clif_attr_type_t
Types of link format attributes.
unsigned attrs_len
size of array of attributes
clif_attr_type_t clif_get_attr_type(const char *input, size_t input_len)
Returns the attribute type of a given string.
ssize_t clif_encode_link(const clif_t *link, char *buf, size_t maxlen)
Encodes a given link in link format into a given buffer.
Link format attribute descriptor.
ssize_t clif_get_target(const char *input, size_t input_len, char **output)
Looks for a the target URI of a given link.
clif_attr_t * attrs
array of attributes
int clif_init_attr(clif_attr_t *attr, clif_attr_type_t type)
Initializes the key of a given attribute according to a given type.
const char * key
attribute name
ssize_t clif_get_attr(const char *input, size_t input_len, clif_attr_t *attr)
Looks for the first attribute in a given link.
char * value
string with the value
@ CLIF_NO_SPACE
not enough space in the buffer
unsigned value_len
length of the value
char * target
target string
unsigned target_len
length of target string
@ CLIF_ATTR_TITLE_EXT
title*
Internal definitions for CoRE Link format module.
ssize_t clif_add_link_separator(char *buf, size_t maxlen)
Adds the link separator character to a given buf, using link format.
@ CLIF_ATTR_EXT
extensions