== REFERENCE IMPLEMENTATION ==

==== Livido Port ====

In the reference implementation, a port is simply a linked list of properties:

{{{
    typedef livido_property_t * livido_port_t;
}}}


==== Livido Property ====

In the reference implementation, a property is defined thus:

{{{
typedef struct livido_property {
  const char *key; ///< unique type: min,max,value,step_size,page_size,decimals
  livido_storage_t *data; ///< either 1 atom or N atoms
  livido_property_t *next;
} livido_property_t;
}}}


==== Livido Storage ====

From the reference implementation:

The livido_storage_t structure is:
{{{
struct livido_storage {
  int num_elements;
  int atom_type;
  union {
    livido_atom_t *atom; // NULL if num_elements==0
    livido_atom_t **array;
  } data;
  int flags;
};
}}}


The union "data" contains an atom * if number of elements == 1, otherwise it containts a atom **


==== Livido Atom ====

In the reference implementation, the ''atoms'' in livido represent the fundamental types in the system. 
This is the lowest level of data in livido, and one or more of these are used in a livido_storage for providing a generic mechanism to store and retrieve runtime data.

A livido_atom has:
 * a type id int
 * a size of type size_t
 * a void * value

{{{
typedef struct livido_atom {
  int type;
  size_t size;
  void *value;
} livido_atom_t;
}}}



==== Low level and Mediation Level Functions ====

The reference implementation uses the following macros. These should never be called directly from the host or plugin.

TODO: update

Atom functions:[[BR]]
 * livido_atom_t *livido_atom_new () - only used internally by livido
 * void livido_atom_free () - only used internally by livido

Storage functions:[[BR]]
 * livido_storage_t *livido_storage_new()
 * void livido_storage_free() - only used internally by livido

Property functions:[[BR]]
 * livido_property_t *livido_property_new (livido_port_t *port, const char *key, int atom_type);
 * void livido_property_free (livido_property_t *property);

