⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cli_8h-source.html

📁 FastDb是高效的内存数据库系统
💻 HTML
📖 第 1 页 / 共 4 页
字号:
00378 <span class="comment">/*********************************************************************</span>00379 <span class="comment"> * cli_skip</span>00380 <span class="comment"> *     Skip specified number of rows. </span>00381 <span class="comment"> * Parameters:</span>00382 <span class="comment"> *     statement  - statememt descriptor returned by cli_statement</span>00383 <span class="comment"> *     n          - number of objects to be skipped</span>00384 <span class="comment"> *                - if "n" is positive, then this function has the same effect as</span>00385 <span class="comment"> *                     executing cli_get_next() function "n" times.</span>00386 <span class="comment"> *                - if "n" is negative, then this function has the same effect as</span>00387 <span class="comment"> *                     executing cli_get_prev() function "-n" times.</span>00388 <span class="comment"> *                - if "n"  is zero, this method just reloads current record</span>00389 <span class="comment"> * Returns:</span>00390 <span class="comment"> *     result code as described in cli_result_code enum</span>00391 <span class="comment"> */</span>00392 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_skip(<span class="keywordtype">int</span> statement, <span class="keywordtype">int</span> n);00393 00394 <span class="comment">/*********************************************************************</span>00395 <span class="comment"> * cli_seek</span>00396 <span class="comment"> *    Position cursor to the record with specified OID</span>00397 <span class="comment"> * Parameters:</span>00398 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>00399 <span class="comment"> *     oid         - object identifier of the record to which cursor should be positioned</span>00400 <span class="comment"> * Returns:</span>00401 <span class="comment"> *     &gt;= 0 - success, position of the record in the selection</span>00402 <span class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</span>00403 <span class="comment"> */</span>00404 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_seek(<span class="keywordtype">int</span> statement, cli_oid_t oid);00405 00406 00407 <span class="comment">/*********************************************************************</span>00408 <span class="comment"> * cli_get_oid</span>00409 <span class="comment"> *     Get object identifier of the current record</span>00410 <span class="comment"> * Parameters:</span>00411 <span class="comment"> *     statement  - statememt descriptor returned by cli_statement</span>00412 <span class="comment"> * Returns:</span>00413 <span class="comment"> *     object identifier or 0 if no object is seleected</span>00414 <span class="comment"> */</span>00415 cli_oid_t FASTDB_DLL_ENTRY cli_get_oid(<span class="keywordtype">int</span> statement);00416 00417 <span class="comment">/*********************************************************************</span>00418 <span class="comment"> * cli_update</span>00419 <span class="comment"> *     Update the current row in the selection. You have to set</span>00420 <span class="comment"> *     for_update parameter of cli_fetch to 1 in order to be able </span>00421 <span class="comment"> *     to perform updates. Updated value of row fields will be taken</span>00422 <span class="comment"> *     from bound column variables. </span>00423 <span class="comment"> * Parameters:</span>00424 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>00425 <span class="comment"> * Returns:</span>00426 <span class="comment"> *     result code as described in cli_result_code enum</span>00427 <span class="comment"> */</span>00428 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_update(<span class="keywordtype">int</span> statement);00429 00430 <span class="comment">/*********************************************************************</span>00431 <span class="comment"> * cli_remove</span>00432 <span class="comment"> *     Remove all selected records. You have to set</span>00433 <span class="comment"> *     for_update parameter of cli_fetch to 1 in order to be able </span>00434 <span class="comment"> *     to remove records. </span>00435 <span class="comment"> * Parameters:</span>00436 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>00437 <span class="comment"> * Returns:</span>00438 <span class="comment"> *     result code as described in cli_result_code enum</span>00439 <span class="comment"> */</span>00440 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_remove(<span class="keywordtype">int</span> statement);00441 00442 <span class="comment">/*********************************************************************</span>00443 <span class="comment"> * cli_free</span>00444 <span class="comment"> *     Deallocate statement and all associated data</span>00445 <span class="comment"> * Parameters:</span>00446 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>00447 <span class="comment"> * Returns:</span>00448 <span class="comment"> *     result code as described in cli_result_code enum</span>00449 <span class="comment"> */</span>00450 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_free(<span class="keywordtype">int</span> statement);00451 00452 <span class="comment">/*********************************************************************</span>00453 <span class="comment"> * cli_commit</span>00454 <span class="comment"> *     Commit current database transaction</span>00455 <span class="comment"> * Parameters:</span>00456 <span class="comment"> *     session - session descriptor as returned by cli_open</span>00457 <span class="comment"> * Returns:</span>00458 <span class="comment"> *     result code as described in cli_result_code enum</span>00459 <span class="comment"> */</span>00460 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_commit(<span class="keywordtype">int</span> session);00461 00462 <span class="comment">/*********************************************************************</span>00463 <span class="comment"> * cli_precommit</span>00464 <span class="comment"> *     Release all locks set by transaction. This methods allows other clients</span>00465 <span class="comment"> *     to proceed, but it doesn't flush transaction to the disk.</span>00466 <span class="comment"> * Parameters:</span>00467 <span class="comment"> *     session - session descriptor as returned by cli_open</span>00468 <span class="comment"> * Returns:</span>00469 <span class="comment"> *     result code as described in cli_result_code enum</span>00470 <span class="comment"> */</span>00471 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_precommit(<span class="keywordtype">int</span> session);00472 00473 <span class="comment">/*********************************************************************</span>00474 <span class="comment"> * cli_abort</span>00475 <span class="comment"> *     Abort current database transaction</span>00476 <span class="comment"> * Parameters:</span>00477 <span class="comment"> *     session - session descriptor as returned by cli_open</span>00478 <span class="comment"> * Returns:</span>00479 <span class="comment"> *     result code as described in cli_result_code enum</span>00480 <span class="comment"> */</span>00481 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_abort(<span class="keywordtype">int</span> session);00482 00483 00484 <span class="keyword">enum</span> cli_field_flags { 00485     cli_hashed           = 1, <span class="comment">/* field should be indexed usnig hash table */</span>00486     cli_indexed          = 2  <span class="comment">/* field should be indexed using B-Tree */</span>00487 };00488 00489 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_field_descriptor { 00490     <span class="keyword">enum</span> cli_var_type type;00491     <span class="keywordtype">int</span>               flags;00492     <span class="keywordtype">char</span> <span class="keyword">const</span>*       name;00493     <span class="keywordtype">char</span> <span class="keyword">const</span>*       refTableName;00494     <span class="keywordtype">char</span> <span class="keyword">const</span>*       inverseRefFieldName;00495 } cli_field_descriptor;00496 00497 <span class="comment">/*********************************************************************</span>00498 <span class="comment"> * cli_describe</span>00499 <span class="comment"> *     Describe fileds of specified table</span>00500 <span class="comment"> * Parameters:</span>00501 <span class="comment"> *     session - session descriptor as returned by cli_open</span>00502 <span class="comment"> *     table   - name of the table</span>00503 <span class="comment"> *     fields  - address of the pointer to the array of fields descriptors, </span>00504 <span class="comment"> *               this array should be later deallocated by application by cli_free_memory()</span>00505 <span class="comment"> * Returns:</span>00506 <span class="comment"> *     &gt;= 0 - number of fields in the table</span>00507 <span class="comment"> *     &lt; 0  - result code as described in cli_result_code enum</span>00508 <span class="comment"> */</span>00509 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_describe(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* table, cli_field_descriptor** fields);00510 00511 00512 <span class="comment">/*********************************************************************</span>00513 <span class="comment"> * cli_get_field_size</span>00514 <span class="comment"> *     Calculate field size</span>00515 <span class="comment"> * Parameters:</span>00516 <span class="comment"> *     fields  - array with fields descriptors obtained using cli_describe function</span>00517 <span class="comment"> *     field_no - number of the field</span>00518 <span class="comment"> */</span>00519 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_field_size(cli_field_descriptor* fields, <span class="keywordtype">int</span> field_no);00520 00521 <span class="comment">/*********************************************************************</span>00522 <span class="comment"> * cli_get_field_offset</span>00523 <span class="comment"> *     Calculate offset of the field </span>00524 <span class="comment"> * Parameters:</span>00525 <span class="comment"> *     fields  - array with fields descriptors obtained using cli_describe function</span>00526 <span class="comment"> *     field_no - number of the field</span>00527 <span class="comment"> */</span>00528 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_field_offset(cli_field_descriptor* fields, <span class="keywordtype">int</span> field_no);00529 00530 00531 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_table_descriptor {00532     <span class="keywordtype">char</span> <span class="keyword">const</span>*       name;00533 } cli_table_descriptor;00534 00535 <span class="comment">/*********************************************************************</span>00536 <span class="comment"> * cli_show_tables</span>00537 <span class="comment"> *     Show all tables of specified database</span>00538 <span class="comment"> * Parameters:</span>00539 <span class="comment"> *     session - session descriptor as returned by cli_open</span>00540 <span class="comment"> *     tables  - address of the pointer to the array of tables descriptors,</span>00541 <span class="comment"> *               this array should be later deallocated by application by cli_free_memory()</span>00542 <span class="comment"> * Returns:</span>00543 <span class="comment"> *     &gt;= 0 - number of tables in the database (Metatable is not returned/counted)</span>00544 <span class="comment"> *     &lt; 0  - result code as described in cli_result_code enum</span>00545 <span class="comment"> */</span>00546 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_show_tables(<span class="keywordtype">int</span> session, cli_table_descriptor** tables);00547 00548 00549 <span class="comment">/*********************************************************************</span>00550 <span class="comment"> * cli_create_table</span>00551 <span class="comment"> *     Create new table</span>00552 <span class="comment"> * Parameters:</span>00553 <span class="comment"> *     session   - session descriptor as returned by cli_open</span>00554 <span class="comment"> *     tableName - name of new table</span>00555 <span class="comment"> *     nFields   - number of columns in the table</span>00556 <span class="comment"> *     fields    - array with table columns descriptors</span>00557 <span class="comment"> * Returns:</span>00558 <span class="comment"> *     result code as described in cli_result_code enum</span>00559 <span class="comment"> */</span>00560 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_create_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName, <span class="keywordtype">int</span> nFields, 00561                                         cli_field_descriptor* fields);00562 00563 <span class="comment">/*********************************************************************</span>00564 <span class="comment"> * cli_alter_table</span>00565 <span class="comment"> *     Change table format</span>00566 <span class="comment"> * Parameters:</span>00567 <span class="comment"> *     session   - session descriptor as returned by cli_open</span>00568 <span class="comment"> *     tableName - name of existing table</span>00569 <span class="comment"> *     nFields   - number of columns in the table</span>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -