Main Page | Data Structures | File List | Data Fields | Globals

libuau.h File Reference

Interface to the libuau library. More...

#include <stdlib.h>
#include <glib.h>

Go to the source code of this file.

Data Structures

struct  AData
 Describe a chunk of data (used in ftp.c). More...

struct  ADate
 Date structure. More...

struct  AInterface
 Describe the interface of a program. Only really relevant for libraries. More...

struct  APackage
 Describe a specific package (ie, an RPM for an update). More...

struct  AProgInfo
 Describe an installed (and registered) program. More...

struct  AQuantifier
struct  AUpdate
 Describe all aspects of any type of update (software, message, etc.). More...


Defines

#define LUAU_VERSION_MAJOR   0
#define LUAU_VERSION_MINOR   1
#define LUAU_VERSION_PATCH   6
#define LUAU_XML_INTERFACE_MAJOR   1
#define LUAU_XML_INTERFACE_MINOR   1
#define LUAU_EMPTY   0x00
#define LUAU_RPM   0x01
#define LUAU_DEB   0x02
#define LUAU_SRC   0x04
#define LUAU_EXEC   0x08
#define LUAU_AUTOPKG   0x10
#define LUAU_UNKNOWN   0x80

Typedefs

typedef guint32 APkgType
 Describes a type of package (see LUAU_type, #define'd above).

typedef void(* AErrorFunc )(const char *string, const char *filename, const char *function, int lineno)
typedef int(* APromptFunc )(const char *title, const char *msg, int nTotal, int nDefault, const char *choice1, va_list args)
typedef void(* ACallback )(void *data)
typedef void(* AFloatCallback )(float data)
typedef void(* ACallbackWithData )(void *callback_data, void *user_data)
typedef int(* AProgressCallback )(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)

Enumerations

enum  AUpdateType { LUAU_SOFTWARE, LUAU_MESSAGE, LUAU_LIBUPDATE }
 Describes an update type (software, message, luau config update). More...

enum  AQuantType { LUAU_QUANT_FROM, LUAU_QUANT_TO, LUAU_QUANT_FOR }
enum  AQuantDataType {
  LUAU_QUANT_DATA_DATE, LUAU_QUANT_DATA_VERSION, LUAU_QUANT_DATA_INTERFACE, LUAU_QUANT_DATA_KEYWORD,
  LUAU_QUANT_DATA_INVALID
}

Functions

gboolean luau_getUpdateInfo (AUpdate *update, const char *updateID, const AProgInfo *progInfo)
 Retrieve update info (type, description, etc.) corresponding to the given ID (and program).

GPtrArray * luau_checkForUpdates (const AProgInfo *info)
 Retrieve any new updates for the specified program.

gboolean luau_installUpdate (const AProgInfo *info, const AUpdate *newUpdate, const APkgType type)
 Download and install an update of type type.

char * luau_downloadUpdate (const AProgInfo *info, const AUpdate *newUpdate, const APkgType type, const char *filename)
 Download but do not install an update of type type to filename.

gboolean luau_installPackage (const char *filename, const APkgType type)
 Install an already downloaded package.

void luau_registerErrorFunc (AErrorFunc errorFunc)
 Set a new function for outputting errors with.

void luau_registerPromptFunc (APromptFunc promptFunc)
 Set a new function for prompting the user for input with.

void luau_registerProgressCallback (AProgressCallback callback)
 Set a new function to callback (in order to show download progress) when downloading.

void luau_resetErrorFunc (void)
 Reset the error function to the default function.

void luau_resetPromptFunc (void)
 Reset the prompting function to the default function.

void luau_resetProgressCallback (void)
 Reset the download callback function to the default function.

char * luau_dateString (const ADate *date)
 Convert an ADate struct into a string.

char * luau_multPackageTypeString (APkgType types)
 Convert an APkgType (of many types) into a string.

const char * luau_packageTypeString (APkgType type)
 Convert an APkgType (of one type) into a (constant) string.

char * luau_progInfoString (const AProgInfo *info)
 Convert an AProgInfo ptr into a string.

char * luau_keywordsString (const GPtrArray *keywords)
 Convert an array of keywords into a string.

char * luau_interfaceString (const AInterface *interface)
 Convert an AInterface into a string.

const char * luau_updateTypeString (AUpdateType type)
 Convert an AUpdateType into a string.

gboolean luau_parseDate (ADate *date, const char *string)
 Convert a date string ("MM/DD/YYYY") into an ADate struct.

APkgType luau_parsePkgType (const char *typeString)
 Convert a package type string into an APkgType.

gboolean luau_parseInterface (AInterface *interface, const char *intStr)
 Convert an interface string ("x.y") into an AInterface.

GSList * luau_packageTypeList (APkgType types)
 Convert an APkgType into a list of APkgType's.

APackageluau_getUpdatePackage (const AUpdate *update, APkgType pkgType)
 Find the package of type pkgType in update.

gboolean luau_isOfType (APkgType query, APkgType type)
 Check if package type type is included in package aggregate query.

char * luau_getPackageURL (APackage *pkgInfo)
int luau_datecmp (ADate *d1, ADate *d2)
 Compare two dates (works like strcmp but for ADate's).

int luau_versioncmp (const char *required, const char *current)
 Compare two versions (works like strcmp but for version strings).

void luau_setKeyword (GPtrArray *keywords, const char *newKeyword)
 Sets a keyword.

gboolean luau_unsetKeyword (GPtrArray *keywords, const char *oldKeyword)
 Unsets a keyword.

gboolean luau_checkKeyword (const GPtrArray *keywords, const char *needle)
 Checks to see if a keyword is set.

gboolean luau_isIncompatible (AUpdate *update)
 See if an update has been marked as "Incompatible".

gboolean luau_isHidden (AUpdate *update)
 See if an update has been marked as "Hidden".

gboolean luau_isOld (AUpdate *update)
 See if an update has been marked as "Old".

gboolean luau_isVisible (AUpdate *update)
 See if an updates is visible (has not been marked as old, hidden, or incompatible).

gboolean luau_satisfiesInterface (const AInterface *wanted, const AInterface *needed)
 Check if a given interface matches an interface that is needed.

gboolean luau_satisfiesQuant (const AQuantifier *needed, const AProgInfo *installed)
AQuantDataType luau_parseQuantDataType (const char *str)
void luau_copyUpdate (AUpdate *dest, const AUpdate *src)
 Copy an AUpdate struct.

void luau_copyPackage (APackage *dest, const APackage *src)
 Copy an APackage struct.

void luau_copyProgInfo (AProgInfo *dest, const AProgInfo *src)
 Copy an AProgInfo struct.

void luau_copyInterface (AInterface *dest, const AInterface *src)
 Copy an AInterfacestruct.

void luau_copyDate (ADate *dest, const ADate *src)
 Copy an ADate struct.

void luau_copyQuants (GPtrArray *dest, const GPtrArray *src)
 Copy an array of AQuantifiers.

void luau_copyQuant (AQuantifier *dest, const AQuantifier *src)
 Copy an AQuantifier struct.

void luau_freeUpdateArray (GPtrArray *updates)
 Free an array of AUpdate's.

void luau_freeProgInfo (AProgInfo *ptr)
 Free an AProgInfo struct pointer.

void luau_freeUpdateInfo (AUpdate *ptr)
 Free an AUpdate struct pointer.

void luau_freePkgInfo (APackage *ptr)
 Free an APackage struct pointer.


Detailed Description

Interface to the libuau library.

This is the one and only header file you'll need to use and understand in order to interface with libuau from a third party program. It provides all the necessary functionality for using libuau and is the only installed header file.

Definition in file libuau.h.


Define Documentation

#define LUAU_AUTOPKG   0x10
 

Definition at line 48 of file libuau.h.

Referenced by luau_installPackage(), luau_multPackageTypeString(), luau_packageTypeList(), luau_packageTypeString(), and luau_parsePkgType().

#define LUAU_DEB   0x02
 

Definition at line 45 of file libuau.h.

Referenced by luau_installPackage(), luau_multPackageTypeString(), luau_packageTypeList(), luau_packageTypeString(), and luau_parsePkgType().

#define LUAU_EMPTY   0x00
 

Definition at line 43 of file libuau.h.

Referenced by luau_multPackageTypeString(), and luau_packageTypeString().

#define LUAU_EXEC   0x08
 

Definition at line 47 of file libuau.h.

Referenced by luau_installPackage(), luau_multPackageTypeString(), luau_packageTypeList(), luau_packageTypeString(), and luau_parsePkgType().

#define LUAU_RPM   0x01
 

Definition at line 44 of file libuau.h.

Referenced by luau_installPackage(), luau_multPackageTypeString(), luau_packageTypeList(), luau_packageTypeString(), and luau_parsePkgType().

#define LUAU_SRC   0x04
 

Definition at line 46 of file libuau.h.

Referenced by luau_installPackage(), luau_multPackageTypeString(), luau_packageTypeList(), luau_packageTypeString(), and luau_parsePkgType().

#define LUAU_UNKNOWN   0x80
 

Definition at line 49 of file libuau.h.

Referenced by luau_parsePkgType(), and parsePackage().

#define LUAU_VERSION_MAJOR   0
 

Definition at line 36 of file libuau.h.

#define LUAU_VERSION_MINOR   1
 

Definition at line 37 of file libuau.h.

#define LUAU_VERSION_PATCH   6
 

Definition at line 38 of file libuau.h.

#define LUAU_XML_INTERFACE_MAJOR   1
 

Definition at line 40 of file libuau.h.

Referenced by luau_parseUpdateFileXML().

#define LUAU_XML_INTERFACE_MINOR   1
 

Definition at line 41 of file libuau.h.

Referenced by luau_parseUpdateFileXML().


Typedef Documentation

typedef void(* ACallback)(void *data)
 

Definition at line 69 of file libuau.h.

typedef void(* ACallbackWithData)(void *callback_data, void *user_data)
 

Definition at line 71 of file libuau.h.

typedef void(* AErrorFunc)(const char * string, const char* filename, const char* function, int lineno)
 

Definition at line 66 of file libuau.h.

typedef void(* AFloatCallback)(float data)
 

Definition at line 70 of file libuau.h.

typedef guint32 APkgType
 

Describes a type of package (see LUAU_type, #define'd above).

Definition at line 58 of file libuau.h.

Referenced by luau_parsePkgType().

typedef int(* AProgressCallback)(void *clientp, double dltotal, double dlnow, double ultotal, double ulnow)
 

Definition at line 72 of file libuau.h.

typedef int(* APromptFunc)(const char * title, const char* msg, int nTotal, int nDefault, const char *choice1, va_list args)
 

Definition at line 67 of file libuau.h.


Enumeration Type Documentation

enum AQuantDataType
 

Enumeration values:
LUAU_QUANT_DATA_DATE 
LUAU_QUANT_DATA_VERSION 
LUAU_QUANT_DATA_INTERFACE 
LUAU_QUANT_DATA_KEYWORD 
LUAU_QUANT_DATA_INVALID 

Definition at line 63 of file libuau.h.

Referenced by luau_parseQuantDataType(), and parseGenericInfo().

enum AQuantType
 

Enumeration values:
LUAU_QUANT_FROM 
LUAU_QUANT_TO 
LUAU_QUANT_FOR 

Definition at line 62 of file libuau.h.

enum AUpdateType
 

Describes an update type (software, message, luau config update).

Enumeration values:
LUAU_SOFTWARE 
LUAU_MESSAGE 
LUAU_LIBUPDATE 

Definition at line 61 of file libuau.h.


Function Documentation

GPtrArray* luau_checkForUpdates const AProgInfo info  ) 
 

Retrieve any new updates for the specified program.

Check for updates for the given ID by contacting the server for the program and downloading and parsing the updates file. Returned GPtrArray must be free'd (use luau_freeUpdateArray).

  • info describes the program we want to check updates for.
    Returns:
    an array of updates for the program in question (must be fre'd).
    See also:
    luau_freeUpdateArray

Definition at line 101 of file libuau.c.

References categorizeUpdates(), DBUGOUT, AProgInfo::id, luau_net_queryServer(), and AProgInfo::url.

Referenced by luau_getUpdateInfo().

gboolean luau_checkKeyword const GPtrArray *  keywords,
const char *  needle
 

Checks to see if a keyword is set.

See if a keyword exists in a keyword array.

  • keywords is the array to check
  • needle is the keyword to look for
    Returns:
    if it exists in the array

Definition at line 821 of file libuau.c.

References g_container_free(), g_container_new_from_data(), GCONT_PTR_ARRAY, and lutil_findString().

Referenced by luau_isHidden(), luau_isIncompatible(), luau_isOld(), and luau_satisfiesQuant().

void luau_copyDate ADate dest,
const ADate src
 

Copy an ADate struct.

Copy an ADate src to dest. If src or dest is NULL, the operation will be aborted.

  • dest is the ADate struct to copy into.
  • src is the ADate struct to copy from.

Definition at line 1177 of file libuau.c.

References ADate::day, DBUGOUT, ADate::month, and ADate::year.

Referenced by luau_copyProgInfo(), luau_copyQuant(), and luau_copyUpdate().

void luau_copyInterface AInterface dest,
const AInterface src
 

Copy an AInterfacestruct.

Copy an AInterface src to dest. If src or dest is NULL, the operation will be aborted.

Definition at line 1161 of file libuau.c.

References DBUGOUT, AInterface::major, and AInterface::minor.

Referenced by luau_copyProgInfo(), and luau_copyUpdate().

void luau_copyPackage APackage dest,
const APackage src
 

Copy an APackage struct.

Definition at line 1086 of file libuau.c.

References DBUGOUT, APackage::md5sum, APackage::mirrors, APackage::size, and APackage::type.

Referenced by luau_copyUpdate().

void luau_copyProgInfo AProgInfo dest,
const AProgInfo src
 

Copy an AProgInfo struct.

Copy an AProgInfo src to dest. If src or dest is NULL, the operation will be aborted.

Definition at line 1121 of file libuau.c.

References AProgInfo::date, DBUGOUT, AProgInfo::desc, AProgInfo::fullname, g_container_copy(), g_container_free(), g_container_new_from_data(), GCONT_PTR_ARRAY, AProgInfo::id, AProgInfo::interface, AProgInfo::keywords, luau_copyDate(), luau_copyInterface(), AProgInfo::shortname, AProgInfo::url, and AProgInfo::version.

void luau_copyQuant AQuantifier dest,
const AQuantifier src
 

Copy an AQuantifier struct.

Definition at line 1200 of file libuau.c.

References AQuantifier::data, AQuantifier::dtype, ERROR, luau_copyDate(), LUAU_QUANT_DATA_DATE, LUAU_QUANT_DATA_INTERFACE, LUAU_QUANT_DATA_KEYWORD, LUAU_QUANT_DATA_VERSION, and AQuantifier::qtype.

Referenced by luau_copyQuants().

void luau_copyQuants GPtrArray *  dest,
const GPtrArray *  src
 

Copy an array of AQuantifiers.

Definition at line 1188 of file libuau.c.

References luau_copyQuant().

Referenced by luau_copyUpdate().

void luau_copyUpdate AUpdate dest,
const AUpdate src
 

Copy an AUpdate struct.

Copy an AUpdate src to dest. If src or dest is NULL, the operation will be aborted.

  • dest is the AUpdate struct to copy into.
  • src is the AUpdate struct to copy from.

Definition at line 1019 of file libuau.c.

References AUpdate::availableFormats, AUpdate::date, DBUGOUT, AUpdate::fullDesc, g_container_copy(), g_container_free(), g_container_new_from_data(), GCONT_PTR_ARRAY, AUpdate::id, AUpdate::interface, AUpdate::keywords, luau_copyDate(), luau_copyInterface(), luau_copyPackage(), luau_copyQuants(), AUpdate::newURL, AUpdate::newVersion, AUpdate::packages, AUpdate::quantifiers, AUpdate::shortDesc, and AUpdate::type.

Referenced by luau_getUpdateInfo().

int luau_datecmp ADate d1,
ADate d2
 

Compare two dates (works like strcmp but for ADate's).

Compare two dates and return an integer accordingly (in style of strcmp).

  • d1 is the first date
  • d2 is the date to compare d1 with
    Returns:
    • -1 if d1 is earlier than d2,
    • 0 if d1 is the same as d2, or
    • +1 if d1 is later than d2.

Definition at line 421 of file libuau.c.

References ADate::day, lutil_intcmp(), ADate::month, and ADate::year.

Referenced by luau_satisfiesQuant().

char* luau_dateString const ADate date  ) 
 

Convert an ADate struct into a string.

Convert an ADate into a string ("MM/DD/YYYY"). Returns "(null)" if date == NULL. Returned string must be free'd.

  • date is the date to convert into a string
    Returns:
    a string representing the date - must be free'd.

Definition at line 373 of file libuau.c.

References ADate::day, lutil_mprintf(), ADate::month, and ADate::year.

Referenced by luau_progInfoString().

char* luau_downloadUpdate const AProgInfo info,
const AUpdate newUpdate,
const APkgType  type,
const char *  downloadTo
 

Download but do not install an update of type type to filename.

Download an update to the specified location. Returned string must be examined and must be free'd. Do not assume that the update was downloaded exactly to downloadTo.

  • info describes the program we want to download an update for.
  • newUpdate describes the update we want to download.
  • type is which kind of update (eg. RPM, DEB, ...) we want to download
  • downloadTo specifies where we want to download this update to.
    Returns:
    where this update was actually downloaded (should be == downloadTo -unless- downloadTo is a directory) (must be free'd), or NULL if the operation was unsuccessful.
    See also:
    luau_installPackage

Definition at line 152 of file libuau.c.

References DBUGOUT, ERROR, luau_getPackageURL(), luau_getUpdatePackage(), luau_net_downloadUpdate(), lutil_error_prompt(), and lutil_vstrcreate().

Referenced by luau_installUpdate().

void luau_freePkgInfo APackage ptr  ) 
 

Free an APackage struct pointer.

Free an APackage struct.

  • ptr is the struct to free.

Definition at line 1323 of file libuau.c.

References ERROR, and APackage::mirrors.

Referenced by luau_freeUpdateInfo().

void luau_freeProgInfo AProgInfo ptr  ) 
 

Free an AProgInfo struct pointer.

Free an AProgInfo struct.

  • ptr is the struct to free

Definition at line 1251 of file libuau.c.

References AProgInfo::date, AProgInfo::desc, AProgInfo::displayVersion, ERROR, AProgInfo::fullname, AProgInfo::id, AProgInfo::keywords, nnull_g_free, AProgInfo::shortname, AProgInfo::url, and AProgInfo::version.

void luau_freeUpdateArray GPtrArray *  updates  ) 
 

Free an array of AUpdate's.

Free an update array, as returned by luau_checkForUpdates

  • updates is the updates array to free

Definition at line 1230 of file libuau.c.

References luau_freeUpdateInfo().

Referenced by luau_getUpdateInfo().

void luau_freeUpdateInfo AUpdate ptr  ) 
 

