Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

awsqlsvr.h

Go to the documentation of this file.
00001 
00002 /*
00003 ** Copyright (C) 2002 Russell Leighton
00004 **
00005 ** This program is free software; you can redistribute it and/or modify
00006 ** it under the terms of the GNU General Public License as published by
00007 ** the Free Software Foundation; either version 2 of the License, or
00008 ** (at your option) any later version.
00009 **
00010 ** This program is distributed in the hope that it will be useful,
00011 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013 ** GNU General Public License for more details.
00014 **
00015 ** You should have received a copy of the GNU General Public License
00016 ** along with this program; if not, write to the Free Software
00017 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00018 */
00019 
00020 
00021 
00022 
00023 #ifndef __AW_SQLSVR__
00024 #define __AW_SQLSVR__
00025 
00026 #include "awdb.h"
00027 
00028 #include "tds.h"
00029 
00030 #include "monitor.h"
00031 
00032 #include "wire.h"
00033 
00034 #include "regexmatch.h"
00035 
00036 
00042 /*
00043 
00044 Changes:
00045 
00046 */
00047 
00051 typedef struct {
00052   
00053   const byte_t 
00054    *host,
00055    *user,
00056    *passwd,
00057    *db;
00058 
00059 } aw_sqlsvr_cinfo_t ;
00060 
00064 typedef struct {
00065 
00066   TDSLOGIN 
00067    *login;
00068   TDSSOCKET
00069     *tds;
00070 
00071 } aw_sqlsvr_conn_t;
00072 
00076 typedef struct {
00077 
00078   int32_t
00079     prev_connected, /* value for previous attempt */
00080     connected;      /* 1 for connected, -1 for not connected */
00081 
00082   u_int32_t
00083    connection_attempts;
00084 
00085   aw_sqlsvr_conn_t
00086    *conn;
00087 
00088   /* array 1-1 with the watchers, each val marks
00089      if a match occured during the probe, could be a bitmap, but I am being lazy */
00090   u_int32_t
00091    *match_markers;
00092   
00093 } aw_sqlsvr_state_t ;
00094 
00095 
00099 void aw_sqlsvr_init(void);
00100 
00104 int32_t aw_sqlsvr_initialized(void);
00105 
00113 void aw_sqlsvr_disconnect(aw_sqlsvr_cinfo_t *cinfo, aw_sqlsvr_state_t *state, aw_logger_t *logger, int32_t close);
00114 
00121 void aw_sqlsvr_disconnect_all(aw_sqlsvr_cinfo_t *cinfo, aw_sqlsvr_state_t *state, aw_logger_t *logger);
00122 
00129 void aw_sqlsvr_connect(aw_sqlsvr_cinfo_t *cinfo, aw_sqlsvr_state_t *state, aw_logger_t *logger);
00130 
00131 
00139 byte_t *aw_sqlsvr_val_as_string(TDSSOCKET *tds,int32_t col_idx, byte_t *result, int32_t buffsize);
00140 
00141 #endif
00142 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)