Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
enum cYAML_object_type {
        CYAML_TYPE_FALSE = 0,
        CYAML_TYPE_TRUE,
        CYAML_TYPE_NULL,
        CYAML_TYPE_NUMBER,
        CYAML_TYPE_STRING,
        CYAML_TYPE_ARRAY,
        CYAML_TYPE_OBJECT
};

struct cYAML {
        /* next/prev allow you to walk array/object chains. */
        struct cYAML *cy_next, *cy_prev;
        /* An array or object item will have a child pointer pointing
           to a chain of the items in the array/object. */
        struct cYAML *cy_child;
        /* The type of the item, as above. */
        enum cYAML_object_type cy_type;

        /* The item's string, if type==CYAML_TYPE_STRING */
        char *cy_valuestring;
        /* The item's number, if type==CYAML_TYPE_NUMBER */
        int cy_valueint;
        /* The item's number, if type==CYAML_TYPE_NUMBER */
        double cy_valuedouble;
        /* The item's name string, if this item is the child of,
           or is in the list of subitems of an object. */
        char *cy_string;
        /* user data which might need to be tracked per object */
        void *cy_user_data;
};

 

FSM

In order to correctly build the intermediary yaml structure tree, CYAML maintains an FSM.

Gliffy Diagram
nameCYAML FSM

APIs

Refer to the code for more details, but below are the external APIs provided by CYAML

...