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

awmysql.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_MYSQL__
00024 #define __AW_MYSQL__
00025 
00026 #include "awdb.h"
00027 
00028 #include "mysql.h"
00029 
00030 #include "monitor.h"
00031 
00032 #include "wire.h"
00033 
00034 #include "regexmatch.h"
00035 
00036 
00041 /*
00042 
00043 Changes:
00044 
00045 */
00046 
00050 typedef struct {
00051   
00052   const byte_t 
00053    *host,
00054    *user,
00055    *passwd,
00056    *db;
00057 
00058 } aw_mysql_cinfo_t ;
00059 
00060 
00064 typedef struct {
00065   
00066   int32_t
00067     prev_connected, /* value for previous attempt */
00068     connected;      /* 1 for connected, -1 for not connected */
00069 
00070   u_int32_t
00071    connection_attempts;
00072 
00073   MYSQL 
00074     *conn;
00075 
00076   /* array 1-1 with the watchers, each val marks
00077      if a match occured during the probe, could be a bitmap, but I am being lazy */
00078   u_int32_t
00079    *match_markers;
00080   
00081 } aw_mysql_state_t ;
00082 
00083 
00087 void aw_mysql_init(void);
00088 
00092 int32_t aw_mysql_initialized(void);
00093 
00101 void aw_mysql_disconnect(aw_mysql_cinfo_t *cinfo, aw_mysql_state_t *state, aw_logger_t *logger, int32_t close);
00102 
00109 void aw_mysql_disconnect_all(aw_mysql_cinfo_t *cinfo, aw_mysql_state_t *state, aw_logger_t *logger);
00110 
00117 void aw_mysql_connect(aw_mysql_cinfo_t *cinfo, aw_mysql_state_t *state, aw_logger_t *logger);
00118 
00119 #endif
00120 
Aware 0.11.1 Copyright (C) 1998-2005 Russell Leighton (russ@elegant-software.com)