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

📄 cli_8h-source.html

📁 最新版本!fastdb是高效的内存数据库系统
💻 HTML
📖 第 1 页 / 共 5 页
字号:
00673 <span class="comment"> *                 specified in &lt;code&gt;newFlags&lt;/code&gt; mask, then it will be created. *                   </span>
00674 <span class="comment"> * Returns:</span>
00675 <span class="comment"> *     result code as described in cli_result_code enum</span>
00676 <span class="comment"> */</span>
00677 <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, 
00678                                      <span class="keywordtype">int</span> newFlags);
00679 
00680 
00681 <span class="comment">/*********************************************************************</span>
00682 <span class="comment"> * cli_set_error_handler</span>
00683 <span class="comment"> *     Set FastDB erro handler. Handler should be no-return function which perform stack unwind.</span>
00684 <span class="comment"> * Parameters:</span>
00685 <span class="comment"> *     session   - session descriptor as returned by cli_open</span>
00686 <span class="comment"> *     handler   - error handler</span>
00687 <span class="comment"> *     context   - error handler context: pointer to the user specific data</span>
00688 <span class="comment"> *                  which will be passed to thr handler</span>
00689 <span class="comment"> * Returns:</span>
00690 <span class="comment"> *     previous handler</span>
00691 <span class="comment"> */</span>
00692 <span class="keyword">enum</span> cli_error_class { 
00693     cli_no_error, 
00694     cli_query_error,
00695     cli_arithmetic_error,
00696     cli_index_out_of_range_error,
00697     cli_database_open_error,
00698     cli_file_error,
00699     cli_out_of_memory_error,
00700     cli_deadlock,
00701     cli_null_reference_error,
00702     cli_lock_revoked,
00703     cli_file_limit_exeeded        
00704 };
00705 <span class="keyword">typedef</span> void (CLI_CALLBACK_CC *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, <span class="keywordtype">void</span>* context); 
00706 cli_error_handler FASTDB_DLL_ENTRY cli_set_error_handler(<span class="keywordtype">int</span> session, cli_error_handler new_handler, <span class="keywordtype">void</span>* context);
00707 
00708 <span class="comment">/*********************************************************************</span>
00709 <span class="comment"> * cli_freeze</span>
00710 <span class="comment"> *    Freeze cursor. Make it possible to reused cursor after commit of the current transaction.</span>
00711 <span class="comment"> * Parameters:</span>
00712 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>
00713 <span class="comment"> * Returns:</span>
00714 <span class="comment"> *     result code as described in cli_result_code enum</span>
00715 <span class="comment"> */</span>
00716 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_freeze(<span class="keywordtype">int</span> statement);
00717 
00718 <span class="comment">/*********************************************************************</span>
00719 <span class="comment"> * cli_unfreeze</span>
00720 <span class="comment"> *    Unfreeze cursor. Reuse previously frozen cursor.</span>
00721 <span class="comment"> * Parameters:</span>
00722 <span class="comment"> *     statement   - statememt descriptor returned by cli_statement</span>
00723 <span class="comment"> * Returns:</span>
00724 <span class="comment"> *     result code as described in cli_result_code enum</span>
00725 <span class="comment"> */</span>
00726 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_unfreeze(<span class="keywordtype">int</span> statement);
00727 
00728 
00729 <span class="comment">/*********************************************************************</span>
00730 <span class="comment"> * cli_attach</span>
00731 <span class="comment"> *    Attach thread to the database. Each thread except one opened the database should first</span>
00732 <span class="comment"> *    attach to the database before any access to the database, and detach after end of the work with database</span>
00733 <span class="comment"> * Parameters:</span>
00734 <span class="comment"> *     session - session descriptor returned by cli_open</span>
00735 <span class="comment"> * Returns:</span>
00736 <span class="comment"> *     result code as described in cli_result_code enum</span>
00737 <span class="comment"> */</span>
00738 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_attach(<span class="keywordtype">int</span> session);
00739 
00740 <span class="comment">/*********************************************************************</span>
00741 <span class="comment"> * cli_detach</span>
00742 <span class="comment"> *    Detach thread from the database. Each thread except one opened the database should perform </span>
00743 <span class="comment"> *    attach to the database before any access to the database, and detach after end of the work with database</span>
00744 <span class="comment"> * Parameters:</span>
00745 <span class="comment"> *     session - session descriptor returned by cli_open</span>
00746 <span class="comment"> *     detach_mode - bit mask representing detach mode</span>
00747 <span class="comment"> * Returns:</span>
00748 <span class="comment"> *     result code as described in cli_result_code enum</span>
00749 <span class="comment"> */</span>
00750 <span class="keyword">enum</span> cli_detach_mode {
00751     cli_commit_on_detach          = 1,
00752     cli_destroy_context_on_detach = 2
00753 };
00754 
00755 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_detach(<span class="keywordtype">int</span> session, <span class="keywordtype">int</span> detach_mode);
00756 
00757 
00758 <span class="comment">/*********************************************************************</span>
00759 <span class="comment"> * cli_free_memory</span>
00760 <span class="comment"> *    Free memory allocated by cli_show_tables and cli_describe</span>
00761 <span class="comment"> * Parameters:</span>
00762 <span class="comment"> *     session - session descriptor returned by cli_open</span>
00763 <span class="comment"> *     ptr - pointer to the allocated buffer</span>
00764 <span class="comment"> */</span>
00765 <span class="keywordtype">void</span> FASTDB_DLL_ENTRY cli_free_memory(<span class="keywordtype">int</span> session, <span class="keywordtype">void</span>* ptr);
00766 
00767 
00768 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_database_monitor {
00769     <span class="keywordtype">int</span> n_readers;
00770     <span class="keywordtype">int</span> n_writers;
00771     <span class="keywordtype">int</span> n_blocked_readers;
00772     <span class="keywordtype">int</span> n_blocked_writers;
00773     <span class="keywordtype">int</span> n_users;
00774 } cli_database_monitor;
00775 
00776 <span class="comment">/*********************************************************************</span>
00777 <span class="comment"> * cli_get_database_state</span>
00778 <span class="comment"> *    Obtain information about current state of the database</span>
00779 <span class="comment"> * Parameters:</span>
00780 <span class="comment"> *     session - session descriptor returned by cli_open</span>
00781 <span class="comment"> *     monitor - pointer to the monitor structure. The folloing fields are set:</span>
00782 <span class="comment"> *       n_readers: number of granted shared locks</span>
00783 <span class="comment"> *       n_writers: number of granted exclusive locks</span>
00784 <span class="comment"> *       n_blocked_reader: number of threads which shared lock request was blocked</span>
00785 <span class="comment"> *       n_blocked_writers: number of threads which exclusive lock request was blocked</span>
00786 <span class="comment"> *       n_users: number of processes openned the database</span>
00787 <span class="comment"> * Returns:</span>
00788 <span class="comment"> *     result code as described in cli_result_code enum</span>
00789 <span class="comment"> */</span>
00790 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_get_database_state(<span class="keywordtype">int</span> session, cli_database_monitor* monitor);
00791 
00792 
00793 
00794 <span class="comment">/*********************************************************************</span>
00795 <span class="comment"> * cli_set_trace_function</span>
00796 <span class="comment"> *    Set trace function which will be used to output FastDB trace messages</span>
00797 <span class="comment"> * Parameters:</span>
00798 <span class="comment"> *     func - pointer to trace function which receives trace message terminated with new line character</span>
00799 <span class="comment"> */</span>
00800 <span class="keyword">typedef</span> void (CLI_CALLBACK_CC *cli_trace_function_t)(<span class="keywordtype">char</span>* msg);
00801 <span class="keywordtype">void</span> FASTDB_DLL_ENTRY cli_set_trace_function(cli_trace_function_t func);
00802 
00803 
00804 <span class="comment">/*********************************************************************</span>
00805 <span class="comment"> * cli_prepare_query</span>
00806 <span class="comment"> *     Prepare SubSQL query statement. </span>
00807 <span class="comment"> * Parameters:</span>
00808 <span class="comment"> *     session - session descriptor returned by cli_open</span>
00809 <span class="comment"> *     query   - query string with optional parameters. Parameters are specified</span>
00810 <span class="comment"> *               as '%T' where T is one or two character code of parameter type using the same notation</span>
00811 <span class="comment"> *               as in printf: %d or %i - int, %f - float or double, %ld - int8, %s - string, %p - oid...</span>
00812 <span class="comment"> *               Parameter of cli_rectangle_t* type has format %R, cli_time_t type - %t</span>
00813 <span class="comment"> * Returns:</span>
00814 <span class="comment"> *     &gt;= 0 - statement descriptor</span>
00815 <span class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</span>
00816 <span class="comment"> */</span>
00817 <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);
00818 
00831 <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, ...);
00832 
00847 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_execute_query_ex(<span class="keywordtype">int</span> statement, <span class="keywordtype">int</span> for_update, <span class="keywordtype">void</span>* record_struct, <span class="keywordtype">int</span> n_params, <span class="keywordtype">int</span>* param_types, <span class="keywordtype">void</span>** param_values);
00848 
00860 <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);
00861 
00862 <span class="keyword">typedef</span> <span class="keywordtype">void</span>* cli_transaction_context_t;
00863 <span class="comment">/*********************************************************************</span>
00864 <span class="comment"> * cli_create_transaction_context</span>
00865 <span class="comment"> *    Create new transaction xontext which can be used in cli_join_transaction function</span>
00866 <span class="comment"> * Parameters:</span>
00867 <span class="comment"> * Returns:</span>
00868 <span class="comment"> *     created transaction context</span>
00869 <span class="comment"> */</span>
00870  cli_transaction_context_t FASTDB_DLL_ENTRY cli_create_transaction_context();
00871 
00872 <span class="comment">/*********************************************************************</span>
00873 <span class="comment"> * cli_join_transaction</span>
00874 <span class="comment"> *    Associate current threads with specified transaction context,</span>
00875 <span class="comment"> *    It allows to share single trans

⌨️ 快捷键说明

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