cli_8h-source.html

来自「一个功能强大的内存数据库源代码,c++编写,有详细的注释」· HTML 代码 · 共 537 行 · 第 1/3 页

HTML
537
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>cli.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.15 --><center><a class="qindex" href="index.html">Main Page</a> &nbsp; <a class="qindex" href="hierarchy.html">Class Hierarchy</a> &nbsp; <a class="qindex" href="annotated.html">Compound List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </center><hr><h1>cli.h</h1><div class="fragment"><pre>00001 <font class="comment">/*-&lt; CLI.H &gt;---------------------------------------------------------*--------*</font>00002 <font class="comment"> * FastDB                    Version 1.0         (c) 1999  GARRET    *     ?  *</font>00003 <font class="comment"> * (Main Memory Database Management System)                          *   /\|  *</font>00004 <font class="comment"> *                                                                   *  /  \  *</font>00005 <font class="comment"> *                          Created:     13-Jan-2000 K.A. Knizhnik   * / [] \ *</font>00006 <font class="comment"> *                          Last update: 13-Jan-2000 K.A. Knizhnik   * GARRET *</font>00007 <font class="comment"> *-------------------------------------------------------------------*--------*</font>00008 <font class="comment"> * Call level interface to FastDB server</font>00009 <font class="comment"> *-------------------------------------------------------------------*--------*/</font>00010 00011 <font class="preprocessor">#ifndef __CLI_H__</font>00012 <font class="preprocessor"></font><font class="preprocessor">#define __CLI_H__</font>00013 <font class="preprocessor"></font>00014 <font class="preprocessor">#ifndef FASTDB_DLL_ENTRY</font>00015 <font class="preprocessor"></font><font class="preprocessor">#ifdef FASTDB_DLL</font>00016 <font class="preprocessor"></font><font class="preprocessor">#ifdef INSIDE_FASTDB</font>00017 <font class="preprocessor"></font><font class="preprocessor">#define FASTDB_DLL_ENTRY __declspec(dllexport)</font>00018 <font class="preprocessor"></font><font class="preprocessor">#else</font>00019 <font class="preprocessor"></font><font class="preprocessor">#define FASTDB_DLL_ENTRY __declspec(dllimport)</font>00020 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00021 <font class="preprocessor"></font><font class="preprocessor">#else</font>00022 <font class="preprocessor"></font><font class="preprocessor">#define FASTDB_DLL_ENTRY</font>00023 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00024 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00025 <font class="preprocessor"></font>00026 <font class="preprocessor">#ifdef __cplusplus</font>00027 <font class="preprocessor"></font><font class="keyword">extern</font> <font class="stringliteral">"C"</font> { 00028 <font class="preprocessor">#endif</font>00029 <font class="preprocessor"></font>00030 <font class="keyword">enum</font> cli_result_code { 00031     cli_ok = 0,00032     cli_bad_address = -1,00033     cli_connection_refused = -2,00034     cli_database_not_found = -3, 00035     cli_bad_statement = -4,00036     cli_parameter_not_found = -5,00037     cli_unbound_parameter = -6,00038     cli_column_not_found = -7,00039     cli_incompatible_type = -8,00040     cli_network_error = -9,00041     cli_runtime_error = -10,00042     cli_bad_descriptor = -11,00043     cli_unsupported_type = -12,00044     cli_not_found        = -13,00045     cli_not_update_mode  = -14,00046     cli_table_not_found  = -15,00047     cli_not_all_columns_specified = -16, 00048     cli_not_fetched = -17,00049     cli_already_updated = -18, 00050     cli_table_already_exists = -19, 00051     cli_not_implemented = -2000052 };00053     00054 <font class="keyword">enum</font> cli_var_type { 00055     cli_oid,00056     cli_bool, 00057     cli_int1, 00058     cli_int2,00059     cli_int4,00060     cli_int8,00061     cli_real4,00062     cli_real8,00063     cli_asciiz,  <font class="comment">/* zero terminated string */</font>00064     cli_pasciiz, <font class="comment">/* pointer to zero terminated string */</font>00065     cli_array_of_oid,00066     cli_array_of_bool, 00067     cli_array_of_int1, 00068     cli_array_of_int2,00069     cli_array_of_int4,00070     cli_array_of_int8,00071     cli_array_of_real4,00072     cli_array_of_real8,00073     cli_array_of_string,00074     cli_autoincrement, 00075     cli_unknown00076 };00077 00078 <font class="keyword">typedef</font> <font class="keywordtype">char</font>         cli_bool_t;00079 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">char</font>  cli_int1_t;00080 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">short</font> cli_int2_t;00081 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">int</font>   cli_int4_t;00082 <font class="keyword">typedef</font> <font class="keywordtype">float</font>        cli_real4_t;00083 <font class="keyword">typedef</font> <font class="keywordtype">double</font>       cli_real8_t;00084     00085 <font class="preprocessor">#if defined(_WIN32) &amp;&amp; !defined(__MINGW32__)</font>00086 <font class="preprocessor"></font><font class="keyword">typedef</font> __int64      cli_int8_t;00087 <font class="preprocessor">#else</font>00088 <font class="preprocessor"></font><font class="preprocessor">#if defined(__osf__ )</font>00089 <font class="preprocessor"></font><font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">long</font>  cli_int8_t;00090 <font class="preprocessor">#else</font>00091 <font class="preprocessor"></font><font class="preprocessor">#if defined(__GNUC__) || defined(__SUNPRO_CC)</font>00092 <font class="preprocessor"></font><font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">long</font> <font class="keywordtype">long</font> cli_int8_t;00093 <font class="preprocessor">#else</font>00094 <font class="preprocessor"></font><font class="preprocessor">#error "integer 8 byte type is not defined" </font>00095 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00096 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00097 <font class="preprocessor"></font><font class="preprocessor">#endif</font>00098 <font class="preprocessor"></font>00099 <font class="preprocessor">#ifndef CLI_OID_DEFINED</font>00100 <font class="preprocessor"></font><font class="keyword">typedef</font> <font class="keywordtype">long</font> cli_oid_t;00101 <font class="preprocessor">#endif</font>00102 <font class="preprocessor"></font>00103 <font class="comment">/*********************************************************************</font>00104 <font class="comment"> * cli_open</font>00105 <font class="comment"> *     Establish connection with the server </font>00106 <font class="comment"> * Parameters:</font>00107 <font class="comment"> *     server_url - zero terminated string with server address and port, </font>00108 <font class="comment"> *                  for example "localhost:5101", "195.239.208.240:6100",...</font>00109 <font class="comment"> *     max_connect_attempts  - number of attempts to establish connection</font>00110 <font class="comment"> *     reconnect_timeout_sec - timeput in seconds between connection attempts</font>00111 <font class="comment"> * Returns:</font>00112 <font class="comment"> *     &gt;= 0 - connectiondescriptor to be used in all other cli calls</font>00113 <font class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</font>00114 <font class="comment"> */</font>00115 <font class="keywordtype">int</font> FASTDB_DLL_ENTRY cli_open(<font class="keywordtype">char</font> <font class="keyword">const</font>* server_url, 00116                               <font class="keywordtype">int</font>         max_connect_attempts,00117                               <font class="keywordtype">int</font>         reconnect_timeout_sec);00118 00119 <font class="keyword">enum</font> cli_open_attributes { 00120     cli_open_default    = 0x0, 00121     cli_open_readonly   = 0x1, 00122     cli_open_truncate   = 0x2,00123     cli_open_concurrent = 0x400124 };00125 <font class="comment">/*********************************************************************</font>00126 <font class="comment"> * cli_create</font>00127 <font class="comment"> *     Create conecntion to the local database</font>00128 <font class="comment"> * Parameters:</font>00129 <font class="comment"> *     databaseName - name of the database </font>00130 <font class="comment"> *     fileName - path to the database file </font>00131 <font class="comment"> *     transactionCommitDelay - trasnaction commit delay (specify 0 to disable)</font>00132 <font class="comment"> *     openAttr - mask of cli_open_attributes</font>00133 <font class="comment"> *     initDatabaseSize - initial size of the database</font>00134 <font class="comment"> * Returns:</font>00135 <font class="comment"> *     &gt;= 0 - connection descriptor to be used in all other cli calls</font>00136 <font class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</font>00137 <font class="comment"> */</font>00138 00139 <font class="keywordtype">int</font> FASTDB_DLL_ENTRY cli_create(<font class="keywordtype">char</font> <font class="keyword">const</font>* databaseName, 00140                                 <font class="keywordtype">char</font> <font class="keyword">const</font>* filePath, 00141                                 <font class="keywordtype">unsigned</font>    transactionCommitDelay, 00142                                 <font class="keywordtype">int</font>         openAttr, 00143                                 size_t      initDatabaseSize);00144     00145 <font class="comment">/*********************************************************************</font>00146 <font class="comment"> * cli_close</font>00147 <font class="comment"> *     Close session</font>00148 <font class="comment"> * Parameters:</font>00149 <font class="comment"> *     session - session descriptor returned by cli_open</font>00150 <font class="comment"> * Returns:</font>00151 <font class="comment"> *     result code as described in cli_result_code enum</font>00152 <font class="comment"> */</font>00153 <font class="keywordtype">int</font> FASTDB_DLL_ENTRY cli_close(<font class="keywordtype">int</font> session);00154 00155 <font class="comment">/*********************************************************************</font>00156 <font class="comment"> * cli_statement</font>00157 <font class="comment"> *     Specify SunSQL statement to be executed at server</font>00158 <font class="comment"> *     Binding to the parameters and columns can be established       </font>00159 <font class="comment"> * Parameters:</font>00160 <font class="comment"> *     session - session descriptor returned by cli_open</font>00161 <font class="comment"> *     stmt    - zero terminated string with SubSQL statement  </font>00162 <font class="comment"> * Returns:</font>00163 <font class="comment"> *     &gt;= 0 - statement descriptor</font>00164 <font class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</font>00165 <font class="comment"> */</font>00166 <font class="keywordtype">int</font> FASTDB_DLL_ENTRY cli_statement(<font class="keywordtype">int</font> session, <font class="keywordtype">char</font> <font class="keyword">const</font>* stmt);00167 00168 <font class="comment">/*********************************************************************</font>00169 <font class="comment"> * cli_parameter</font>00170 <font class="comment"> *     Bind parameter to the statement</font>00171 <font class="comment"> * Parameters:</font>

⌨️ 快捷键说明

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