Free an AUpdate struct pointer.

Free an AUpdate struct

  • ptr is the struct to free

Definition at line 1278 of file libuau.c.

References AQuantifier::data, AUpdate::date, ERROR, AUpdate::fullDesc, AUpdate::id, AUpdate::keywords, luau_freePkgInfo(), AUpdate::newURL, AUpdate::newVersion, nnull_g_free, AUpdate::packages, AUpdate::quantifiers, and AUpdate::shortDesc.

Referenced by luau_freeUpdateArray().

char* luau_getPackageURL APackage pkgInfo  ) 
 

Definition at line 656 of file libuau.c.

References DBUGOUT, and APackage::mirrors.

Referenced by luau_downloadUpdate(), and luau_net_downloadUpdate().

gboolean luau_getUpdateInfo AUpdate updateInfo,
const char *  updateID,
const AProgInfo progInfo
 

Retrieve update info (type, description, etc.) corresponding to the given ID (and program).

Retrieve information for update updateID for program described by progInfo. Contacts server for program in question to retrieve all updates and then extracts the one matching updateID. Use luau_freeUpdateInfo to free the data associated with updateInfo

  • updateInfo is an AUpdate struct pointer where the data will be stored
  • updateID is the ID for the update wanted.
  • progInfo describes the program for which we're looking up an update.
    Returns:
    whether the operation was successful
    See also:
    luau_freeUpdateInfo

Definition at line 71 of file libuau.c.

References AUpdate::id, luau_checkForUpdates(), luau_copyUpdate(), luau_freeUpdateArray(), and lutil_streq().

APackage* luau_getUpdatePackage const AUpdate update,
APkgType  pkgType
 

Find the package of type pkgType in update.

Find and return an APackage struct of the type pkgType from an AUpdate. If one does not exist, return NULL.

  • update is the update to look in.
  • pkgType is the package type to find
    Returns:
    the corresponding APackage struct ptr, or NULL otherwise.

Definition at line 344 of file libuau.c.

References ERROR, luau_packageTypeString(), AUpdate::packages, and APackage::type.

Referenced by luau_downloadUpdate().

gboolean luau_installPackage const char *  filename,
const APkgType  type
 

Install an already downloaded package.

Installs a package that has already been downloaded.

  • filename is the location where the update package can be found.
  • type is the type of update (eg. RPM, DEB, ...) we're installing.
    Returns:
    whether the operation was successful.

Definition at line 223 of file libuau.c.

References ERROR, LUAU_AUTOPKG, LUAU_DEB, LUAU_EXEC, luau_install_autopkg(), luau_install_deb(), luau_install_exec(), luau_install_rpm(), luau_install_src(), LUAU_RPM, and LUAU_SRC.

