createrepo_c library
C library for metadata manipulation
 Vše Třídy Funkce Proměnné Definice typů Výčty Hodnoty výčtu Skupiny Stránky
SQLite metadata API.

Definice maker

#define cr_open_primary_db(PATH, ERR)   cr_open_db(PATH, CR_DB_PRIMARY, ERR)
#define cr_open_filelists_db(PATH, ERR)   cr_open_db(PATH, CR_DB_FILELISTS, ERR)
#define cr_open_other_db(PATH, ERR)   cr_open_db(PATH, CR_DB_OTHER, ERR)
#define cr_close_primary_db(DB, ERR)   cr_close_db(DB, CR_DB_PRIMARY, ERR)
#define cr_close_filelists_db(DB, ERR)   cr_close_db(DB, CR_DB_FILELISTS, ERR)
#define cr_close_other_db(DB, ERR)   cr_close_db(DB, CR_DB_OTHER, ERR)

Výčty

enum  cr_DatabaseType { CR_DB_PRIMARY, CR_DB_FILELISTS, CR_DB_OTHER }

Funkce

sqlite3 * cr_open_db (const char *path, cr_DatabaseType db_type, GError **err)
cr_DbPrimaryStatements cr_prepare_primary_db_statements (sqlite3 *db, GError **err)
cr_DbFilelistsStatements cr_prepare_filelists_db_statements (sqlite3 *db, GError **err)
cr_DbOtherStatements cr_prepare_other_db_statements (sqlite3 *db, GError **err)
void cr_destroy_primary_db_statements (cr_DbPrimaryStatements stmts)
void cr_destroy_filelists_db_statements (cr_DbFilelistsStatements stmts)
void cr_destroy_other_db_statements (cr_DbOtherStatements stmts)
void cr_add_primary_pkg_db (cr_DbPrimaryStatements stmts, cr_Package *pkg)
void cr_add_filelists_pkg_db (cr_DbFilelistsStatements stmts, cr_Package *pkg)
void cr_add_other_pkg_db (cr_DbOtherStatements stmts, cr_Package *pkg)
void cr_dbinfo_update (sqlite3 *db, const char *checksum, GError **err)
void cr_close_db (sqlite3 *db, cr_DatabaseType db_type, GError **err)

Detailní popis


Dokumentace k definicím maker

#define cr_close_filelists_db (   DB,
  ERR 
)    cr_close_db(DB, CR_DB_FILELISTS, ERR)

Macro over cr_close_db function. Close db.

  • creates indexes on tables
  • commits transaction
  • closes db
    Parametry:
    DBopen db connection
    ERR**GError

Definice je uvedena na řádku 107 v souboru sqlite.h.

#define cr_close_other_db (   DB,
  ERR 
)    cr_close_db(DB, CR_DB_OTHER, ERR)

Macro over cr_close_db function. Close db.

  • creates indexes on tables
  • commits transaction
  • closes db
    Parametry:
    DBopen db connection
    ERR**GError

Definice je uvedena na řádku 117 v souboru sqlite.h.

#define cr_close_primary_db (   DB,
  ERR 
)    cr_close_db(DB, CR_DB_PRIMARY, ERR)

Macro over cr_close_db function. Close db.

  • creates indexes on tables
  • commits transaction
  • closes db
    Parametry:
    DBopen db connection
    ERR**GError

Definice je uvedena na řádku 97 v souboru sqlite.h.

#define cr_open_filelists_db (   PATH,
  ERR 
)    cr_open_db(PATH, CR_DB_FILELISTS, ERR)

Macro over cr_open_db function. Open (create new) filelists sqlite sqlite db.

  • creates db file
  • creates filelists tables
  • creates info table
  • tweak some db params
    Parametry:
    PATHPath to the db file.
    ERR**GError
    Návratová hodnota:
    open db pointer

Definice je uvedena na řádku 74 v souboru sqlite.h.

#define cr_open_other_db (   PATH,
  ERR 
)    cr_open_db(PATH, CR_DB_OTHER, ERR)

