📄 cli_8h-source.html
字号:
00570 <span class="comment"> * fields - array with new table columns descriptors</span>00571 <span class="comment"> * Returns:</span>00572 <span class="comment"> * result code as described in cli_result_code enum</span>00573 <span class="comment"> */</span>00574 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_alter_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName, <span class="keywordtype">int</span> nFields, 00575 cli_field_descriptor* fields);00576 00577 <span class="comment">/*********************************************************************</span>00578 <span class="comment"> * cli_drop_table</span>00579 <span class="comment"> * drop the table</span>00580 <span class="comment"> * Parameters:</span>00581 <span class="comment"> * session - session descriptor as returned by cli_open</span>00582 <span class="comment"> * tableName - name of deleted table</span>00583 <span class="comment"> * Returns:</span>00584 <span class="comment"> * result code as described in cli_result_code enum</span>00585 <span class="comment"> */</span>00586 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_drop_table(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName);00587 00588 00589 <span class="comment">/*********************************************************************</span>00590 <span class="comment"> * cli_alter_index</span>00591 <span class="comment"> * add or remove column index</span>00592 <span class="comment"> * Parameters:</span>00593 <span class="comment"> * session - session descriptor as returned by cli_open</span>00594 <span class="comment"> * tableName - name of the table</span>00595 <span class="comment"> * fieldName - name of field</span>00596 <span class="comment"> * newFlags - new flags of the field, if index exists for this field, but is not specified in </span>00597 <span class="comment"> * <code>newFlags</code> mask, then it will be removed; if index not exists, but is </span>00598 <span class="comment"> * specified in <code>newFlags</code> mask, then it will be created. * </span>00599 <span class="comment"> * Returns:</span>00600 <span class="comment"> * result code as described in cli_result_code enum</span>00601 <span class="comment"> */</span>00602 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_alter_index(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* tableName, <span class="keywordtype">char</span> <span class="keyword">const</span>* fieldName, 00603 <span class="keywordtype">int</span> newFlags);00604 00605 00606 <span class="comment">/*********************************************************************</span>00607 <span class="comment"> * cli_set_error_handler</span>00608 <span class="comment"> * Set FastDB erro handler. Handler should be no-return function which perform stack unwind.</span>00609 <span class="comment"> * Parameters:</span>00610 <span class="comment"> * session - session descriptor as returned by cli_open</span>00611 <span class="comment"> * handler - error handler</span>00612 <span class="comment"> * Returns:</span>00613 <span class="comment"> * previous handler</span>00614 <span class="comment"> */</span>00615 <span class="keyword">enum</span> cli_error_class { 00616 cli_no_error, 00617 cli_query_error,00618 cli_arithmetic_error,00619 cli_index_out_of_range_error,00620 cli_database_open_error,00621 cli_file_error,00622 cli_out_of_memory_error,00623 cli_deadlock,00624 cli_null_reference_error,00625 cli_lock_revoked,00626 cli_file_limit_exeeded 00627 };00628 <span class="keyword">typedef</span> void (*cli_error_handler)(<span class="keywordtype">int</span> error, <span class="keywordtype">char</span> <span class="keyword">const</span>* msg, <span class="keywordtype">int</span> msgarg); 00629 cli_error_handler FASTDB_DLL_ENTRY cli_set_error_handler(<span class="keywordtype">int</span> session, cli_error_handler new_handler);00630 00631 <span class="comment">/*********************************************************************</span>00632 <span class="comment"> * cli_freeze</span>00633 <span class="comment"> * Freeze cursor. Make it possible to reused cursor after commit of the current transaction.</span>00634 <span class="comment"> * Parameters:</span>00635 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>00636 <span class="comment"> * Returns:</span>00637 <span class="comment"> * result code as described in cli_result_code enum</span>00638 <span class="comment"> */</span>00639 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_freeze(<span class="keywordtype">int</span> statement);00640 00641 <span class="comment">/*********************************************************************</span>00642 <span class="comment"> * cli_unfreeze</span>00643 <span class="comment"> * Unfreeze cursor. Reuse previously frozen cursor.</span>00644 <span class="comment"> * Parameters:</span>00645 <span class="comment"> * statement - statememt descriptor returned by cli_statement</span>00646 <span class="comment"> * Returns:</span>00647 <span class="comment"> * result code as described in cli_result_code enum</span>00648 <span class="comment"> */</span>00649 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_unfreeze(<span class="keywordtype">int</span> statement);00650 00651 00652 <span class="comment">/*********************************************************************</span>00653 <span class="comment"> * cli_attach</span>00654 <span class="comment"> * Attach thread to the database. Each thread except one opened the database should first</span>00655 <span class="comment"> * attach to the database before any access to the database, and detach after end of the work with database</span>00656 <span class="comment"> * Parameters:</span>00657 <span class="comment"> * session - session descriptor returned by cli_open</span>00658 <span class="comment"> * Returns:</span>00659 <span class="comment"> * result code as described in cli_result_code enum</span>00660 <span class="comment"> */</span>00661 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_attach(<span class="keywordtype">int</span> session);00662 00663 <span class="comment">/*********************************************************************</span>00664 <span class="comment"> * cli_detach</span>00665 <span class="comment"> * Detach thread from the database. Each thread except one opened the database should perform </span>00666 <span class="comment"> * attach to the database before any access to the database, and detach after end of the work with database</span>00667 <span class="comment"> * Parameters:</span>00668 <span class="comment"> * session - session descriptor returned by cli_open</span>00669 <span class="comment"> * detach_mode - bit mask representing detach mode</span>00670 <span class="comment"> * Returns:</span>00671 <span class="comment"> * result code as described in cli_result_code enum</span>00672 <span class="comment"> */</span>00673 <span class="keyword">enum</span> cli_detach_mode {00674 cli_commit_on_detach = 1,00675 cli_destroy_context_on_detach = 200676 };00677 00678 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_detach(<span class="keywordtype">int</span> session, <span class="keywordtype">int</span> detach_mode);00679 00680 00681 <span class="comment">/*********************************************************************</span>00682 <span class="comment"> * cli_free_memory</span>00683 <span class="comment"> * Free memory allocated by cli_show_tables and cli_describe</span>00684 <span class="comment"> * Parameters:</span>00685 <span class="comment"> * session - session descriptor returned by cli_open</span>00686 <span class="comment"> * ptr - pointer to the allocated buffer</span>00687 <span class="comment"> */</span>00688 <span class="keywordtype">void</span> FASTDB_DLL_ENTRY cli_free_memory(<span class="keywordtype">int</span> session, <span class="keywordtype">void</span>* ptr);00689 00690 00691 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_database_monitor {00692 <span class="keywordtype">int</span> n_readers;00693 <span class="keywordtype">int</span> n_writers;00694 <span class="keywordtype">int</span> n_blocked_readers;00695 <span class="keywordtype">int</span> n_blocked_writers;00696 <span class="keywordtype">int</span> n_users;00697 } cli_database_monitor;00698 00699 <span class="comment">/*********************************************************************</span>00700 <span class="comment"> * cli_get_database_state</span>00701 <span class="comment"> * Obtain information about current state of the database</span>00702 <span class="comment"> * Parameters:</span>00703 <span class="comment"> * session - session descriptor returned by cli_open</span>00704 <span class="comment"> * monitor - pointer to the monitor structure. The folloing fields are set:</span>00705 <span class="comment"> * n_readers: number of granted shared locks</span>00706 <span class="comment"> * n_writers: number of granted exclusive locks</span>00707 <span class="comment"> * n_blocked_reader: number of threads which shared lock request was blocked</span>00708 <span class="comment"> * n_blocked_writers: number of threads which exclusive lock request was blocked</span>00709 <span class="comment"> * n_users: number of processes openned the database</span>00710 <span class="comment"> * Returns:</span>00711 <span class="comment"> * result code as described in cli_result_code enum</span>00712 <span class="comment"> */</span>00713 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_database_state(<span class="keywordtype">int</span> session, cli_database_monitor* monitor);00714 00715 00716 00717 <span class="comment">/*********************************************************************</span>00718 <span class="comment"> * cli_set_trace_function</span>00719 <span class="comment"> * Set trace function which will be used to output FastDB trace messages</span>00720 <span class="comment"> * Parameters:</span>00721 <span class="comment"> * func - pointer to trace function which receives trace message terminated with new line character</span>00722 <span class="comment"> */</span>00723 <span class="keyword">typedef</span> void (*cli_trace_function_t)(<span class="keywordtype">char</span>* msg);00724 <span class="keywordtype">void</span> FASTDB_DLL_ENTRY cli_set_trace_function(cli_trace_function_t func);00725 00726 00727 <span class="comment">/*********************************************************************</span>00728 <span class="comment"> * cli_prepare_query</span>00729 <span class="comment"> * Prepare SubSQL query statement. </span>00730 <span class="comment"> * Parameters:</span>00731 <span class="comment"> * session - session descriptor returned by cli_open</span>00732 <span class="comment"> * query - query string with optional parameters. Parameters are specified</span>00733 <span class="comment"> * as '%T' where T is one or two character code of parameter type using the same notation</span>00734 <span class="comment"> * as in printf: %d or %i - int, %f - float or double, %ld - int8, %s - string, %p - oid...</span>00735 <span class="comment"> * Returns:</span>00736 <span class="comment"> * >= 0 - statement descriptor</span>00737 <span class="comment"> * < 0 - error code as described in cli_result_code enum</span>00738 <span class="comment"> */</span>00739 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_prepare_query(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* query);00740 00753 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_execute_query(<span class="keywordtype">int</span> statement, <span class="keywordtype">int</span> for_update, <span class="keywordtype">void</span>* record_struct, ...);00754 00766 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_insert_struct(<span class="keywordtype">int</span> session, <span class="keywordtype">char</span> <span class="keyword">const</span>* table_name, <span class="keywordtype">void</span>* record_struct, cli_oid_t* oid);00767 00768 <span class="preprocessor">#ifdef __cplusplus</span>00769 <span class="preprocessor"></span>}00770 <span class="preprocessor">#endif</span>00771 <span class="preprocessor"></span>00772 <span class="preprocessor">#endif</span>00773 <span class="preprocessor"></span>00774 </pre></div><hr size="1"><address style="align: right;"><small>Generated on Thu Feb 12 13:04:48 2004 for FastDB by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.5 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -