clif.h File Reference

CoRE Link Format encoding and decoding library public definitions. More...

Detailed Description

CoRE Link Format encoding and decoding library public definitions.

Author
Leandro Lanzieri leand.nosp@m.ro.l.nosp@m.anzie.nosp@m.ri@h.nosp@m.aw-ha.nosp@m.mbur.nosp@m.g.de

Definition in file clif.h.

#include <sys/types.h>
#include "clif_internal.h"
+ Include dependency graph for clif.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  clif_attr_t
 Link format attribute descriptor. More...
 
struct  clif_t
 Link format descriptor. More...
 

Enumerations

enum  { CLIF_OK = 0, CLIF_NO_SPACE = -1, CLIF_NOT_FOUND = -2 }
 Return types for the CoRE Link Format API. More...
 
enum  clif_attr_type_t {
  CLIF_ATTR_ANCHOR = 0, CLIF_ATTR_REL = 1, CLIF_ATTR_LANG = 2, CLIF_ATTR_MEDIA = 3,
  CLIF_ATTR_TITLE = 4, CLIF_ATTR_TITLE_EXT = 5, CLIF_ATTR_TYPE = 6, CLIF_ATTR_RT = 7,
  CLIF_ATTR_IF = 8, CLIF_ATTR_SZ = 9, CLIF_ATTR_CT = 10, CLIF_ATTR_OBS = 11,
  CLIF_ATTR_EXT = 12
}
 Types of link format attributes. More...
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
ssize_t clif_add_link_separator (char *buf, size_t maxlen)
 Adds the link separator character to a given buf, using link format. More...
 
ssize_t clif_get_target (const char *input, size_t input_len, char **output)
 Looks for a the target URI of a given link. More...
 
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. More...
 
clif_attr_type_t clif_get_attr_type (const char *input, size_t input_len)
 Returns the attribute type of a given string. More...
 
ssize_t clif_attr_type_to_str (clif_attr_type_t type, const char **str)
 Returns a constant string of a given attribute type. More...
 
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. More...