Macro over cr_open_db function. Open (create new) other sqlite sqlite db.

  • creates db file
  • opens transaction
  • creates other tables
  • creates info table
  • tweak some db params
    Parametry:
    PATHPath to the db file.
    ERR**GError
    Návratová hodnota:
    open db connection

Definice je uvedena na řádku 87 v souboru sqlite.h.

#define cr_open_primary_db (   PATH,
  ERR 
)    cr_open_db(PATH, CR_DB_PRIMARY, ERR)

Macro over cr_open_db function. Open (create new) primary sqlite sqlite db.

  • creates db file
  • creates primary tables
  • creates info table
  • tweak some db params
    Parametry:
    PATHPath to the db file.
    ERR**GError
    Návratová hodnota:
    open db pointer

Definice je uvedena na řádku 62 v souboru sqlite.h.


Dokumentace výčtových typů

Database type.

Hodnoty výčtu:
CR_DB_PRIMARY 

primary

CR_DB_FILELISTS 

filelists

CR_DB_OTHER 

other

Definice je uvedena na řádku 46 v souboru sqlite.h.


Dokumentace funkcí

void cr_add_filelists_pkg_db ( cr_DbFilelistsStatements  stmts,
cr_Package pkg 
)

Add package into the database.

Parametry:
stmtsobject with compiled statements
pkgpackage object
void cr_add_other_pkg_db ( cr_DbOtherStatements  stmts,
cr_Package pkg 
)

Add package into the database.

Parametry:
stmtsobject with compiled statements
pkgpackage object
void cr_add_primary_pkg_db ( cr_DbPrimaryStatements  stmts,
cr_Package pkg 
)

Add package into the database.

Parametry:
stmtsobject with compiled statements
pkgpackage object
void cr_close_db ( sqlite3 *  db,
cr_DatabaseType  db_type,
GError **  err 
)

Close db.

  • creates indexes on tables
  • commits transaction
  • closes db
    Parametry:
    dbopen db connection
    db_typeType of database (primary, filelists, other)
    err**GError
void cr_dbinfo_update ( sqlite3 *  db,
const char *  checksum,
GError **  err 
)

Insert record into the updateinfo table

Parametry:
dbopen db connection
checksumcompressed xml file checksum
err**GError
void cr_destroy_filelists_db_statements ( cr_DbFilelistsStatements  stmts)

Frees cr_DbFilelistsStatements object.

Parametry:
stmtsstatements object
void cr_destroy_other_db_statements ( cr_DbOtherStatements  stmts)

Frees cr_DbOtherStatements object.

Parametry:
stmtsstatements object
void cr_destroy_primary_db_statements ( cr_DbPrimaryStatements  stmts)

Frees cr_DbPrimaryStatements object.

Parametry:
stmtsstatements object
sqlite3* cr_open_db ( const char *  path,
cr_DatabaseType  db_type,
GError **  err 
)

Open (create new) other sqlite sqlite db.

  • creates db file
  • opens transaction
  • creates other tables
  • creates info table
  • tweak some db params
    Parametry:
    pathPath to the db file.
    db_typeType of database (primary, filelists, other)
    err**GError
    Návratová hodnota:
    open db connection
cr_DbFilelistsStatements cr_prepare_filelists_db_statements ( sqlite3 *  db,
GError **  err 
)

Prepare compiled statements for use in the cr_add_filelists_pkg_db function.

Parametry:
dbOpen db connection
err**GError
Návratová hodnota:
cr_DbFilelistsStatements object
cr_DbOtherStatements cr_prepare_other_db_statements ( sqlite3 *  db,
GError **  err 
)

Prepare compiled statements for use in the cr_add_other_pkg_db function.

Parametry:
dbOpen db connection
err**GError
Návratová hodnota:
cr_DbOtherStatements object
cr_DbPrimaryStatements cr_prepare_primary_db_statements ( sqlite3 *  db,
GError **  err 
)

Prepare compiled statements for use in the cr_add_primary_pkg_db function.

Parametry:
dbOpen db connection
err**GError
Návratová hodnota:
cr_DbPrimaryStatements object