Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

msproxy.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *
00003  * Verball Model Storage Library, Common Information Model Library 
00004  * for integration of Intelligent Services.
00005  * Copyright (C) 2005 Nikita Vinokurov, Orgway LLC.
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; 
00010  * version 2.1 of the License.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, 
00020  * Boston, MA  02110-1301  USA
00021  *
00022  * $Id: msproxy.h,v 1.16 2006/09/18 21:38:31 sbreg Exp $
00023  **********************************************************************/
00024 
00025 #ifndef _MS_PROXY_H_
00026 #define _MS_PROXY_H_
00027 
00028 #include "stmt/statement.h"
00029 
00030 
00031 #if defined(_WIN32)
00032 #ifdef COMPILE_PROXY_DLL
00033 #define PROXY_STORAGE_TYPE __declspec(dllexport)
00034 #else
00035 #define PROXY_STORAGE_TYPE __declspec(dllimport)
00036 #endif
00037 #else
00038 #define PROXY_STORAGE_TYPE extern
00039 #endif
00040 
00046 #define MS_PROXY_ERROR_RECV_FAIL        -88001
00047 #define MS_PROXY_ERROR_CMD_FAIL         -88002
00048 #define MS_PROXY_ERROR_CMD_INCORRECT    -88003
00049 #define MS_PROXY_ERROR_CMD_UNKNOWN      -88004
00050 #define MS_PROXY_ERROR_DATA_WRONG       -88005
00051 #define MS_PROXY_ERROR_WRONG_HASH       -88006
00052 
00053 
00054 // Server side errors:
00055 #define MS_SERVER_ERROR_TXN_EXIST       -88400
00056 #define MS_SERVER_ERROR_TXN_NOT_EXIST   -88401
00057 
00058 
00059 #ifdef __cplusplus
00060 extern "C"
00061 {
00062 #endif /* __cplusplus */
00063 
00065 typedef struct _client_conn client_conn;
00066 
00067 
00071 PROXY_STORAGE_TYPE
00072 int model_server_init();
00073 
00074 
00078 PROXY_STORAGE_TYPE
00079 int model_server_cleanup();
00080 
00081 
00082 
00090 PROXY_STORAGE_TYPE
00091 int model_server_connect(const char *server_name,
00092                          unsigned short server_port,
00093                          client_conn **ppconn);
00094 
00099 PROXY_STORAGE_TYPE
00100 void model_server_connection_close(client_conn *pconn);
00101 
00102 
00109 PROXY_STORAGE_TYPE
00110 int model_server_login(client_conn *pconn, const char *login, const char *password);
00111 
00112 
00113 
00118 PROXY_STORAGE_TYPE
00119 int model_server_logout(client_conn *pconn);
00120 
00122 PROXY_STORAGE_TYPE
00123 int model_server_notify( client_conn *pconn, const char *login);
00124 
00125 
00132 PROXY_STORAGE_TYPE
00133 int model_server_set(client_conn *pconn, const Statement *pst);
00134 
00135 
00136 
00141 PROXY_STORAGE_TYPE
00142 int model_server_txn_begin(client_conn *pconn);
00143 
00144 
00149 PROXY_STORAGE_TYPE
00150 int model_server_txn_commit(client_conn *pconn);
00151 
00152 
00157 PROXY_STORAGE_TYPE
00158 int model_server_txn_rollback(client_conn *pconn);
00159 
00160 
00168 PROXY_STORAGE_TYPE
00169 int model_server_get(client_conn *pconn, const Statement *pmask,
00170                      Statement **result);
00171 
00172 PROXY_STORAGE_TYPE
00173 int model_server_get_count(client_conn *pconn, const Statement *pmask,
00174                            unsigned long *result);
00175 
00176 
00183 PROXY_STORAGE_TYPE
00184 int model_server_batch_get(client_conn *pconn, const Statement *masks,
00185                      Statement **result);
00186 
00187 
00188 
00195 PROXY_STORAGE_TYPE
00196 int model_server_read_notifications(client_conn *pconn,
00197                                     Statement **result);
00198 
00199 
00200 
00206 PROXY_STORAGE_TYPE
00207 int model_server_get_new_id(client_conn *pconn, Node *idnode);
00208 
00209 
00210 
00215 PROXY_STORAGE_TYPE
00216 void model_server_result_free(Statement **result);
00217 
00218 
00219 #ifdef __cplusplus
00220 }
00221 #endif/* __cplusplus */
00222 
00223 
00224 
00225 
00226 #endif // _MS_PROXY_

Generated on Wed Dec 27 16:52:17 2006 for VRB Online Server by  doxygen 1.4.4