File: sqlite_inter.h

package info (click to toggle)
kaya 0.2.0-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 3,012 kB
  • ctags: 1,307
  • sloc: cpp: 6,691; haskell: 4,833; sh: 2,868; yacc: 768; makefile: 700; perl: 87
file content (41 lines) | stat: -rw-r--r-- 793 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#ifndef _SQLITE_INTER_H // -*-C++-*-
#define _SQLITE_INTER_H

// Glue functions for talking to libsqlite3

#include <stdfuns.h>
#include <KayaAPI.h>
#include <sqlite3.h>

using namespace std;

class SQLiteConnection : public gc {
public:
    sqlite3* db;
    int ok;
};

class SQLiteResult : public gc {
public:
    KArray res_table;
    KArray col_names;
    int rows;
    int cols;
    int res;
};

extern "C" {
    void* sqlite_connect(wchar_t* info);
    int sqlite_ok(void* con);
    wchar_t* sqlite_getError(void* con);
    void sqlite_close(void* con);
    void* sqlite_exec(void* con, wchar_t* query);

    KArray sql_getcolnames(void* res);
    KArray sql_getrestable(void* res);
    int sql_numrows(void* res);
    int sql_numcols(void* res);
    int sql_resrc(void* res);
}

#endif