Skip to contentSkip to conversation

conga/ricci/include APIerror.h Except.h File.h ...

Cluster-devel [email protected] 1 participant 1 message Aug 31, 2007

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/cluster
Module name: conga
Changes by: rmccabe at sourceware.org 2007-08-31 13:32:37

Modified files:
ricci/include : APIerror.h Except.h File.h Logger.h Module.h
Mutex.h Network.h Random.h Socket.h String.h Thread.h Time.h Variable.h XML.h XML_tags.h array_auto_ptr.h counting_auto_ptr.cpp counting_auto_ptr.h executils.h executils_test.h shred_allocator.h utils.h

Log message:
More cleanup

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/APIerror.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Except.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/File.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Logger.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Module.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Mutex.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Network.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Random.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Socket.h.diff?cvsroot=cluster&r1=1.5&r2=1.6
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/String.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Thread.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Time.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/Variable.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/XML.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/XML_tags.h.diff?cvsroot=cluster&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/array_auto_ptr.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/counting_auto_ptr.cpp.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/counting_auto_ptr.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/executils.h.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/executils_test.h.diff?cvsroot=cluster&r1=1.1&r2=1.2
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/shred_allocator.h.diff?cvsroot=cluster&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/conga/ricci/include/utils.h.diff?cvsroot=cluster&r1=1.6&r2=1.7

ricci/include/APIerror.h +12 -15
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2006
+  Copyright Red Hat, Inc. 2006-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -21,20 +21,17 @@
  */
 
 
-#ifndef APIerror_h
-#define APIerror_h
+#ifndef __CONGA_APIerror_h
+#define __CONGA_APIerror_h
 
-
-class APIerror 
+class APIerror
 {
- public:
-  APIerror() : msg("") {}
-  APIerror(const String& msg) : msg(msg) {}
-  virtual ~APIerror() {}
-  
-  const String msg;
-  
-};
+	public:
+		APIerror() : msg("") {}
+		APIerror(const String& msg) : msg(msg) {}
+		virtual ~APIerror() {}
 
+		const String msg;
+};
 
-#endif  // APIerror_h
+#endif
ricci/include/Except.h +19 -22

61 lines not on this page · raw message

ricci/include/File.h +42 -49

117 lines not on this page · raw message

ricci/include/Logger.h +39 -43

109 lines not on this page · raw message

ricci/include/Module.h +17 -26

72 lines not on this page · raw message

ricci/include/Mutex.h +48 -42

113 lines not on this page · raw message

ricci/include/Network.h +16 -19
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -30,25 +30,22 @@
 
 #include <netdb.h>
 
-
 class Network
 {
- public:
-  static std::vector<String> name2IP(const String& hostname);
-  static String localhost();
-  
-  
-  class Hostent
-  {
-   public:
-    struct hostent ent;
-    char data[4*1024 - sizeof(struct hostent)];
-    struct hostent* operator->() { return &ent; }
-    struct hostent& operator*() { return ent; }
-  };
-  static counting_auto_ptr<Hostent> getHostByName(const String& hostname);
-  
-};
+	public:
+		static std::vector<String> name2IP(const String& hostname);
+		static String localhost();
 
 
-#endif  // Conga_Network_h
+		class Hostent
+		{
+			public:
+				struct hostent ent;
+				char data[4*1024 - sizeof(struct hostent)];
+				struct hostent* operator->() { return &ent; }
+				struct hostent& operator*() { return ent; }
+		};
+		static counting_auto_ptr<Hostent> getHostByName(const String& hostname);
+};
+
+#endif
ricci/include/Random.h +5 -7
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -21,11 +21,9 @@
  */
 
 
-#ifndef Random_h
-#define Random_h
-
+#ifndef __CONGA_Random_h
+#define __CONGA_Random_h
 
 int random_generator(int min, int max);
 
-
-#endif  // Random_h
+#endif
ricci/include/Socket.h +71 -77

181 lines not on this page · raw message

ricci/include/String.h +6 -12
@@ -1,17 +1,11 @@
-
-
-#ifndef String_h
-#define String_h
-
+#ifndef __CONGA_STRING_H
+#define __CONGA_STRING_H
 
 #include <string>
 #include "shred_allocator.h"
 
+typedef std::basic_string<char,
+			std::char_traits<char>,
+			shred_allocator<char> > String;
 
-typedef std::basic_string<char, 
-			  std::char_traits<char>, 
-			  shred_allocator<char> > String;
-
-
-
-#endif  // String_h
+#endif
ricci/include/Thread.h +30 -34

85 lines not on this page · raw message

ricci/include/Time.h +6 -7
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -21,12 +21,11 @@
  */
 
 
-#ifndef Time_h
-#define Time_h
+#ifndef __CONGA_TIME_H
+#define __CONGA_TIME_H
 
 #include "String.h"
 
-
 // number of seconds since Epoch
 unsigned int time_sec();
 
@@ -35,10 +34,10 @@
 
 // sleep num milliseconds
 void sleep_mil(unsigned char num);
+
 // sleep num seconds
 void sleep_sec(unsigned char num);
 
 String time_formated();
 
-
-#endif  // Time_h
+#endif
ricci/include/Variable.h +170 -202

401 lines not on this page · raw message

ricci/include/XML.h +41 -36

104 lines not on this page · raw message

ricci/include/XML_tags.h +23 -30

