createrepo_c library
0.2.1
C library for metadata manipulation
Main Page
Modules
Data Structures
Files
File List
All
Data Structures
Functions
Variables
Typedefs
Enumerations
Enumerator
Groups
Pages
sqlite.h
1
/* createrepo_c - Library of routines for manipulation with repodata
2
* Copyright (C) 2012 Tomas Mlcoch
3
*
4
* This program is free software; you can redistribute it and/or
5
* modify it under the terms of the GNU General Public License
6
* as published by the Free Software Foundation; either version 2
7
* of the License, or (at your option) any later version.
8
*
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
13
*
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17
* USA.
18
*/
19
20
#ifndef __C_CREATEREPOLIB_SQLITE_H__
21
#define __C_CREATEREPOLIB_SQLITE_H__
22
23
#include <glib.h>
24
#include <sqlite3.h>
25
#include "package.h"
26
27
#ifdef __cplusplus
28
extern
"C"
{
29
#endif
30
59
#define CR_DB_CACHE_DBVERSION 10
63
typedef enum {
64
CR_DB_PRIMARY
,
65
CR_DB_FILELISTS
,
66
CR_DB_OTHER
,
67
CR_DB_SENTINEL
,
68
}
cr_DatabaseType
;
69
70
typedef
struct
_DbPrimaryStatements *
cr_DbPrimaryStatements
;
72
typedef
struct
_DbFilelistsStatements *
cr_DbFilelistsStatements
;
74
typedef
struct
_DbOtherStatements *
cr_DbOtherStatements
;
79
typedef
union
{
80
cr_DbPrimaryStatements
pri
;
81
cr_DbFilelistsStatements
fil
;
82
cr_DbOtherStatements
oth
;
83
}
cr_Statements
;
84
87
typedef
struct
{
88
sqlite3 *
db
;
90
cr_DatabaseType
type
;
92
cr_Statements
statements
;
94
}
cr_SqliteDb
;
95
105
#define cr_db_open_primary(PATH, ERR) cr_db_open(PATH, CR_DB_PRIMARY, ERR)
106
116
#define cr_db_open_filelists(PATH, ERR) cr_db_open(PATH, CR_DB_FILELISTS, ERR)
117
128
#define cr_db_open_other(PATH, ERR) cr_db_open(PATH, CR_DB_OTHER, ERR)
129
141
cr_SqliteDb
*
cr_db_open
(
const
char
*path,
142
cr_DatabaseType
db_type,
143
GError **err);
144
151
int
cr_db_add_pkg
(
cr_SqliteDb
*sqlitedb,
152
cr_Package
*pkg,
153
GError **err);
154
161
int
cr_db_dbinfo_update
(
cr_SqliteDb
*sqlitedb,
162
const
char
*checksum,
163
GError **err);
164
173
int
cr_db_close
(
cr_SqliteDb
*sqlitedb, GError **err);
174
177
#ifdef __cplusplus
178
}
179
#endif
180
181
#endif
/* __C_CREATEREPOLIB_SQLITE_H__ */
src
sqlite.h
Generated on Wed Aug 14 2013 09:00:21 for createrepo_c library by
1.8.4