00001 // File: $Id$ 00002 // Author: John Wu <John.Wu at acm.org> 00003 // Lawrence Berkeley National Laboratory 00004 // Copyright 2006-2011 the Regents of the University of California 00005 #ifndef IBIS_CAPI_H 00006 #define IBIS_CAPI_H 00007 00008 00009 00010 00011 00012 00013 00014 00015 00016 00017 00018 00019 00020 00021 00022 #if _MSC_VER >= 1000 00023 #pragma once 00024 #endif // _MSC_VER >= 1000 00025 00026 #if !defined(WITHOUT_FASTBIT_CONFIG_H) && !defined(__MINGW32__) && !defined(_MSC_VER) 00027 #include "fastbit-config.h" 00028 #endif 00029 #if defined(HAVE_INTTYPES_H) || defined(sun) || defined(__MINGW32__) || defined(__FreeBSD__) 00030 #include <inttypes.h> 00031 #elif defined(HAVE_STDINT_H) || defined(unix) || defined(__APPLE__) 00032 #include <stdint.h> 00033 #elif defined(_WIN32) && defined(_MSC_VER) 00034 // MS windows has its own exact-width types, use them 00035 # ifndef int16_t 00036 # define int16_t __int16 00037 # endif 00038 # ifndef uint16_t 00039 # define uint16_t unsigned __int16 00040 # endif 00041 # ifndef int32_t 00042 # define int32_t __int32 00043 # endif 00044 # ifndef uint32_t 00045 # define uint32_t unsigned __int32 00046 # endif 00047 # ifndef int64_t 00048 # define int64_t __int64 00049 # endif 00050 # ifndef uint64_t 00051 # define uint64_t unsigned __int64 00052 # endif 00053 #else 00054 #error Donot know how to find the exact width data types! 00055 #endif 00056 #if defined(_WIN32) && (defined(_MSC_VER) || defined(__MINGW32__)) 00057 # if defined(_USRDLL) || defined(CXX_USE_DLL) 00058 # if defined(DLL_EXPORT) 00059 # define FASTBIT_DLLSPEC __declspec(dllexport) 00060 # else 00061 # define FASTBIT_DLLSPEC __declspec(dllimport) 00062 # endif 00063 # else 00064 # define FASTBIT_DLLSPEC 00065 # endif 00066 #else 00067 # define FASTBIT_DLLSPEC 00068 #endif 00069 #include <stdio.h> // FILE* 00070 00073 #ifdef __cplusplus 00074 extern "C" { 00075 #endif 00076 00077 FASTBIT_DLLSPEC int 00078 fastbit_build_indexes(const char *indexLocation, 00079 const char *indexOptions); 00081 FASTBIT_DLLSPEC int fastbit_purge_indexes(const char *indexLocation); 00083 FASTBIT_DLLSPEC int 00084 fastbit_build_index(const char *indexLocation, const char* cname, 00085 const char *indexOptions); 00087 FASTBIT_DLLSPEC int 00088 fastbit_purge_index(const char *indexLocation, const char* cname); 00089 FASTBIT_DLLSPEC int fastbit_reorder_partition(const char *dir); 00090 00092 struct FastBitQuery; 00094 typedef struct FastBitQuery* FastBitQueryHandle; 00095 00102 FASTBIT_DLLSPEC FastBitQueryHandle 00103 fastbit_build_query(const char *selectClause, const char *indexLocation, 00104 const char *queryConditions); 00107 FASTBIT_DLLSPEC int fastbit_destroy_query(FastBitQueryHandle query); 00108 00112 FASTBIT_DLLSPEC int fastbit_get_result_rows(FastBitQueryHandle query); 00115 FASTBIT_DLLSPEC int fastbit_get_result_columns(FastBitQueryHandle query); 00117 FASTBIT_DLLSPEC const char* 00118 fastbit_get_select_clause(FastBitQueryHandle query); 00120 FASTBIT_DLLSPEC const char* 00121 fastbit_get_from_clause(FastBitQueryHandle query); 00123 FASTBIT_DLLSPEC const char* 00124 fastbit_get_where_clause(FastBitQueryHandle query); 00125 00135 FASTBIT_DLLSPEC const float* 00136 fastbit_get_qualified_floats(FastBitQueryHandle query, 00137 const char* cname); 00138 FASTBIT_DLLSPEC const double* 00139 fastbit_get_qualified_doubles(FastBitQueryHandle query, 00140 const char* cname); 00141 FASTBIT_DLLSPEC const signed char* 00142 fastbit_get_qualified_bytes(FastBitQueryHandle query, 00143 const char* cname); 00144 FASTBIT_DLLSPEC const int16_t* 00145 fastbit_get_qualified_shorts(FastBitQueryHandle query, 00146 const char* cname); 00147 FASTBIT_DLLSPEC const int32_t* 00148 fastbit_get_qualified_ints(FastBitQueryHandle query, 00149 const char* cname); 00150 FASTBIT_DLLSPEC const int64_t* 00151 fastbit_get_qualified_longs(FastBitQueryHandle query, 00152 const char* cname); 00153 FASTBIT_DLLSPEC const unsigned char* 00154 fastbit_get_qualified_ubytes(FastBitQueryHandle query, 00155 const char* cname); 00156 FASTBIT_DLLSPEC const uint16_t* 00157 fastbit_get_qualified_ushorts(FastBitQueryHandle query, 00158 const char* cname); 00159 FASTBIT_DLLSPEC const uint32_t* 00160 fastbit_get_qualified_uints(FastBitQueryHandle query, 00161 const char* cname); 00162 FASTBIT_DLLSPEC const uint64_t* 00163 fastbit_get_qualified_ulongs(FastBitQueryHandle query, 00164 const char* cname); 00165 FASTBIT_DLLSPEC const char** 00166 fastbit_get_qualified_strings(FastBitQueryHandle query, 00167 const char* cname); 00169 00174 struct FastBitResultSet; 00176 typedef struct FastBitResultSet* FastBitResultSetHandle; 00177 00179 FASTBIT_DLLSPEC FastBitResultSetHandle 00180 fastbit_build_result_set(FastBitQueryHandle query); 00182 FASTBIT_DLLSPEC int 00183 fastbit_destroy_result_set(FastBitResultSetHandle rset); 00184 00186 FASTBIT_DLLSPEC int fastbit_result_set_next(FastBitResultSetHandle rset); 00188 FASTBIT_DLLSPEC int 00189 fastbit_result_set_get_int(FastBitResultSetHandle rset, const char *cname); 00191 FASTBIT_DLLSPEC unsigned 00192 fastbit_result_set_get_unsigned(FastBitResultSetHandle rset, 00193 const char *cname); 00196 FASTBIT_DLLSPEC float 00197 fastbit_result_set_get_float(FastBitResultSetHandle rset, 00198 const char *cname); 00201 FASTBIT_DLLSPEC double 00202 fastbit_result_set_get_double(FastBitResultSetHandle rset, 00203 const char *cname); 00205 FASTBIT_DLLSPEC const char* 00206 fastbit_result_set_get_string(FastBitResultSetHandle rset, 00207 const char *cname); 00212 FASTBIT_DLLSPEC int32_t 00213 fastbit_result_set_getInt(FastBitResultSetHandle rset, 00214 unsigned position); 00216 FASTBIT_DLLSPEC uint32_t 00217 fastbit_result_set_getUnsigned(FastBitResultSetHandle rset, 00218 unsigned position); 00221 FASTBIT_DLLSPEC float 00222 fastbit_result_set_getFloat(FastBitResultSetHandle rset, 00223 unsigned position); 00226 FASTBIT_DLLSPEC double 00227 fastbit_result_set_getDouble(FastBitResultSetHandle rset, 00228 unsigned position); 00230 FASTBIT_DLLSPEC const char* 00231 fastbit_result_set_getString(FastBitResultSetHandle rset, 00232 unsigned position); 00234 00236 FASTBIT_DLLSPEC int fastbit_flush_buffer(const char *dir); 00239 FASTBIT_DLLSPEC int 00240 fastbit_add_values(const char *colname, const char *coltype, 00241 void *vals, uint32_t nelem, uint32_t start); 00243 FASTBIT_DLLSPEC int fastbit_rows_in_partition(const char *dir); 00245 FASTBIT_DLLSPEC int fastbit_columns_in_partition(const char *dir); 00246 00248 FASTBIT_DLLSPEC void fastbit_init(const char *rcfile); 00250 FASTBIT_DLLSPEC void fastbit_cleanup(void); 00252 FASTBIT_DLLSPEC int fastbit_set_verbose_level(int v); 00254 FASTBIT_DLLSPEC int fastbit_get_verbose_level(void); 00256 FASTBIT_DLLSPEC int fastbit_set_logfile(const char* filename); 00258 FASTBIT_DLLSPEC const char* fastbit_get_logfile(); 00260 FASTBIT_DLLSPEC FILE* fastbit_get_logfilepointer(); 00261 00263 FASTBIT_DLLSPEC const char* fastbit_get_version_string(); 00265 FASTBIT_DLLSPEC int fastbit_get_version_number(); 00266 #ifdef __cplusplus 00267 } 00268 #endif 00269 00270 #endif // ifndef IBIS_CAPI_H
![]() |