libUnihan
0.5.3
|
00001 00008 /* 00009 * Copyright © 2008 Red Hat, Inc. All rights reserved. 00010 * Copyright © 2008 Ding-Yi Chen <dchen at redhat dot com> 00011 * 00012 * This file is part of the libUnihan Project. 00013 * 00014 * This library is free software; you can redistribute it and/or 00015 * modify it under the terms of the GNU Lesser General Public 00016 * License as published by the Free Software Foundation; either 00017 * version 2 of the License, or (at your option) any later version. 00018 * 00019 * This library is distributed in the hope that it will be useful, 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 * GNU Lesser General Public License for more details. 00023 * 00024 * You should have received a copy of the GNU Lesser General Public 00025 * License along with this program; if not, write to the 00026 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 00027 * Boston, MA 02111-1307 USA 00028 */ 00029 00030 00031 00032 #ifndef SQLITE_FUNCTIONS_H_ 00033 #define SQLITE_FUNCTIONS_H_ 00034 #include <sqlite3.h> 00035 #include "str_functions.h" 00036 00044 #ifndef SQLITE_OPEN_READONLY 00045 00048 #define SQLITE_OPEN_READONLY 0x00000001 00049 #endif 00050 00051 #ifndef SQLITE_OPEN_READWRITE 00052 00055 #define SQLITE_OPEN_READWRITE 0x00000002 00056 #endif 00057 00058 #ifndef SQLITE_OPEN_CREATE 00059 00064 #define SQLITE_OPEN_CREATE 0x00000004 00065 #endif 00066 00078 #ifndef SQL_RESULT_FIELD_CHUNK_SIZE 00079 00082 # define SQL_RESULT_FIELD_CHUNK_SIZE 2048 00083 #endif 00084 00085 #ifndef SQL_RESULT_FIELD_ELEMENT_COUNT 00086 00089 # define SQL_RESULT_FIELD_ELEMENT_COUNT 128 00090 #endif 00091 00092 #ifndef SQL_RESULT_FIELD_CONST_COUNT 00093 00097 # define SQL_RESULT_FIELD_CONST_COUNT 0 00098 #endif 00099 00100 #ifndef SQL_RESULT_RESULT_CHUNK_SIZE 00101 00104 # define SQL_RESULT_RESULT_CHUNK_SIZE 65536 00105 #endif 00106 00107 #ifndef SQL_RESULT_RESULT_ELEMENT_COUNT 00108 00111 # define SQL_RESULT_RESULT_ELEMENT_COUNT 512 00112 #endif 00113 00114 #ifndef SQL_RESULT_RESULT_CONST_COUNT 00115 00118 # define SQL_RESULT_RESULT_CONST_COUNT 0 00119 #endif 00120 00146 typedef struct { 00147 StringList *fieldList; 00148 StringList *resultList; 00149 int colCount; 00150 int execResult; 00151 char *errMsg; 00152 } SQL_Result; 00153 00159 SQL_Result *sql_result_new(); 00160 00168 StringList *sql_result_free(SQL_Result *sResult, gboolean freeResult); 00169 00182 int sqlite_count_matches(sqlite3 *db,const char * sqlClause,char **errMsg_ptr); 00183 00191 SQL_Result *sqlite_get_sql_result(sqlite3 *db, const char *sqlClause); 00192 00199 SQL_Result *sqlite_get_tableNames(sqlite3 *db); 00200 00217 StringList *sqlite_get_fieldNames(sqlite3 *db,const char * sqlClause, int *execResult_ptr, char **errMsg_ptr); 00218 00231 char *sqlite_value_signed_text(sqlite3_value *value); 00232 00245 char *sqlite_value_signed_text_buffer(char *buf,sqlite3_value *value); 00246 00247 #endif /* SQLITE_FUNCTIONS_H_ */ 00248