Referenced by luau_installUpdate().

gboolean luau_installUpdate const AProgInfo info,
const AUpdate newUpdate,
const APkgType  type
 

Download and install an update of type type.

Install an update.

  • info describes the program we're updating
  • newUpdate describes the update we're installing
  • type is the type of package (eg, RPM, DEB, ...) we want to install.
    Returns:
    whether the operation succeeded

Definition at line 122 of file libuau.c.

References luau_downloadUpdate(), luau_installPackage(), and lutil_getTempFilename().

char* luau_interfaceString const AInterface interface  ) 
 

Convert an AInterface into a string.

Take an AInterface struct and convert it into a string of form "x.y", where x is the major and y the minor interface version. If the major and minor values are both -1, then NULL will be returned. The returned string is allocated dynamically and must be free'd.

  • interface is the AInterface struct to convert into a string
    Returns:
    a newly allocated string representing the AInterface (must be free'd).

Definition at line 998 of file libuau.c.

References lutil_mprintf(), AInterface::major, and AInterface::minor.

gboolean luau_isHidden AUpdate update  ) 
 

See if an update has been marked as "Hidden".

Check if an update has been marked as "hidden"

  • update is the update to check
    Returns:
    whether it has been marked as hidden

Definition at line 857 of file libuau.c.

