ZifLegal

## ZifLegal ZifLegal — Check licenses |

## Synopsis

    #define             ZIF_LEGAL_ERROR
    struct              ZifLegal;
    struct              ZifLegalClass;
    enum                ZifLegalError;
    GQuark              zif_legal_error_quark               (void);
    gboolean            zif_legal_is_free                   (ZifLegal *legal,
                                                             const gchar *string,
                                                             gboolean *is_free,
                                                             GError **error);
    ZifLegal *          zif_legal_new                       (void);
    void                zif_legal_set_filename              (ZifLegal *legal,
                                                             const gchar *filename);

## Object Hierarchy

      GObject
       +----ZifLegal

## Description

ZifLegal allows the user to see if a specific license string is free according to the FSF. Before checking any strings, the backing legal file has to be set with `zif_legal_set_filename()` and any checks prior to that will fail.

## Details

### ZIF_LEGAL_ERROR

    #define ZIF_LEGAL_ERROR		(zif_legal_error_quark ())

### struct ZifLegal

    struct ZifLegal;

### struct ZifLegalClass

    struct ZifLegalClass {
    	GObjectClass		 parent_class;
    	/* Padding for future expansion */
    	void (*_zif_reserved1) (void);
    	void (*_zif_reserved2) (void);
    	void (*_zif_reserved3) (void);
    	void (*_zif_reserved4) (void);
    };

### enum ZifLegalError

    typedef enum {
    	ZIF_LEGAL_ERROR_FAILED,
    	ZIF_LEGAL_ERROR_LAST
    } ZifLegalError;

`ZIF_LEGAL_ERROR_FAILED` |
`ZIF_LEGAL_ERROR_LAST` |

### zif_legal_error_quark ()

    GQuark              zif_legal_error_quark               (void);

Returns : | An error quark.

Since 0.1.0

### zif_legal_is_free ()

    gboolean            zif_legal_is_free                   (ZifLegal *legal,
                                                             const gchar *string,
                                                             gboolean *is_free,
                                                             GError **error);

Finds out if the package is classified as free software.

`legal` : | A ZifLegal
`string` : | String to check, e.g. "Zend and wxWidgets"
`is_free` : | If the string is a can be considered free
`error` : | A GError, or `NULL`
Returns : | `FALSE` for failure to load legal data.

Since 0.1.0

### zif_legal_new ()

    ZifLegal *          zif_legal_new                       (void);

Returns : | A new ZifLegal instance.

Since 0.1.0

### zif_legal_set_filename ()

    void                zif_legal_set_filename              (ZifLegal *legal,
                                                             const gchar *filename);

Sets the filename to use as the system wide licences file.

`legal` : | A ZifLegal
`filename` : | The system wide licences file, e.g. "/usr/share/zif/licences.txt"

Since 0.1.0