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

📄 cli_8h-source.html

📁 俄罗斯牛人KK的作品,著名的ORDBMS,这里上传最新的3.39版本源代码.希望了解对象关系数据库的同好,请不要错过.
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<!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.18 --><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 <span class="comment">/*-&lt; CLI.H &gt;---------------------------------------------------------*--------*</span>00002 <span class="comment"> * FastDB                    Version 1.0         (c) 1999  GARRET    *     ?  *</span>00003 <span class="comment"> * (Main Memory Database Management System)                          *   /\|  *</span>00004 <span class="comment"> *                                                                   *  /  \  *</span>00005 <span class="comment"> *                          Created:     13-Jan-2000 K.A. Knizhnik   * / [] \ *</span>00006 <span class="comment"> *                          Last update: 13-Jan-2000 K.A. Knizhnik   * GARRET *</span>00007 <span class="comment"> *-------------------------------------------------------------------*--------*</span>00008 <span class="comment"> * Call level interface to FastDB server</span>00009 <span class="comment"> *-------------------------------------------------------------------*--------*/</span>00010 00011 <span class="preprocessor">#ifndef __CLI_H__</span>00012 <span class="preprocessor"></span><span class="preprocessor">#define __CLI_H__</span>00013 <span class="preprocessor"></span>00014 <span class="preprocessor">#include "config.h"</span>00015 <span class="preprocessor">#include &lt;stdlib.h&gt;</span>00016 <span class="preprocessor">#include &lt;time.h&gt;</span>00017 00018 <span class="preprocessor">#ifndef FASTDB_DLL_ENTRY</span>00019 <span class="preprocessor"></span><span class="preprocessor">#ifdef FASTDB_DLL</span>00020 <span class="preprocessor"></span><span class="preprocessor">#ifdef INSIDE_FASTDB</span>00021 <span class="preprocessor"></span><span class="preprocessor">#define FASTDB_DLL_ENTRY __declspec(dllexport)</span>00022 <span class="preprocessor"></span><span class="preprocessor">#else</span>00023 <span class="preprocessor"></span><span class="preprocessor">#define FASTDB_DLL_ENTRY __declspec(dllimport)</span>00024 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00025 <span class="preprocessor"></span><span class="preprocessor">#else</span>00026 <span class="preprocessor"></span><span class="preprocessor">#define FASTDB_DLL_ENTRY</span>00027 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00028 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00029 <span class="preprocessor"></span>00030 <span class="preprocessor">#ifndef CLI_CALLBACK_CC </span><span class="comment">/* CLI callbacks calling convention */</span>00031 <span class="preprocessor">#define CLI_CALLBACK_CC </span>00032 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00033 <span class="preprocessor"></span>00034 <span class="preprocessor">#ifdef __cplusplus</span>00035 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> { 00036 <span class="preprocessor">#endif</span>00037 <span class="preprocessor"></span>00038 <span class="keyword">enum</span> cli_result_code { 00039     cli_ok = 0,00040     cli_bad_address = -1,00041     cli_connection_refused = -2,00042     cli_database_not_found = -3, 00043     cli_bad_statement = -4,00044     cli_parameter_not_found = -5,00045     cli_unbound_parameter = -6,00046     cli_column_not_found = -7,00047     cli_incompatible_type = -8,00048     cli_network_error = -9,00049     cli_runtime_error = -10,00050     cli_bad_descriptor = -11,00051     cli_unsupported_type = -12,00052     cli_not_found        = -13,00053     cli_not_update_mode  = -14,00054     cli_table_not_found  = -15,00055     cli_not_all_columns_specified = -16, 00056     cli_not_fetched = -17,00057     cli_already_updated = -18, 00058     cli_table_already_exists = -19, 00059     cli_not_implemented = -2000060 };00061     00062 <span class="keyword">enum</span> cli_var_type { 00063     cli_oid,00064     cli_bool, 00065     cli_int1, 00066     cli_int2,00067     cli_int4,00068     cli_int8,00069     cli_real4,00070     cli_real8,00071     cli_decimal, <span class="comment">/* not supported */</span>00072     cli_asciiz,  <span class="comment">/* zero terminated string */</span>00073     cli_pasciiz, <span class="comment">/* pointer to zero terminated string */</span>00074     cli_cstring, <span class="comment">/* not supported */</span>00075     cli_array_of_oid,00076     cli_array_of_bool, 00077     cli_array_of_int1, 00078     cli_array_of_int2,00079     cli_array_of_int4,00080     cli_array_of_int8,00081     cli_array_of_real4,00082     cli_array_of_real8,00083     cli_array_of_decimal, 00084     cli_array_of_string,00085     cli_any,      <span class="comment">/* use the same type for column as stored in the database */</span>00086     cli_datetime,  <span class="comment">/* time in seconds since 00:00:00 UTC, January 1, 1970. */</span>00087     cli_autoincrement,  <span class="comment">/* column of int4 type automatically assigned value during record insert */</span>00088     cli_rectangle,00089     cli_unknown00090 };00091 00092 <span class="preprocessor">#ifdef __STDTP_H__</span>00093 <span class="preprocessor"></span>USE_FASTDB_NAMESPACE00094 <span class="preprocessor">#endif</span>00095 <span class="preprocessor"></span>00096 <span class="keyword">typedef</span> <span class="keywordtype">char</span>         cli_bool_t;00097 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">char</span>  cli_int1_t;00098 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">short</span> cli_int2_t;00099 <span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">int</span>   cli_int4_t;00100 <span class="keyword">typedef</span> <span class="keywordtype">float</span>        cli_real4_t;00101 <span class="keyword">typedef</span> <span class="keywordtype">double</span>       cli_real8_t;00102     00103 <span class="preprocessor">#ifndef RECTANGLE_COORDINATE_TYPE</span>00104 <span class="preprocessor"></span><span class="preprocessor">#define RECTANGLE_COORDINATE_TYPE int</span>00105 <span class="preprocessor"></span><span class="comment">//#define RECTANGLE_COORDINATE_TYPE double</span>00106 <span class="preprocessor">#endif</span>00107 <span class="preprocessor"></span><span class="keyword">typedef</span> RECTANGLE_COORDINATE_TYPE cli_coord_t;00108 <span class="preprocessor">#define CLI_RECTANGLE_DIMENSION 2</span>00109 <span class="preprocessor"></span>00110 <span class="keyword">typedef</span> <span class="keyword">struct </span>{ 00111     cli_coord_t  boundary[CLI_RECTANGLE_DIMENSION*2];00112 } cli_rectangle_t;00113 00114 <span class="preprocessor">#if (defined(_WIN32) || defined(__BORLANDC__)) &amp;&amp; !defined(__MINGW32__)</span>00115 <span class="preprocessor"></span><span class="keyword">typedef</span> __int64      cli_int8_t;00116 <span class="preprocessor">#else</span>00117 <span class="preprocessor"></span><span class="preprocessor">#if defined(__osf__ )</span>00118 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">long</span>  cli_int8_t;00119 <span class="preprocessor">#else</span>00120 <span class="preprocessor"></span><span class="preprocessor">#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__HP_aCC) </span>00121 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">signed</span> <span class="keywordtype">long</span> <span class="keywordtype">long</span> cli_int8_t;00122 <span class="preprocessor">#else</span>00123 <span class="preprocessor"></span><span class="preprocessor">#error "integer 8 byte type is not defined" </span>00124 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00125 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00126 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00127 <span class="preprocessor"></span>00128 <span class="preprocessor">#ifndef CLI_TIME_T_DEFINED</span>00129 <span class="preprocessor"></span>    <span class="keyword">typedef</span> time_t cli_time_t;00130 <span class="preprocessor">#endif</span>00131 <span class="preprocessor"></span>00132 <span class="preprocessor">#ifndef CLI_OID_DEFINED</span>00133 <span class="preprocessor"></span><span class="preprocessor">#if dbDatabaseOidBits &gt; 32</span>00134 <span class="preprocessor"></span><span class="keyword">typedef</span> size_t cli_oid_t;00135 <span class="preprocessor">#else</span>00136 <span class="preprocessor"></span><span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> cli_oid_t;00137 <span class="preprocessor">#endif</span>00138 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00139 <span class="preprocessor"></span>00140 <span class="comment">// structure used to represent array field in structure extracted by cli_execute_query</span>00141 <span class="keyword">typedef</span> <span class="keyword">struct </span>cli_array_t { 00142     size_t size;      <span class="comment">// number of elements in the array</span>00143     <span class="keywordtype">void</span>*  data;      <span class="comment">// pointer to the array elements</span>00144     size_t allocated; <span class="comment">// internal field: size of allocated buffer </span>00145 } cli_array_t;00146     00147 <span class="comment">/*********************************************************************</span>00148 <span class="comment"> * cli_open</span>00149 <span class="comment"> *     Establish connection with the server </span>00150 <span class="comment"> * Parameters:</span>00151 <span class="comment"> *     server_url - zero terminated string with server address and port, </span>00152 <span class="comment"> *                  for example "localhost:5101", "195.239.208.240:6100",...</span>00153 <span class="comment"> *     max_connect_attempts  - number of attempts to establish connection</span>00154 <span class="comment"> *     reconnect_timeout_sec - timeput in seconds between connection attempts</span>00155 <span class="comment"> * Returns:</span>00156 <span class="comment"> *     &gt;= 0 - connectiondescriptor to be used in all other cli calls</span>00157 <span class="comment"> *     &lt;  0 - error code as described in cli_result_code enum</span>00158 <span class="comment"> */</span>00159 <span class="keywordtype">int</span> FASTDB_DLL_ENTRY cli_open(<span class="keywordtype">char</span> <span class="keyword">const</span>* server_url, 00160                               <span class="keywordtype">int</span>         max_connect_attempts,00161                               <span class="keywordtype">int</span>         reconnect_timeout_sec);

⌨️ 快捷键说明

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