References AUpdate::keywords, and luau_checkKeyword().

Referenced by luau_isVisible().

gboolean luau_isIncompatible AUpdate update  ) 
 

See if an update has been marked as "Incompatible".

Check if an update has been marked as "incompatible"

  • update is the update to check
    Returns:
    whether it has been marked as incompatible

Definition at line 843 of file libuau.c.

References AUpdate::keywords, and luau_checkKeyword().

Referenced by luau_isVisible().

gboolean luau_isOfType APkgType  query,
APkgType  type
 

Check if package type type is included in package aggregate query.

Check to see if query contains type type.

  • query is the APkgType to check
  • type is the type to see if query contains.
    Returns:
    TRUE if it does, FALSE otherwise

Definition at line 561 of file libuau.c.

Referenced by luau_multPackageTypeString(), and luau_packageTypeList().

gboolean luau_isOld AUpdate update  ) 
 

See if an update has been marked as "Old".

Definition at line 865 of file libuau.c.

References AUpdate::keywords, and luau_checkKeyword().

Referenced by luau_isVisible().

gboolean luau_isVisible AUpdate update  ) 
 

See if an updates is visible (has not been marked as old, hidden, or incompatible).

Definition at line 873 of file libuau.c.

References luau_isHidden(), luau_isIncompatible(), and luau_isOld().

