Drizzled Public API Documentation

pbmsdaemon_ms.cc
00001 /*
00002   *  Copyright (C) 2010 PrimeBase Technologies GmbH, Germany
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; version 2 of the License.
00007  *
00008  *  This program is distributed in the hope that it will be useful,
00009  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  *  GNU General Public License for more details.
00012  *
00013  *  You should have received a copy of the GNU General Public License
00014  *  along with this program; if not, write to the Free Software
00015  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016  *
00017  * Barry Leslie
00018  *
00019  * 2010-06-09
00020  */
00021 
00022 #ifdef DRIZZLED
00023 #include <config.h>
00024 #include <set>
00025 #include <drizzled/common.h>
00026 #include <drizzled/plugin.h>
00027 #include <drizzled/session.h>
00028 using namespace drizzled;
00029 using namespace drizzled::plugin;
00030 
00031 #define my_strdup(a,b) strdup(a)
00032 
00033 #include "cslib/CSConfig.h"
00034 #else
00035 #include "cslib/CSConfig.h"
00036 #include "mysql_priv.h"
00037 #include <mysql/plugin.h>
00038 #include <my_dir.h>
00039 #endif 
00040 
00041 #include <inttypes.h>
00042 
00043 #include "cslib/CSDefs.h"
00044 #include "cslib/CSObject.h"
00045 #include "cslib/CSGlobal.h"
00046 #include "cslib/CSThread.h"
00047 #include "cslib/CSStrUtil.h"
00048 
00049 #include "defs_ms.h"
00050 #include "mysql_ms.h"
00051 #include "pbmsdaemon_ms.h"
00052 
00053 
00054 char PBMSDaemon::pbd_home_dir[PATH_MAX];
00055 PBMSDaemon::DaemonState PBMSDaemon::pbd_state = PBMSDaemon::DaemonUnknown;
00056 
00057 void PBMSDaemon::setDaemonState(DaemonState state)
00058 {
00059   pbd_state = state;
00060   
00061   if (pbd_state == DaemonStartUp) { // In theory we could allow this to be set with a commandline option.
00062     cs_make_absolute_path(PATH_MAX, pbd_home_dir, "pbms", ms_my_get_mysql_home_path()); 
00063   }
00064 }