## fo-libfo-basic

fo-libfo-basic —

## Synopsis

    enum        FoLibfoBasicError;
    #define     FO_LIBFO_BASIC_ERROR
    GQuark      fo_libfo_basic_error_quark      (void);
    enum        FoEnumType;
    struct      FoLibfoContext;
    gboolean    fo_libfo_init                   (void);
    gpointer    (*FoMalloc)                     (gsize n_bytes);
    gpointer    (*FoRealloc)                    (gpointer mem,
                                                 gsize n_bytes);
    void        (*FoFree)                       (gpointer mem);
    gboolean    fo_libfo_init2                  (FoMalloc fo_malloc,
                                                 FoRealloc fo_realloc,
                                                 FoFree fo_free);
    gboolean    fo_libfo_shutdown               (void);
    FoLibfoContext* fo_libfo_context_new        (void);
    void        fo_libfo_context_close          (FoLibfoContext *libfo_context);
    gboolean    fo_libfo_format                 (FoLibfoContext *libfo_context,
                                                 const gchar *xml,
                                                 const gchar *xslt,
                                                 const gchar *out,
                                                 GError **error);

## Description

## Details

### enum FoLibfoBasicError

    typedef enum
    {
      FO_LIBFO_BASIC_ERROR_FAILED,		/* Generic error code */
      FO_LIBFO_BASIC_ERROR_UNKNOWN_FORMAT,
      FO_LIBFO_BASIC_ERROR_WARNING,	/* Non-fatal error */
      FO_LIBFO_BASIC_ERROR_LAST
    } FoLibfoBasicError;

### FO_LIBFO_BASIC_ERROR

    #define FO_LIBFO_BASIC_ERROR (fo_libfo_basic_error_quark ())

### fo_libfo_basic_error_quark ()

    GQuark      fo_libfo_basic_error_quark      (void);

Get the error quark for FoLibfo.

If the quark does not yet exist, create it.

Returns : | Quark associated with FoLibfo errors.

### enum FoEnumType

    typedef enum {
        FO_ENUM_TYPE_CHAR,
        FO_ENUM_TYPE_INT,
        FO_ENUM_TYPE_FILE
    } FoEnumType;

### struct FoLibfoContext

    struct FoLibfoContext;

### fo_libfo_init ()

    gboolean    fo_libfo_init                   (void);

Initialise the libfo formatter.

Returns : | `TRUE` if successful.

### FoMalloc ()

    gpointer    (*FoMalloc)                     (gsize n_bytes);

`n_bytes` : |
Returns : |

### FoRealloc ()

    gpointer    (*FoRealloc)                    (gpointer mem,
                                                 gsize n_bytes);

`mem` : |
`n_bytes` : |
Returns : |

### FoFree ()

    void        (*FoFree)                       (gpointer mem);

`mem` : |

### fo_libfo_init2 ()

    gboolean    fo_libfo_init2                  (FoMalloc fo_malloc,
                                                 FoRealloc fo_realloc,
                                                 FoFree fo_free);

Initialise the libfo formatter and provide functions for allocating, reallocating, and freeing memory.

`fo_malloc` : | Function that allocates memory.
`fo_realloc` : | Function that reallocates memory.
`fo_free` : | Function that frees memory.
Returns : | `TRUE` if successful.

### fo_libfo_shutdown ()

    gboolean    fo_libfo_shutdown               (void);

Shutdown the libfo formatter.

Returns : | `TRUE` if successful.

### fo_libfo_context_new ()

    FoLibfoContext* fo_libfo_context_new        (void);

Creates a new FoLibfoContext initialized to default value.

Returns : | The new FoLibfoContext.

### fo_libfo_context_close ()

    void        fo_libfo_context_close          (FoLibfoContext *libfo_context);

Closes `libfo_context` and sets it to `NULL`.

`libfo_context` : | FoLibfoContext to close.

### fo_libfo_format ()

    gboolean    fo_libfo_format                 (FoLibfoContext *libfo_context,
                                                 const gchar *xml,
                                                 const gchar *xslt,
                                                 const gchar *out,
                                                 GError **error);

`libfo_context` : |
`xml` : |
`xslt` : |
`out` : |
`error` : |
Returns : |