aboutsummaryrefslogtreecommitdiff
blob: 93fd7ec27cb5ce30721b2f5b0e57e45081c2fb01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#ifndef LAYMAN_API_H
#define LAYMAN_API_H


#include "config.h"
#include "stringlist.h"


typedef struct LaymanAPI LaymanAPI;


/**
 * Contains all information for an overlay
 */
typedef struct OverlayInfo
{
	char *name;
	char *text;
	char *ownerEmail;
	char *ownerName;
	char *homepage;
	char *description;
	char *srcType;
	char *quality;
	int	priority;
	StringList *srcUris;
	int	official;
	int	supported;
} OverlayInfo;

 
/**
 * Creates a LaymanAPI object that must be used in all function in this file.
 *
 * \param config a BareConfig object that contains all configuration options. If NULL, the default configuration will be used.
 * \param report_error if True, errors reporting on stdout will be activated.
 * \param output ?
 * \return a new instance of the LaymanAPI class, to be freed with laymanAPIFree()
 */
LaymanAPI *laymanAPICreate(BareConfig *config, int report_error, int output);

int		laymanAPIIsRepo(LaymanAPI *l, const char *repo);
int		laymanAPIIsInstalled(LaymanAPI *l, const char *repo);
StringList *laymanAPIGetAvailable(LaymanAPI*, int reload);
StringList *laymanAPIGetInstalled(LaymanAPI*, int reload);
int		laymanAPISync(LaymanAPI* l, const char *overlay, int verbose);
int 		laymanAPIFetchRemoteList(LaymanAPI*);
int		laymanAPIGetInfoStrList(LaymanAPI *l, StringList *overlays, OverlayInfo *results);
OverlayInfo *laymanAPIGetInfoStr(LaymanAPI *l, char *overlay);
int		laymanAPIGetAllInfoList(LaymanAPI *l, StringList*, OverlayInfo*);
OverlayInfo *laymanAPIGetAllInfo(LaymanAPI *l, const char*);
int		laymanAPIAddRepo(LaymanAPI *l, const char *repo);
int		laymanAPIAddRepoList(LaymanAPI *l, StringList *repos);
int		laymanAPIDeleteRepo(LaymanAPI *l, const char *repo);
int		laymanAPIDeleteRepoList(LaymanAPI *l, StringList *repos);
OverlayInfo *laymanAPIGetInfo(LaymanAPI *l, const char *overlay);
StringList *laymanAPIGetErrors(LaymanAPI *l);
void		laymanAPIFree(LaymanAPI*);
void		overlayInfoFree(OverlayInfo oi);

LaymanAPI *laymanCreate(
		FILE *outfd, FILE *infd, FILE *errfd,
		BareConfig *cfg, int *read_configfile, int *quiet, int *quietness,
		int *verbose, int *nocolor, int *width);

#endif