char* luau_keywordsString const GPtrArray *  keywords  ) 
 

Convert an array of keywords into a string.

Convert an array of keywords into a string, separated by commas. Resultant string must be free'd.

  • keywords are the keywords to convert
    Returns:
    a string representing them (must be free'd)

Definition at line 760 of file libuau.c.

References g_container_free(), g_container_new_from_data(), GCONT_PTR_ARRAY, and lutil_strjoin().

Referenced by luau_progInfoString().

char* luau_multPackageTypeString APkgType  types  ) 
 

Convert an APkgType (of many types) into a string.

Convert an APkgType of multiple package types into a string. Resultant string must be free'd.

  • types is the APkgType representing multiple types to convert
    Returns:
    a space-separated string of the types it contains
    See also:
    luau_packageTypeString

Definition at line 575 of file libuau.c.

References ERROR, LUAU_AUTOPKG, LUAU_DEB, LUAU_EMPTY, LUAU_EXEC, luau_isOfType(), LUAU_RPM, LUAU_SRC, and lutil_createString().

GSList* luau_packageTypeList APkgType  types  ) 
 

Convert an APkgType into a list of APkgType's.

Take an APkgType of multiple types and convert it into a list of single APkgType's.

  • types is an APkgType of multiple types
    Returns:
    a GSList of single APkgType's

