Layman API

Main API functions. More...


Data Structures

struct  LaymanAPI

Functions

LaymanAPIlaymanAPICreate (BareConfig *config, int report_error, int output)
int laymanAPIIsRepo (LaymanAPI *l, const char *repo)
int laymanAPIIsInstalled (LaymanAPI *l, const char *repo)
StringListlaymanAPIGetAvailable (LaymanAPI *l, int reload)
StringListlaymanAPIGetInstalled (LaymanAPI *l, int reload)
int laymanAPISync (LaymanAPI *l, const char *overlay, int verbose)
int laymanAPIFetchRemoteList (LaymanAPI *l)
int laymanAPIGetInfoStrList (LaymanAPI *l, StringList *overlays, OverlayInfo *results)
OverlayInfolaymanAPIGetInfoStr (LaymanAPI *l, const char *overlay)
OverlayInfolaymanAPIGetAllInfo (LaymanAPI *l, const char *overlay)
int laymanAPIGetAllInfoList (LaymanAPI *l, StringList *overlays, OverlayInfo *results)
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)
void laymanAPIFree (LaymanAPI *l)
void overlayInfoFree (OverlayInfo oi)


Detailed Description

Main API functions.

Function Documentation

int laymanAPIAddRepo ( LaymanAPI l,
const char *  repo 
)

Adds an overlay to layman

Parameters:
repo the name of the repository to add
Returns:
True if it succeeded, False if not

int laymanAPIAddRepoList ( LaymanAPI l,
StringList repos 
)

Adds a list of overlays to layman

Parameters:
repo the list of the repositories to add
Return True if it succeeded, False if not

LaymanAPI* laymanAPICreate ( BareConfig config,
int  report_error,
int  output 
)

Creates a LaymanAPI object that must be used in all function in this file.

Parameters:
config a BareConfig object that contains all configuration options. If NULL, the default configuration will be used.
report_error if True, errors reporting on stdout will be activated.
output ?
Returns:
a new instance of the LaymanAPI class, to be freed with laymanAPIFree()

int laymanAPIDeleteRepo ( LaymanAPI l,
const char *  repo 
)

Deletes an overlay from layman

Parameters:
repo the name of the repository to delete
Returns:
True if it succeeded, False if not

int laymanAPIDeleteRepoList ( LaymanAPI l,
StringList repos 
)

Deletes a list of overlays from layman

Parameters:
repo the list of the repositories to delete
Returns:
True if it succeeded, False if not

int laymanAPIFetchRemoteList ( LaymanAPI l  ) 

Updates the local overlay list.

Returns:
True if it succeeded, False if not.

void laymanAPIFree ( LaymanAPI l  ) 

Frees a LaymanAPI object from memory

OverlayInfo* laymanAPIGetAllInfo ( LaymanAPI l,
const char *  overlay 
)

Get all information from an overlay. This function fills every fields but the text field of the OverlayInfo structure.

Parameters:
overlay the overlay name to get info from
Returns:
NULL if it fails, an OverlayInfo struct if not.

int laymanAPIGetAllInfoList ( LaymanAPI l,
StringList overlays,
OverlayInfo results 
)

Gives a list of OverlayInfo's from the overaly names found in the overlays StringList. results must be allocated and initialized with zeroes.

If an information is unavailable (no owner email for example), the correpsonding field will stay to NULL

This function fills every fields but the text field of the OverlayInfo structure.

Parameters:
overlays the list of overlays to get information from
results a pointer to a table of OverlayInfo structures
Returns:
the number of OverlayInfo structures filled.

StringList* laymanAPIGetAvailable ( LaymanAPI l,
int  reload 
)

Returns a list of the available overlays.

Parameters:
l the LaymanAPI object.
reload if True, reloads the list
Returns:
the list of available overlays

OverlayInfo* laymanAPIGetInfoStr ( LaymanAPI l,
const char *  overlay 
)

Provided for convenience, this function get the information for only 1 overlay.

Parameters:
overlay the overlay name to get info from
Returns:
NULL if it fails, an OverlayInfo struct if not.

int laymanAPIGetInfoStrList ( LaymanAPI l,
StringList overlays,
OverlayInfo results 
)

Gets the information from the overlays given in the StringList overlays. The results are stored in the results table which must be initialized with N structures, N being the number of overlays in the overlays StringList. This function fills the name, text, supported and official fields of the OverlayInfo structure.

Parameters:
overlays the list of overlays to get information from
results a pointer to a table of OverlayInfo structures
Returns:
the number of results structures that have been filled

StringList* laymanAPIGetInstalled ( LaymanAPI l,
int  reload 
)

Returns a list of the installed overlays.

Parameters:
l the LaymanAPI object.
reload if True, reloads the list
Returns:
the list of installed overlays

int laymanAPIIsInstalled ( LaymanAPI l,
const char *  repo 
)

Check if the given string is a valid and installed repository

Parameters:
l the LaymanAPI object.
repo the repository to be checked.
Returns:
True if the repository is valid and installed, False if not

int laymanAPIIsRepo ( LaymanAPI l,
const char *  repo 
)

Check if the given string is a valid repository

Parameters:
l the LaymanAPI object.
repo the repository to be checked.
Returns:
True if the repository is valid, False if not

int laymanAPISync ( LaymanAPI l,
const char *  overlay,
int  verbose 
)

Syncs an overlay.

Parameters:
overlay The name of the overlay to sync
verbose if True, the output will be more verbose.
Returns:
True if it succeeded, False if not.

void overlayInfoFree ( OverlayInfo  oi  ) 


Generated on Fri Aug 6 20:00:53 2010 for C-Layman by  doxygen 1.5.8