77 lines not on this page · raw message

ricci/include/array_auto_ptr.h +15 -18
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -24,23 +24,20 @@
 #ifndef array_auto_ptr_h
 #define array_auto_ptr_h
 
-
 template <class T>
 class array_auto_ptr
 {
- public:
-  array_auto_ptr(T* array) : _arr(array) {}
-  virtual ~array_auto_ptr() { delete[] _arr; }
-  
-  T& operator [] (unsigned int i) { return _arr[i]; }
-  T* get() { return _arr; }
-  
- private:
-  T* _arr;
-  
-  array_auto_ptr(const array_auto_ptr&);
-  array_auto_ptr& operator= (const array_auto_ptr&);
-};  // class array_auto_ptr
-
+	public:
+		array_auto_ptr(T* array) : _arr(array) {}
+		virtual ~array_auto_ptr() { delete[] _arr; }
+
+		T& operator [] (unsigned int i) { return _arr[i]; }
+		T* get() { return _arr; }
+
+	private:
+		T* _arr;
+		array_auto_ptr(const array_auto_ptr&);
+		array_auto_ptr& operator= (const array_auto_ptr&);
+};
 
-#endif  // array_auto_ptr_h
+#endif
ricci/include/counting_auto_ptr.cpp +49 -49

151 lines not on this page · raw message

ricci/include/counting_auto_ptr.h +22 -27

70 lines not on this page · raw message

ricci/include/executils.h +15 -14
@@ -1,5 +1,5 @@
 /*
-  Copyright Red Hat, Inc. 2005
+  Copyright Red Hat, Inc. 2005-2007
 
   This program is free software; you can redistribute it and/or modify it
   under the terms of the GNU General Public License as published by the
@@ -13,7 +13,7 @@
 
   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to the
-  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge, 
+  Free Software Foundation, Inc.,  675 Mass Ave, Cambridge,
   MA 02139, USA.
 */
 /*
@@ -21,22 +21,23 @@
  */
 
 
-#ifndef executils_h
-#define executils_h
+#ifndef __CONGA_executils_h
+#define __CONGA_executils_h
 
 #include "String.h"
 #include <vector>
 
 
-// return 0 on success, non-zero on failure
-int execute(const String& path, 
-	    const std::vector<String>& args,
-	    String& out,
-	    String& err,
-	    int& status,
-	    int timeout=-1 /* milliseconds, 
-			      kill child after timeout has elapsed, 
-			      negative for no timeout */ );
-
+/*
+** return 0 on success, non-zero on failure
+** Kill the child process after @timeout ms has elapsed,
+** if @timeout is negative, there's no no timeout
+*/
+int execute(const String& path,
+			const std::vector<String>& args,
+			String& out,
+			String& err,
+			int& status,
+			int timeout=-1);
 
 #endif  // executils_h
ricci/include/executils_test.h +2 -2
@@ -9,10 +9,10 @@
 class Killer : public ClusterMonitoring::Thread
 {
  public:
-  
+
  protected:
   virtual void run();
-  
+
 };
 
 
ricci/include/shred_allocator.h +19 -19
@@ -40,9 +40,9 @@
 void
 shred(_Tp* __p, size_t n)
 {
-  size_t size = sizeof(_Tp) / sizeof(char) * n; 
+  size_t size = sizeof(_Tp) / sizeof(char) * n;
   if (size && __p)
-    for (char *ptr = (char*) __p; 
+    for (char *ptr = (char*) __p;
 	 ptr < ((char*) __p) + size;
 	 ptr++)
       *ptr = 'o';
@@ -60,26 +60,26 @@
   typedef _Tp&       reference;
   typedef const _Tp& const_reference;
   typedef _Tp        value_type;
-  
+
   template<typename _Tp1>
   struct rebind
   { typedef shred_allocator<_Tp1> other; };
-  
+
   shred_allocator() throw() { }
-  
+
   shred_allocator(const shred_allocator&) throw() { }
-  
+
   template<typename _Tp1>
   shred_allocator(const shred_allocator<_Tp1>&) throw() { }
-  
+
   ~shred_allocator() throw() { }
-  
+
   pointer
   address(reference __x) const { return &__x; }
-  
+
   const_pointer
   address(const_reference __x) const { return &__x; }
-  
+
   // NB: __n is permitted to be 0.  The C++ standard says nothing
   // about what the return value is when __n == 0.
   pointer
@@ -90,26 +90,26 @@
       throw std::bad_alloc();
     return __ret;
   }
-  
+
   // __p is not permitted to be a null pointer.
   void
   deallocate(pointer __p, size_type n)
-  { 
+  {
     shred(__p, n);
     free(static_cast<void*>(__p));
   }
-  
+
   size_type
-  max_size() const throw() 
+  max_size() const throw()
   { return size_t(-1) / sizeof(_Tp); }
-  
+
   // _GLIBCXX_RESOLVE_LIB_DEFECTS
   // 402. wrong new expression in [some_] allocator::construct
-  void 
-  construct(pointer __p, const _Tp& __val) 
+  void
+  construct(pointer __p, const _Tp& __val)
   { ::new(__p) _Tp(__val); }
-  
-  void 
+
+  void
   destroy(pointer __p) { __p->~_Tp(); }
 };
 
ricci/include/utils.h +68 -74

174 lines not on this page · raw message