Definition at line 697 of file libuau.c.

References LUAU_AUTOPKG, LUAU_DEB, LUAU_EXEC, luau_isOfType(), LUAU_RPM, and LUAU_SRC.

const char* luau_packageTypeString APkgType  type  ) 
 

Convert an APkgType (of one type) into a (constant) string.

Convert an APkgType of one package type into a string. Resultant string should not be free'd (constant string).

Definition at line 613 of file libuau.c.

References LUAU_AUTOPKG, LUAU_DEB, LUAU_EMPTY, LUAU_EXEC, LUAU_RPM, and LUAU_SRC.

Referenced by luau_getUpdatePackage().

gboolean luau_parseDate ADate date,
const char *  string
 

Convert a date string ("MM/DD/YYYY") into an ADate struct.

Convert a string of format "MM/DD/YYYY" into an ADate. If string == NULL, or an error occurs in reading the string, all the fields of the resultant ADate will be set to 0.

  • date is the ADate to write the parsed information into
  • string is the string to convert to an ADate
    Returns:
    whether the operation was successful

Definition at line 394 of file libuau.c.

References ADate::day, ADate::month, and ADate::year.

Referenced by parseGenericInfo(), and parseQuantData().

gboolean luau_parseInterface AInterface interface,
const char *  intStr
 

Convert an interface string ("x.y") into an AInterface.

Take a string ("x.y", where x is the major and y the minor interface version)and convert it into an AInterface, writing the data into interface. If intStr == NULL or there is an error in reading the string, then both major and minor will be set to -1.

  • interface is the AInterface struct to write data into
  • intStr is the string to parse (of form "x.y")
    Returns:
    whether the operation was successful

Definition at line 970 of file libuau.c.

References lutil_isCompletelyBlank(), AInterface::major, and AInterface::minor.

Referenced by luau_parseUpdateFileXML(), parseQuantData(), and parseSoftware().

APkgType luau_parsePkgType const char *  typeString  ) 
 

Convert a package type string into an APkgType.

Take a string representing a package type ("RPM", "DEB", etc.) and convert it into an APkgType.

  • typeString is the string to convert
    Returns:
    the corresponding APkgType, or LUAU_UNKNOWN if unrecognized
    See also:
    luau_packageTypeList

Definition at line 644 of file libuau.c.

References APkgType, LUAU_AUTOPKG, LUAU_DEB, LUAU_EXEC, LUAU_RPM, LUAU_SRC, LUAU_UNKNOWN, and lutil_streq().

Referenced by parsePackage().

AQuantDataType luau_parseQuantDataType const char *  str  ) 
 

Definition at line 942 of file libuau.c.

References AQuantDataType, LUAU_QUANT_DATA_DATE, LUAU_QUANT_DATA_INTERFACE, LUAU_QUANT_DATA_INVALID, LUAU_QUANT_DATA_KEYWORD, LUAU_QUANT_DATA_VERSION, and lutil_strcaseeq().

Referenced by parseGenericInfo().

char* luau_progInfoString const AProgInfo info  ) 
 

Convert an AProgInfo ptr into a string.

Convert an AProgInfo struct into a string. Resultant string must be free'd.

  • info is a AProgInfo struct to convert
    Returns:
    a new allocated string representing it (must be free'd).

Definition at line 738 of file libuau.c.

References AProgInfo::date, AProgInfo::desc, AProgInfo::fullname, AProgInfo::id, AProgInfo::keywords, luau_dateString(), luau_keywordsString(), lutil_mprintf(), AProgInfo::url, and AProgInfo::version.

void luau_registerErrorFunc AErrorFunc  errorFunc  ) 
 

Set a new function for outputting errors with.

Set the function to display luau errors with. See the definition of AErrorFunc for specific function parameters.

  • errorFunc is the new error output function.
See also:
AErrorFunc

Definition at line 262 of file libuau.c.

References lutil_error_setErrorFunc().

void luau_registerProgressCallback AProgressCallback  callback  ) 
 

Set a new function to callback (in order to show download progress) when downloading.

Set the function to display download progress with. See the definition of AProgressFunc for specific function parameters (and maybe the libcurl documentation too while you're at it - specifically the CURLOPT_PROGRESSFUNC option). Default behavior is not to display anything.

  • callback is the new progress callback to use.
See also:
AProgressCallback

Definition at line 292 of file libuau.c.

References lutil_ftp_setCallbackFunc().

void luau_registerPromptFunc APromptFunc  promptFunc  ) 
 

