summaryrefslogtreecommitdiffstats
path: root/src/laymanapi.h
blob: 42c005862edcdf20231965e49b03bf6ce60aa901 (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
#ifndef LAYMAN_API_H
#define LAYMAN_API_H

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

typedef struct LaymanAPI LaymanAPI;

typedef enum OverlayType {Svn = 0, Git, Bzr} OverlayType;
typedef enum OverlayQuality {Experimental = 0, Stable, Testing} OverlayQuality;
typedef struct OverlayInfo
{
	char *name;
	char *source;
	char *contact;
	OverlayType type;
	int priority;
	OverlayQuality quality;
	char *description;
	char *link;
	char *feed;
	int official;
	int supported;
} OverlayInfo;


LaymanAPI*	laymanAPICreate(Config*, int, int);
StringList*	laymanAPIGetAvailable(LaymanAPI*);
StringList*	laymanAPIGetInstalled(LaymanAPI*);

/*
 * The Python API returns a list of warnings/sucesses/errors
 * In here, a boolean value is returned.
 * Warnings can be retreived with
 * 	laymanAPIWarnings()
 * 	laymanAPIErrors()
 * As there's only one argument here, there's need to have success results.
 *
 * The reason it's done this way is that the Python way of doing things is not the same as the Python way.
 *
 * FIXME:is it a good idea to have different APIs for different languages ?
 */
int 		laymanAPISync(LaymanAPI*, const char*);
int 		laymanAPIFetchRemoteList(LaymanAPI*);
const char*	laymanAPIGetInfo(LaymanAPI*, const char*);

#endif