ZifLegal

ZifLegal — A ZifLegal object allows the user to check licenses

Synopsis

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

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 ())


ZifLegal

typedef struct _ZifLegal ZifLegal;


ZifLegalPrivate

typedef struct _ZifLegalPrivate ZifLegalPrivate;


ZifLegalClass

typedef struct {
	GObjectClass		 parent_class;
} ZifLegalClass;


enum ZifLegalError

typedef enum {
	ZIF_LEGAL_ERROR_FAILED,
	ZIF_LEGAL_ERROR_LAST
} ZifLegalError;


zif_legal_error_quark ()

GQuark              zif_legal_error_quark               (void);

Returns :

Our personal error quark.

Since 0.1.0


zif_legal_new ()

ZifLegal *          zif_legal_new                       (void);

Returns :

A new ZifLegal class 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 legal file.

legal :

the ZifLegal object

filename :

the system wide legal file, e.g. "/etc/yum.conf"

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 :

the ZifLegal object

string :

the legal string to check, e.g. ""Zend and wxWidgets""

is_free :

if the string is a valid free legal

error :

a GError which is used on failure, or NULL

Returns :

FALSE for failure to load legal data.

Since 0.1.0