diff options
author | dol-sen <brian.dolbec@gmail.com> | 2011-10-05 13:50:03 -0700 |
---|---|---|
committer | dol-sen <brian.dolbec@gmail.com> | 2011-10-05 13:50:03 -0700 |
commit | 78eefa4b5a74690a537fc725b4de2224548a0826 (patch) | |
tree | 68787c852f3303a27f8c12f98e9f9f15bf8ab283 /c-layman/src/laymanapi.h | |
parent | 2b3e8c634f819f1cbd3a700f6299c5a99b989ea5 (diff) | |
download | layman-78eefa4b5a74690a537fc725b4de2224548a0826.tar.gz layman-78eefa4b5a74690a537fc725b4de2224548a0826.tar.bz2 layman-78eefa4b5a74690a537fc725b4de2224548a0826.zip |
move everything to prep for a merge into layman.
Diffstat (limited to 'c-layman/src/laymanapi.h')
-rw-r--r-- | c-layman/src/laymanapi.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/c-layman/src/laymanapi.h b/c-layman/src/laymanapi.h new file mode 100644 index 0000000..60e20e0 --- /dev/null +++ b/c-layman/src/laymanapi.h @@ -0,0 +1,56 @@ +#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, const 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); +void laymanAPIFree(LaymanAPI*); +void overlayInfoFree(OverlayInfo oi); + +#endif |