Set a new function for prompting the user for input with.

Set the function to prompt the user for input with. See the definition of APromptFunc for specific function parameters. Note that the default behavior (if you don't define a new one) is simply not to prompt the user and select the default choice. This is probably not what you want!

  • promptFunc is the new prompting function to use
See also:
APromptFunc

Definition at line 277 of file libuau.c.

References lutil_error_setPromptFunc().

void luau_resetErrorFunc void   ) 
 

Reset the error function to the default function.

Reset the error facilities to their default behavior (that is, simply displaying errors to the command line).

See also:
luau_registerErrorFunc

Definition at line 303 of file libuau.c.

References lutil_error_resetErrorFunc().

void luau_resetProgressCallback void   ) 
 

Reset the download callback function to the default function.

Reset the progress callback (which doesn't display anything).

See also:
luau_registerProgressCallback

Definition at line 324 of file libuau.c.

References lutil_ftp_resetCallbackFunc().

void luau_resetPromptFunc void   ) 
 

Reset the prompting function to the default function.

Reset the prompting facilities to their default behavior (that is, don't ask but just select the default option).

See also:
luau_registerPromptFunc

Definition at line 314 of file libuau.c.

References lutil_error_resetPromptFunc().

gboolean luau_satisfiesInterface const AInterface wanted,
const AInterface needed
 

Check if a given interface matches an interface that is needed.

Check if a given program/update interface satisfies the one needed. Conditions for being satisfactory:

  1. wanted->major == needed->major
  2. wanted->minor >= needed->minor

  • wanted is the AInterface we want to check
  • needed is the AInterface to test against (the "needed" interface)
    Returns:
    whether wanted satisfies needed

Definition at line 890 of file libuau.c.

References AInterface::major, and AInterface::minor.

Referenced by luau_parseUpdateFileXML(), and luau_satisfiesQuant().

gboolean luau_satisfiesQuant const AQuantifier needed,
const AProgInfo installed
 

Definition at line 895 of file libuau.c.

References AQuantifier::data, AProgInfo::date, AQuantifier::dtype, ERROR, AProgInfo::interface, AProgInfo::keywords, luau_checkKeyword(), luau_datecmp(), LUAU_QUANT_DATA_DATE, LUAU_QUANT_DATA_INTERFACE, LUAU_QUANT_DATA_KEYWORD, LUAU_QUANT_DATA_VERSION, LUAU_QUANT_FOR, LUAU_QUANT_FROM, LUAU_QUANT_TO, luau_satisfiesInterface(), luau_versioncmp(), AQuantifier::qtype, and AProgInfo::version.

Referenced by isIncompatible().

void luau_setKeyword GPtrArray *  keywords,
const char *  newKeyword
 

Sets a keyword.

Add a new keyword to a keyword array.

  • keywords is the keyword array to add on to
  • newKeyword is the new keyword to add

Definition at line 782 of file libuau.c.

Referenced by categorizeUpdates().

gboolean luau_unsetKeyword GPtrArray *  keywords,
const char *  oldKeyword
 

Unsets a keyword.

Remove a keyword from a keyword array. Return if it was there in the first place.

  • keywords is the keyword array to edit
  • oldKeyword is the keyword to remove
    Returns:
    whether the keyword existed in the array at all

Definition at line 796 of file libuau.c.

References lutil_streq().

const char* luau_updateTypeString AUpdateType  type  ) 
 

Convert an AUpdateType into a string.

Convert an AUpdateType into a constant string. Resultant string should not be free'd.

  • type is an AUpdateType to convert
    Returns:
    a constant string representing it

Definition at line 722 of file libuau.c.

References LUAU_LIBUPDATE, LUAU_MESSAGE, and LUAU_SOFTWARE.

int luau_versioncmp const char *  required,
const char *  current
 

Compare two versions (works like strcmp but for version strings).

Definition at line 473 of file libuau.c.

References compareAlphaNumeric(), g_container_destroy(), g_container_index(), GContainer::len, lutil_containsAlpha(), lutil_gsplit(), lutil_streq(), and lutil_strToLower().

Referenced by isOld(), and luau_satisfiesQuant().


Generated on Mon Apr 12 22:17:11 2004 for luau by doxygen 1.3.2