00001 // 00002 // cfg_libconfig.h 00003 // consmgr 00004 // 00005 // Created by Chris Ross on 12/24/07. 00006 // Copyright 2007. All rights reserved. 00007 // 00008 // 00009 // ***** BEGIN LICENSE BLOCK ***** 00010 // Version: MPL 1.1/GPL 2.0/LGPL 2.1 00011 // 00012 // The contents of this file are subject to the Mozilla Public License 00013 // Version 1.1 (the "License"); you may not use this file except in 00014 // compliance with the License. You may obtain a copy of the License at 00015 // http://www.mozilla.org/MPL/ 00016 // 00017 // Software distributed under the License is distributed on an "AS IS" 00018 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See 00019 // the License for the specific language governing rights and limitations 00020 // under the License. 00021 // 00022 // The Original Code is the consmgr network/serial-line monitoring package. 00023 // 00024 // The Initial Developer of the Original Code is Chris P. Ross. 00025 // Portions created by the Initial Developer are Copyright (C) 2000-2008 00026 // the Initial Developer. All Rights Reserved. 00027 // 00028 // Contributor(s): 00029 // 00030 // Alternatively, the contents of this file may be used under the terms of 00031 // either the GNU General Public License Version 2 or later (the "GPL"), or 00032 // the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), 00033 // in which case the provisions of the GPL or the LGPL are applicable instead 00034 // of those above. If you wish to allow use of your version of this file only 00035 // under the terms of either the GPL or the LGPL, and not to allow others to 00036 // use your version of this file under the terms of the MPL, indicate your 00037 // decision by deleting the provisions above and replace them with the notice 00038 // and other provisions required by the GPL or the LGPL. If you do not delete 00039 // the provisions above, a recipient may use your version of this file under 00040 // the terms of any one of the MPL, the GPL or the LGPL. 00041 // 00042 // ***** END LICENSE BLOCK ***** 00043 00044 #if HAVE_LIBCONFIG 00045 00046 #include <string> 00047 00048 #include "cmconfig.h" 00049 #include <libconfig.h++> 00050 00051 extern "C" { 00052 #include <pthread.h> 00053 }; 00054 00066 class LibConfig : public Config { 00067 public: 00068 LibConfig(const string&); 00069 ~LibConfig(void); 00070 00072 void load_entry(const string&); 00073 00074 private: 00076 libconfig::Config config; 00078 pthread_mutex_t mutex; 00079 00080 }; 00081 00082 #endif /* HAVE_LIBCONFIG */