From 78eefa4b5a74690a537fc725b4de2224548a0826 Mon Sep 17 00:00:00 2001 From: dol-sen Date: Wed, 5 Oct 2011 13:50:03 -0700 Subject: move everything to prep for a merge into layman. --- c-layman/src/laymanapi.h | 56 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 c-layman/src/laymanapi.h (limited to 'c-layman/src/laymanapi.h') 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 -- cgit v1.2.3-1-g7c22