mirror of
https://github.com/mdbtools/mdbtools.git
synced 2025-04-05 20:31:00 +08:00
49 lines
1.1 KiB
C
49 lines
1.1 KiB
C
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <glib.h>
|
|
#include <mdbtools.h>
|
|
|
|
typedef struct {
|
|
MdbHandle *mdb;
|
|
int all_columns;
|
|
int num_columns;
|
|
GPtrArray *columns;
|
|
int num_tables;
|
|
GPtrArray *tables;
|
|
int num_sargs;
|
|
GPtrArray *sargs;
|
|
} MdbSQL;
|
|
|
|
typedef struct {
|
|
char *name;
|
|
int disp_size;
|
|
} MdbSQLColumn;
|
|
|
|
typedef struct {
|
|
char *name;
|
|
char *alias;
|
|
} MdbSQLTable;
|
|
|
|
typedef struct {
|
|
char *col_name;
|
|
MdbSarg *sarg;
|
|
} MdbSQLSarg;
|
|
|
|
#undef YY_INPUT
|
|
#define YY_INPUT(b, r, ms) (r = mdb_sql_yyinput(b, ms));
|
|
|
|
MdbSQL *mdb_sql_init();
|
|
MdbSQLSarg *mdb_sql_alloc_sarg();
|
|
MdbSQLColumn *mdb_sql_alloc_column();
|
|
MdbSQLTable *mdb_sql_alloc_table();
|
|
MdbHandle *mdb_sql_open(MdbSQL *sql, char *db_name);
|
|
int mdb_sql_add_sarg(MdbSQL *sql, char *col_name, int op, char *constant);
|
|
int mdb_sql_all_columns(MdbSQL *sql);
|
|
int mdb_sql_add_column(MdbSQL *sql, char *column_name);
|
|
int mdb_sql_add_table(MdbSQL *sql, char *table_name);
|
|
void mdb_sql_dump(MdbSQL *sql);
|
|
void mdb_sql_exit(MdbSQL *sql);
|
|
void mdb_sql_reset(MdbSQL *sql);
|
|
void mdb_sql_listtables(MdbSQL *sql);
|
|
void mdb_sql_select(MdbSQL *sql);
|