📄 cli_8h-source.html
字号:
00162 00163 <span class="keyword">enum</span> cli_open_attributes { 00164 cli_open_default = 0x0, 00165 cli_open_readonly = 0x1, 00166 cli_open_truncate = 0x2,00167 cli_open_concurrent = 0x400168 };00169 <span class="comment">/*********************************************************************</span>00170 <span class="comment"> * cli_create</span>00171 <span class="comment"> * Create connection to the local database</span>00172 <span class="comment"> * Parameters:</span>00173 <span class="comment"> * databaseName - name of the database </span>00174 <span class="comment"> * fileName - path to the database file </span>00175 <span class="comment"> * transactionCommitDelay - trasnaction commit delay (specify 0 to disable)</span>00176 <span class="comment"> * openAttr - mask of cli_open_attributes</span>00177 <span class="comment"> * initDatabaseSize - initial size of the database</span>00178 <span class="comment"> * extensionQuantum - database extension quantum</span>00179 <span class="comment"> * initIndexSize - initial size of object index</span>00180 <span class="comment"> * fileSizeLimit - limit for file size (0 - unlimited)</span>00181 <span class="comment"> * Returns:</span>00182 <span class="comment"> * >= 0 - connection descriptor to be used in all other cli calls</span>00183 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>00184 <span class="comment"> */</span>00185 00186 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create(<span class="keywordtype">char</span> <span class="keyword">const</span>* databaseName, 00187 <span class="keywordtype">char</span> <span class="keyword">const</span>* filePath, 00188 <span class="keywordtype">unsigned</span> transactionCommitDelay, 00189 <span class="keywordtype">int</span> openAttr, 00190 size_t initDatabaseSize,00191 size_t extensionQuantum,00192 size_t initIndexSize,00193 size_t fileSizeLimit);00194 00195 <span class="comment">/*********************************************************************</span>00196 <span class="comment"> * cli_create_replication_node</span>00197 <span class="comment"> * Create connection to the local database with support of replication</span>00198 <span class="comment"> * Parameters:</span>00199 <span class="comment"> * nodeId - node identifier: 0 <= nodeId < nServers</span>00200 <span class="comment"> * nServers - number of replication nodes (primary + standby)</span>00201 <span class="comment"> * nodeNames - array with URLs of the nodes (address:port)</span>00202 <span class="comment"> * databaseName - name of the database </span>00203 <span class="comment"> * fileName - path to the database file </span>00204 <span class="comment"> * transactionCommitDelay - trasnaction commit delay (specify 0 to disable)</span>00205 <span class="comment"> * openAttr - mask of cli_open_attributes (to allow concurrent read access to replication node, </span>00206 <span class="comment"> * cli_open_concurrent attribute should be set) </span>00207 <span class="comment"> * initDatabaseSize - initial size of the database</span>00208 <span class="comment"> * extensionQuantum - database extension quantum</span>00209 <span class="comment"> * initIndexSize - initial size of object index</span>00210 <span class="comment"> * fileSizeLimit - limit for file size (0 - unlimited)</span>00211 <span class="comment"> * Returns:</span>00212 <span class="comment"> * >= 0 - connection descriptor to be used in all other cli calls</span>00213 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>00214 <span class="comment"> */</span>00215 00216 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create_replication_node(<span class="keywordtype">int</span> nodeId,00217 <span class="keywordtype">int</span> nServers,00218 <span class="keywordtype">char</span>* nodeNames[],00219 <span class="keywordtype">char</span> <span class="keyword">const</span>* databaseName, 00220 <span class="keywordtype">char</span> <span class="keyword">const</span>* filePath, 00221 <span class="keywordtype">int</span> openAttr, 00222 size_t initDatabaseSize,00223 size_t extensionQuantum,00224 size_t initIndexSize,00225 size_t fileSizeLimit);00226 00227 <span class="comment">/*********************************************************************</span>00228 <span class="comment"> * cli_close</span>00229 <span class="comment"> * Close session</span>00230 <span class="comment"> * Parameters:</span>00231 <span class="comment"> * session - session descriptor returned by cli_open</span>00232 <span class="comment"> * Returns:</span>00233 <span class="comment"> * result code as described in cli_result_code enum</span>00234 <span class="comment"> */</span>00235 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_close(<span class="keywordtype">int</span> session);00236 00237 <span class="comment">/*********************************************************************</span>00238 <span class="comment"> * cli_statement</span>00239 <span class="comment"> * Specify SubSQL statement to be executed at server</span>00240 <span class="comment"> * Binding to the parameters and columns can be established </span>00241 <span class="comment"> * Parameters:</span>00242 <span class="comment"> * session - session descriptor returned by cli_open</span>00243 <span class="comment"> * stmt - zero terminated string with SubSQL statement </span>00244 <span class="comment"> * Returns:</span>00245 <span class="comment"> * >= 0 - statement descriptor</span>00246 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>00247 <span class="comment"> */</span>00248 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_statement(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* stmt);00249 00250 <span class="comment">/*********************************************************************</span>00251 <span class="comment"> * cli_parameter</span>00252 <span class="comment"> * Bind parameter to the statement</span>00253 <span class="comment"> * Parameters:</span>00254 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>00255 <span class="comment"> * param_name - zero terminated string with parameter name </span>00256 <span class="comment"> * Paramter name should start with '%'</span>00257 <span class="comment"> * var_type - type of variable as described in cli_var_type enum.</span>00258 <span class="comment"> * Only scalar and zero terminated string types are supported.</span>00259 <span class="comment"> * var_ptr - pointer to the variable</span>00260 <span class="comment"> * Returns:</span>00261 <span class="comment"> * result code as described in cli_result_code enum</span>00262 <span class="comment"> */</span>00263 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_parameter(<span class="keywordtype">int</span> statement,00264 <span class="keywordtype">char</span> <span class="keyword">const</span>* param_name, 00265 <span class="keywordtype">int</span> var_type,00266 <span class="keywordtype">void</span>* var_ptr);00267 00268 <span class="comment">/*********************************************************************</span>00269 <span class="comment"> * cli_column</span>00270 <span class="comment"> * Bind extracted column of select or insert statement</span>00271 <span class="comment"> * Parameters:</span>00272 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>00273 <span class="comment"> * column_name - zero terminated string with column name </span>00274 <span class="comment"> * var_type - type of variable as described in cli_var_type enum</span>00275 <span class="comment"> * var_len - pointer to the variable to hold length of array variable.</span>00276 <span class="comment"> * This variable should be assigned the maximal length</span>00277 <span class="comment"> * of the array/string buffer, pointed by var_ptr.</span>00278 <span class="comment"> * After the execution of the statement it is assigned the </span>00279 <span class="comment"> * real length of the fetched array/string. If it is large </span>00280 <span class="comment"> * than length of the buffer, then only part of the array</span>00281 <span class="comment"> * will be placed in the buffer, but var_len still will </span>00282 <span class="comment"> * contain the actual array length. </span>00283 <span class="comment"> * var_ptr - pointer to the variable</span>00284 <span class="comment"> * Returns:</span>00285 <span class="comment"> * result code as described in cli_result_code enum</span>00286 <span class="comment"> */</span>00287 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_column(<span class="keywordtype">int</span> statement,00288 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, 00289 <span class="keywordtype">int</span> var_type, 00290 <span class="keywordtype">int</span>* var_len, 00291 <span class="keywordtype">void</span>* var_ptr);00292 00293 00294 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_set)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span> len);00295 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_get)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span>* len);00296 00297 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_set_ex)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span> len, 00298 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, <span class="keywordtype">int</span> statement, <span class="keywordtype">void</span> <span class="keyword">const</span>* data_ptr, <span class="keywordtype">void</span>* user_data);00299 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* (CLI_CALLBACK_CC *cli_column_get_ex)(<span class="keywordtype">int</span> var_type, <span class="keywordtype">void</span>* var_ptr, <span class="keywordtype">int</span>* len, 00300 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, <span class="keywordtype">int</span> statemen, <span class="keywordtype">void</span>* user_data);00301 00302 <span class="comment">/*********************************************************************</span>00303 <span class="comment"> * cli_array_column</span>00304 <span class="comment"> * Specify get/set functions for the array column</span>00305 <span class="comment"> * Parameters:</span>00306 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>00307 <span class="comment"> * column_name - zero terminated string with column name </span>00308 <span class="comment"> * var_type - type of variable as described in cli_var_type enum</span>00309 <span class="comment"> * var_ptr - pointer to the variable</span>00310 <span class="comment"> * set - function which will be called to construct fetched </span>00311 <span class="comment"> * field. It receives pointer to the variable, </span>00312 <span class="comment"> * length of the fetched array and returns pointer to th </span>00313 <span class="comment"> * array's elements</span>00314 <span class="comment"> * get - function which will be called to update the field in the </span>00315 <span class="comment"> * database. Given pointer to the variable, it should return </span>00316 <span class="comment"> * pointer to the array elements and store length of the</span>00317 <span class="comment"> * array to the variable pointer by len parameter</span>00318 <span class="comment"> * user_data - pointer to user specific data passed to get and set functions</span>00319 <span class="comment"> * Returns:</span>00320 <span class="comment"> * result code as described in cli_result_code enum</span>00321 <span class="comment"> */</span>00322 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_array_column(<span class="keywordtype">int</span> statement,00323 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name, 00324 <span class="keywordtype">int</span> var_type,00325 <span class="keywordtype">void</span>* var_ptr,00326 cli_column_set set,00327 cli_column_get get);00328 00329 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_array_column_ex(<span class="keywordtype">int</span> statement,00330 <span class="keywordtype">char</span> <span class="keyword">const</span>* column_name,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -