APT2 Reference Manual | ||||
---|---|---|---|---|
Top | Description |
AptSourcesListAptSourcesList — Parse sources.list files and create AptSource objects. |
#include <apt.h> AptSourcesList; AptSourcesList * apt_sources_list_new (AptSystem *system
); AptSourcesList * apt_sources_list_ref (AptSourcesList *list
); void apt_sources_list_unref (AptSourcesList *list
); AptSource; GList * apt_sources_list_get_list (AptSourcesList *list
); gboolean apt_sources_list_parse_dir (AptSourcesList *list
,const gchar *dir
,GError **error
); gboolean apt_sources_list_parse_file (AptSourcesList *list
,const gchar *file
,GError **error
); gboolean apt_sources_list_parse_line (AptSourcesList *list
,const gchar *line
,GError **error
);
AptSourcesList parses sources.list files and creates the corresponding AptSource instance for each entry, if such entry is supported by the underlying AptSystem.
AptSourcesList * apt_sources_list_new (AptSystem *system
);
Creates a new AptSourcesList.
|
The AptSystem used for the sources. |
Returns : |
A newly allocated AptSourcesList. |
AptSourcesList * apt_sources_list_ref (AptSourcesList *list
);
Increments the reference count of list
by one.
|
An AptSourcesList |
Returns : |
list |
void apt_sources_list_unref (AptSourcesList *list
);
Decrements the reference count of list
by one. If the reference
count drops to 0, frees all memory used by list
.
|
An AptSourcesList |
typedef struct _AptSource AptSource;
AptSource is a data structure that describes a single entry in a sources.list file.
GList * apt_sources_list_get_list (AptSourcesList *list
);
Gets a list of unowned references to AptSource objects. The list is ordered according to the time the sources were entered. This means that the first source is the source added first and the last source has been added last.
|
An AptSourcesList |
Returns : |
A GList of unowned AptSource references. You must call
g_list_free() on the list once you do not need it anymore. |
gboolean apt_sources_list_parse_dir (AptSourcesList *list
,const gchar *dir
,GError **error
);
Parses the files in dir
until an error occurs. In such a case, FALSE
is returned and error
is set (if it is not NULL).
|
An AptSourcesList |
|
Path to the directory from which the files should be parsed |
|
Return location for an error |
Returns : |
TRUE if all files could be parsed. Otherwise, FALSE . |
gboolean apt_sources_list_parse_file (AptSourcesList *list
,const gchar *file
,GError **error
);
Parses the file at file
. If an error occured, FALSE
is returned and
error
is set (if it is not NULL).
|
An AptSourcesList |
|
Path to the file that should be parsed |
|
Return location for an error |
Returns : |
TRUE if the file could be parsed. Otherwise, FALSE . |
gboolean apt_sources_list_parse_line (AptSourcesList *list
,const gchar *line
,GError **error
);
Parses line
which shall describe a single AptSource in the format
described in sources.list(5). If an error occured, FALSE
is returned
and error
is set (if it is not NULL).
|
An AptSourcesList |
|
A line in the sources.list(5) format that shall be parsed |
|
Return location for an error |
Returns : |
TRUE if the line could be parsed. Otherwise, FALSE . |