![]() |
|
|
Generated: 8 Jan 2009 |
00001 00006 #ifdef _WIN32 00007 // FIXME: (MCl) the following warning tells that the usage of throw 00008 // declaration may cause trouble with VC > 7.1 00009 00010 // Disable warning C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow) 00011 #pragma warning ( disable : 4290 ) 00012 #endif 00013 00014 /* 00015 * ApMon - Application Monitoring Tool 00016 * Version: 2.2.0 00017 * 00018 * Copyright (C) 2006 California Institute of Technology 00019 * 00020 * Permission is hereby granted, free of charge, to use, copy and modify 00021 * this software and its documentation (the "Software") for any 00022 * purpose, provided that existing copyright notices are retained in 00023 * all copies and that this notice is included verbatim in any distributions 00024 * or substantial portions of the Software. 00025 * This software is a part of the MonALISA framework (http://monalisa.cacr.caltech.edu). 00026 * Users of the Software are asked to feed back problems, benefits, 00027 * and/or suggestions about the software to the MonALISA Development Team 00028 * (developers@monalisa.cern.ch). Support for this software - fixing of bugs, 00029 * incorporation of new features - is done on a best effort basis. All bug 00030 * fixes and enhancements will be made available under the same terms and 00031 * conditions as the original software, 00032 00033 * IN NO EVENT SHALL THE AUTHORS OR DISTRIBUTORS BE LIABLE TO ANY PARTY FOR 00034 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT 00035 * OF THE USE OF THIS SOFTWARE, ITS DOCUMENTATION, OR ANY DERIVATIVES THEREOF, 00036 * EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00037 00038 * THE AUTHORS AND DISTRIBUTORS SPECIFICALLY DISCLAIM ANY WARRANTIES, 00039 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, 00040 * FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. THIS SOFTWARE IS 00041 * PROVIDED ON AN "AS IS" BASIS, AND THE AUTHORS AND DISTRIBUTORS HAVE NO 00042 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR 00043 * MODIFICATIONS. 00044 */ 00045 00046 #ifndef apmon_utils_h 00047 #define apmon_utils_h 00048 00049 #include <stdexcept> 00050 #include <ctype.h> 00051 00052 #define FATAL 0 00053 #define WARNING 1 00054 #define INFO 2 00055 #define FINE 3 00056 #define DEBUG 4 00058 using namespace std; 00059 00060 namespace apmon_utils { 00068 bool urlModified(char *url, char *lastModified) throw(runtime_error); 00069 00077 int httpRequest(char *url, char *reqType, char *temp_filename) 00078 throw(runtime_error); 00079 00084 char *findIP(char *address) throw(runtime_error); 00085 00086 00095 void parse_URL(char *url, char *hostname, int *port, char *identifier) 00096 throw(runtime_error); 00097 00103 void freeMat(char **mat, int nRows); 00104 00111 char *trimString(char *s); 00112 00120 int xdrSize(int type, char *value); 00121 00129 int sizeEval(int type, char *value); 00130 00134 void logParameters(int level, int nParams, char **paramNames, 00135 int *valueTypes, char **paramValues); 00136 00140 bool isPrivateAddress(char *addr); 00141 00149 int getVectIndex(char *item, char **vect, int vectDim); 00150 00157 void logger(int msgLevel, const char *msg, int newLevel = -1); 00158 } 00159 00160 #endif