r2617 - in trunk/libmutil: include include/libmutil source

mikma at minisip.org mikma at minisip.org
Sun Jun 4 13:05:21 CEST 2006


Author: mikma
Date: 2006-06-04 13:05:20 +0200 (Sun, 04 Jun 2006)
New Revision: 2617

Modified:
   trunk/libmutil/include/compilation_config_w32_wce.h
   trunk/libmutil/include/libmutil/MemObject.h
   trunk/libmutil/include/libmutil/dbg.h
   trunk/libmutil/include/libmutil/itoa.h
   trunk/libmutil/include/libmutil/mtime.h
   trunk/libmutil/include/libmutil/mtypes.h
   trunk/libmutil/source/CondVarPosix.cxx
   trunk/libmutil/source/IString.cxx
   trunk/libmutil/source/Timestamp.cxx
   trunk/libmutil/source/dbg.cxx
Log:
Fix svn:eol-style on all text files in libmutil with mixed CRLF/LF.
It will prevent eol style changes in the future.


Modified: trunk/libmutil/include/compilation_config_w32_wce.h
===================================================================
--- trunk/libmutil/include/compilation_config_w32_wce.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/compilation_config_w32_wce.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -1,6 +1,6 @@
 #ifndef _LIBMUTIL_COMPILATION_CONFIG
 #define _LIBMUTIL_COMPILATION_CONFIG
-
+
 #ifdef _WIN32_WCE
 
 /* Debug output */
@@ -72,4 +72,5 @@
 
 #endif
 //_LIBMUTIL_COMPILATION_CONFIG
-
+
+


Property changes on: trunk/libmutil/include/compilation_config_w32_wce.h
___________________________________________________________________
Name: svn:eol-style
   + CRLF

Modified: trunk/libmutil/include/libmutil/MemObject.h
===================================================================
--- trunk/libmutil/include/libmutil/MemObject.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/libmutil/MemObject.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -396,8 +396,8 @@
 	ret = getPointer();
 	if( ret == NULL ) {
 		#ifdef DEBUG_OUTPUT
-		std::cerr << "MRef::operator-> : ERROR: trying to access a null pointer (";
-		std::cerr << typeid(OPType).name() << ").";
+		std::cerr << "MRef::operator-> : ERROR: trying to access a null pointer (";
+		std::cerr << typeid(OPType).name() << ").";
 		std::cerr << std::endl;
 		std::cerr << "Stack trace: "<< getStackTraceString() << std::endl;
 		#endif


Property changes on: trunk/libmutil/include/libmutil/MemObject.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/include/libmutil/dbg.h
===================================================================
--- trunk/libmutil/include/libmutil/dbg.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/libmutil/dbg.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -36,10 +36,10 @@
 #define DBG_INFO 0
 #define DBG_ERROR 1
 
-//==================================================================
-//if not win ce, pocket pc ... inherit from iostream and stringbuf
-//otherwise, use an old version of the debug class (release 1923)
-#ifndef _WIN32_WCE
+//==================================================================
+//if not win ce, pocket pc ... inherit from iostream and stringbuf
+//otherwise, use an old version of the debug class (release 1923)
+#ifndef _WIN32_WCE
 
 	class LIBMUTIL_API DbgHandler {
 		public:
@@ -51,7 +51,7 @@
 			friend class DbgBuf;
 	};
 
-	class LIBMUTIL_API DbgBuf : public std::stringbuf {
+	class LIBMUTIL_API DbgBuf : public std::stringbuf {
 		public:
 			DbgBuf( DbgHandler * dbgHandler );
 			virtual ~DbgBuf();
@@ -62,7 +62,7 @@
 			DbgHandler * debugHandler;
 	};
 
-	class LIBMUTIL_API Dbg: public std::ostream {
+	class LIBMUTIL_API Dbg: public std::ostream {
 		public:
 		Dbg(bool error_output=false, bool enabled=true);
 		virtual ~Dbg();
@@ -83,61 +83,61 @@
 
 	extern LIBMUTIL_API Dbg mout;
 	extern LIBMUTIL_API Dbg merr;
-	extern LIBMUTIL_API Dbg mdbg;
+	extern LIBMUTIL_API Dbg mdbg;
 
 	extern LIBMUTIL_API bool outputStateMachineDebug;
 	
-	extern LIBMUTIL_API std::ostream &end(std::ostream &os);
-
-//==================================================================
-//if wince, use the old interface ... ======================
-#else
-
-	class LIBMUTIL_API DbgEndl{
-		public:
-			DbgEndl(){}
-		private:
-			int i;
-	};
-
-	class LIBMUTIL_API DbgHandler{
-		public:
-			virtual ~DbgHandler(){}
+	extern LIBMUTIL_API std::ostream &end(std::ostream &os);
+
+//==================================================================
+//if wince, use the old interface ... ======================
+#else
+
+	class LIBMUTIL_API DbgEndl{
+		public:
+			DbgEndl(){}
+		private:
+			int i;
+	};
+
+	class LIBMUTIL_API DbgHandler{
+		public:
+			virtual ~DbgHandler(){}
 		protected:
-			virtual void displayMessage(std::string output,int style=-1)=0;
-		private:
-			friend class Dbg;
-	};
-
-	class LIBMUTIL_API Dbg{
-		public:
-			static const DbgEndl endl;
-			Dbg(bool error_output=false, bool enabled=true);
+			virtual void displayMessage(std::string output,int style=-1)=0;
+		private:
+			friend class Dbg;
+	};
 
-			Dbg &operator<<(std::string);
-			Dbg &operator<<(int);
-			Dbg &operator<<(char);
-			Dbg &operator<<(DbgEndl &endl);
+	class LIBMUTIL_API Dbg{
+		public:
+			static const DbgEndl endl;
+			Dbg(bool error_output=false, bool enabled=true);
 
-			void setEnabled(bool enabled);
-			bool getEnabled();
-			void setExternalHandler(DbgHandler * dbgHandler);
+			Dbg &operator<<(std::string);
+			Dbg &operator<<(int);
+			Dbg &operator<<(char);
+			Dbg &operator<<(DbgEndl &endl);
 
-		private:
-			bool error_out;
-			bool enabled;
-			std::string str;
-			DbgHandler * debugHandler;
-	};
-
-	extern LIBMUTIL_API Dbg mout;
-	extern LIBMUTIL_API Dbg merr;
-	extern LIBMUTIL_API Dbg mdbg;
-	extern LIBMUTIL_API DbgEndl end;
-
-	extern LIBMUTIL_API bool outputStateMachineDebug;
-
-#endif
+			void setEnabled(bool enabled);
+			bool getEnabled();
+			void setExternalHandler(DbgHandler * dbgHandler);
 
+		private:
+			bool error_out;
+			bool enabled;
+			std::string str;
+			DbgHandler * debugHandler;
+	};
+
+	extern LIBMUTIL_API Dbg mout;
+	extern LIBMUTIL_API Dbg merr;
+	extern LIBMUTIL_API Dbg mdbg;
+	extern LIBMUTIL_API DbgEndl end;
+
+	extern LIBMUTIL_API bool outputStateMachineDebug;
+
 #endif
 
+#endif
+


Property changes on: trunk/libmutil/include/libmutil/dbg.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/include/libmutil/itoa.h
===================================================================
--- trunk/libmutil/include/libmutil/itoa.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/libmutil/itoa.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -34,9 +34,9 @@
 #ifndef ITOA_H
 #define ITOA_H
 
-#include <libmutil/libmutil_config.h>
-
-#include<string>
+#include <libmutil/libmutil_config.h>
+
+#include<string>
 #include<libmutil/mtypes.h>
 
 LIBMUTIL_API std::string itoa(int64_t i);


Property changes on: trunk/libmutil/include/libmutil/itoa.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/include/libmutil/mtime.h
===================================================================
--- trunk/libmutil/include/libmutil/mtime.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/libmutil/mtime.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -27,31 +27,31 @@
 #define MINISIP_TIME_H
 
 #include <libmutil/libmutil_config.h>
-
-#include<libmutil/mtypes.h>
 
-#if defined WIN32 || defined _MSC_VER
-	#include<time.h>
+#include<libmutil/mtypes.h>
+
+#if defined WIN32 || defined _MSC_VER
+	#include<time.h>
 	#include <sys/timeb.h>
 	#ifdef __MINGW32__
 	#	include<sys/time.h>
-	#endif
-	/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95).  */
-	struct timezone{
-			int tz_minuteswest;     /* Minutes west of GMT.  */
-			int tz_dsttime;     /* Nonzero if DST is ever in effect.  */
-	};
-
-	#ifdef _WIN32_WCE
-	//MS EVC++ 4.0 defines struct timeval in winsock.h and winsock2.h ... 
-	//it is sad, but we include winsock2.h just to obtain this structure ... 
-		#include<winsock2.h>
-	#endif
-	LIBMUTIL_API void gettimeofday (struct timeval *tv, struct timezone *tz);
-#endif
+	#endif
+	/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95).  */
+	struct timezone{
+			int tz_minuteswest;     /* Minutes west of GMT.  */
+			int tz_dsttime;     /* Nonzero if DST is ever in effect.  */
+	};
 
-LIBMUTIL_API uint64_t mtime();
+	#ifdef _WIN32_WCE
+	//MS EVC++ 4.0 defines struct timeval in winsock.h and winsock2.h ... 
+	//it is sad, but we include winsock2.h just to obtain this structure ... 
+		#include<winsock2.h>
+	#endif
+	LIBMUTIL_API void gettimeofday (struct timeval *tv, struct timezone *tz);
+#endif
 
+LIBMUTIL_API uint64_t mtime();
+
 /**
  * Purpose: Implement a platform independent way of delaying 
  *		execution of a thread.
@@ -60,5 +60,5 @@
  * @return -1 if error, else otherwise
  */
 LIBMUTIL_API int msleep(int32_t msec);
-
+
 #endif


Property changes on: trunk/libmutil/include/libmutil/mtime.h
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/include/libmutil/mtypes.h
===================================================================
--- trunk/libmutil/include/libmutil/mtypes.h	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/include/libmutil/mtypes.h	2006-06-04 11:05:20 UTC (rev 2617)
@@ -1,8 +1,8 @@
-#ifndef _MTYPES_H
-#define _MTYPES_H
-
-// Add cross-platform, cross library/application types in this file.
+#ifndef _MTYPES_H
+#define _MTYPES_H
 
+// Add cross-platform, cross library/application types in this file.
+
 #ifdef _MSC_VER
 
 #ifndef int8_t
@@ -52,5 +52,6 @@
 #endif //_MSC_VER
 
 typedef uint8_t byte_t;
-
-#endif
+
+#endif
+


Property changes on: trunk/libmutil/include/libmutil/mtypes.h
___________________________________________________________________
Name: svn:eol-style
   + CRLF

Modified: trunk/libmutil/source/CondVarPosix.cxx
===================================================================
--- trunk/libmutil/source/CondVarPosix.cxx	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/source/CondVarPosix.cxx	2006-06-04 11:05:20 UTC (rev 2617)
@@ -79,8 +79,8 @@
 		}
 		
 		pthread_cond_timedwait( INTERNAL_COND_WAIT, (pthread_mutex_t*)mutex.handle_ptr,
-				&ts );
-	}
+				&ts );
+	}
 }
 
 void CondVar::broadcast(){


Property changes on: trunk/libmutil/source/CondVarPosix.cxx
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/source/IString.cxx
===================================================================
--- trunk/libmutil/source/IString.cxx	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/source/IString.cxx	2006-06-04 11:05:20 UTC (rev 2617)
@@ -29,11 +29,11 @@
 }
 
 StringAtom::StringAtom(std::string s){
-#ifdef _WIN32_WCE
-	buf = _strdup(s.c_str());
-#else
-	buf = strdup(s.c_str());
-#endif
+#ifdef _WIN32_WCE
+	buf = _strdup(s.c_str());
+#else
+	buf = strdup(s.c_str());
+#endif
 	n = (int)s.length();
 }
 


Property changes on: trunk/libmutil/source/IString.cxx
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/source/Timestamp.cxx
===================================================================
--- trunk/libmutil/source/Timestamp.cxx	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/source/Timestamp.cxx	2006-06-04 11:05:20 UTC (rev 2617)
@@ -23,18 +23,18 @@
 
 #include<config.h>
 
-#include<libmutil/Timestamp.h>
+#include<libmutil/Timestamp.h>
 
-Timestamp ts;
+Timestamp ts;
 
 using namespace std;
 
 #define MAX_TIMESTAMPS 256
 
 string id_names[25] = { "invite_start", "invite_end", "mikey_start", "mikey_end", "ringing", "packet_in", "packet_out", "tls_start", "tls_end", "dh_precompute_start", "dh_precompute_end", "mikey_create_start", "mikey_create_end", "rand_start", "rand_end", "sign_start", "sign_end", "auth_start", "auth_end",  "mikey_parse_start", "mikey_parse_end", "tgk_start", "tgk_end", "user_accept" ,"tmp"};
-
-#ifdef WIN32
-	Timestamp::Timestamp(){}
+
+#ifdef WIN32
+	Timestamp::Timestamp(){}
 #else
 	Timestamp::Timestamp(){
 		tz = new struct timezone;
@@ -44,33 +44,33 @@
 		index = 0;
 		auto_id=-1;
 	}
-#endif
+#endif
 
-#ifdef WIN32
-	Timestamp::~Timestamp(){}
-#else
+#ifdef WIN32
+	Timestamp::~Timestamp(){}
+#else
 	Timestamp::~Timestamp(){
 		delete tz;
 		delete [] values;
 		delete [] strings;
 		delete [] ids;
-	}
-#endif
-
-#ifdef WIN32
-	void Timestamp::save( uint32_t id ){}
-#else
+	}
+#endif
+
+#ifdef WIN32
+	void Timestamp::save( uint32_t id ){}
+#else
 	void Timestamp::save( uint32_t id ){
 		ids[index] = id;
 		gettimeofday( &values[index], tz );
 		index = ( index + 1 ) % MAX_TIMESTAMPS;
 		//values[ index++ ] = ((uint64_t)tv->tv_sec << 32) |tv->tv_usec;
 	}
-#endif
-
-#ifdef WIN32
-	void Timestamp::save( string s){}
-#else
+#endif
+
+#ifdef WIN32
+	void Timestamp::save( string s){}
+#else
 	void Timestamp::save( string s){
 		ids[index] = auto_id--;
 		if( -(auto_id+1) > MAX_TIMESTAMPS )
@@ -81,12 +81,12 @@
 		index = ( index + 1 ) % MAX_TIMESTAMPS;
 		gettimeofday( &values[index], tz );
 		//values[ index++ ] = ((uint64_t)tv->tv_sec << 32) |tv->tv_usec;
-	}
-#endif
-
-#ifdef WIN32
-	void Timestamp::print(){}
-#else
+	}
+#endif
+
+#ifdef WIN32
+	void Timestamp::print(){}
+#else
 	void Timestamp::print(){
 		uint32_t i;
 		struct timeval temp;
@@ -104,11 +104,11 @@
 			temp = values[i];
 		}
 	}
-#endif
-
-#ifdef WIN32
-	void Timestamp::init(std::string filename, std::string init_data){}
-#else
+#endif
+
+#ifdef WIN32
+	void Timestamp::init(std::string filename, std::string init_data){}
+#else
 	void Timestamp::init(std::string filename, std::string init_data){
 		this->filename=filename;
 		
@@ -117,33 +117,33 @@
 		file << init_data << endl;
 		file.close();
 	}
-#endif
-
-#ifdef WIN32
-	void Timestamp::start(){}
-#else
+#endif
+
+#ifdef WIN32
+	void Timestamp::start(){}
+#else
 	void Timestamp::start(){
 		timeval tim;
 		gettimeofday(&tim, NULL);
 		startTime=tim.tv_sec + (tim.tv_usec/1000000.0);
 	}
 
-#endif
-
-#ifdef WIN32
-	void Timestamp::stop(){}
-#else
+#endif
+
+#ifdef WIN32
+	void Timestamp::stop(){}
+#else
 	void Timestamp::stop(){
 	timeval tim;
 	gettimeofday(&tim, NULL);
 	stopTime=tim.tv_sec + (tim.tv_usec/1000000.0);
 }
 
-#endif
-
-#ifdef WIN32
-	string Timestamp::writeElapsedTime(std::string descr){ return "1"; }
-#else
+#endif
+
+#ifdef WIN32
+	string Timestamp::writeElapsedTime(std::string descr){ return "1"; }
+#else
 	string Timestamp::writeElapsedTime(std::string descr){
 	double elapsedTime = stopTime-startTime;
 	


Property changes on: trunk/libmutil/source/Timestamp.cxx
___________________________________________________________________
Name: svn:eol-style
   + native

Modified: trunk/libmutil/source/dbg.cxx
===================================================================
--- trunk/libmutil/source/dbg.cxx	2006-06-04 10:53:57 UTC (rev 2616)
+++ trunk/libmutil/source/dbg.cxx	2006-06-04 11:05:20 UTC (rev 2617)
@@ -32,12 +32,12 @@
 #include<iostream>
 
 #include<libmutil/itoa.h>
-
-//==================================================================
-//if not win ce, pocket pc ... inherit from iostream and stringbuf
-//otherwise, use an old version of the debug class (release 1923)
-#ifndef _WIN32_WCE
 
+//==================================================================
+//if not win ce, pocket pc ... inherit from iostream and stringbuf
+//otherwise, use an old version of the debug class (release 1923)
+#ifndef _WIN32_WCE
+
 Dbg mout;
 Dbg merr(false);
 Dbg mdbg(true, false);
@@ -120,105 +120,105 @@
 std::ostream &end(std::ostream &os)
 {
 	return std::endl( os );
-}
-
-//==================================================================
-//if wince, use the old interface ... ======================
-#else
-
-Dbg mout;
-Dbg merr(false);
-Dbg mdbg(true, false);
-DbgEndl end;
-
-LIBMUTIL_API bool outputStateMachineDebug = false;
-
-Dbg::Dbg(bool error_output, bool isEnabled):error_out(error_output), enabled(isEnabled), debugHandler(NULL){
-}
-
-void Dbg::setEnabled(bool e){
-	enabled = e;
-}
-
-bool Dbg::getEnabled(){
-	return enabled;
-}
-
-Dbg &Dbg::operator<<(std::string s){
-	if (!enabled)
-		return *this;
-	//    std::cerr << "Doing textui output"<< std::endl;
-	
-	if (debugHandler!=NULL){
-		str +=s;
-		if (str[str.size()-1]=='\n'){
-			if (error_out)
-				std::cerr << str << std::flush;
-			else
-				debugHandler->displayMessage(str,0);
-			str="";
-		}
-	}else{
-		if (error_out)
-			std::cerr << s;
-		else
-			std::cout<<s;
-	}
-	return *this;
-}
-
-Dbg &Dbg::operator<<(DbgEndl &){
-
-	if (!enabled)
-		return *this;
-	//    std::cerr << "DbgEndl called"<< std::endl;
-	if (debugHandler!=NULL){
-		str+="\n";
-		(*this)<< "";
-	}else{
-		if (error_out)
-			std::cerr << std::endl;
-		else
-			std::cout << std::endl;
-	}
-
-	return *this;
-}
-
-Dbg& Dbg::operator<<(int i){
-
-	if (!enabled)
-		return *this;
-    
-    if (debugHandler!=NULL)
-        str += itoa(i);
-    else{
-	if (error_out)
-		std::cerr << i;
-	else
-		std::cout << i;
-    }
-    return (*this);
-}
-
-Dbg& Dbg::operator<<(char c){
-
-	if (!enabled)
-		return *this;
-
-	if (debugHandler!=NULL)
-		str += c;
-	else{
-		if (error_out)
-			std::cerr << c;
-		else
-			std::cout << c;
-	}
-	return *this;
-}
-
-void Dbg::setExternalHandler(DbgHandler * debugHandler){
-	this->debugHandler = debugHandler;
 }
 
+//==================================================================
+//if wince, use the old interface ... ======================
+#else
+
+Dbg mout;
+Dbg merr(false);
+Dbg mdbg(true, false);
+DbgEndl end;
+
+LIBMUTIL_API bool outputStateMachineDebug = false;
+
+Dbg::Dbg(bool error_output, bool isEnabled):error_out(error_output), enabled(isEnabled), debugHandler(NULL){
+}
+
+void Dbg::setEnabled(bool e){
+	enabled = e;
+}
+
+bool Dbg::getEnabled(){
+	return enabled;
+}
+
+Dbg &Dbg::operator<<(std::string s){
+	if (!enabled)
+		return *this;
+	//    std::cerr << "Doing textui output"<< std::endl;
+	
+	if (debugHandler!=NULL){
+		str +=s;
+		if (str[str.size()-1]=='\n'){
+			if (error_out)
+				std::cerr << str << std::flush;
+			else
+				debugHandler->displayMessage(str,0);
+			str="";
+		}
+	}else{
+		if (error_out)
+			std::cerr << s;
+		else
+			std::cout<<s;
+	}
+	return *this;
+}
+
+Dbg &Dbg::operator<<(DbgEndl &){
+
+	if (!enabled)
+		return *this;
+	//    std::cerr << "DbgEndl called"<< std::endl;
+	if (debugHandler!=NULL){
+		str+="\n";
+		(*this)<< "";
+	}else{
+		if (error_out)
+			std::cerr << std::endl;
+		else
+			std::cout << std::endl;
+	}
+
+	return *this;
+}
+
+Dbg& Dbg::operator<<(int i){
+
+	if (!enabled)
+		return *this;
+    
+    if (debugHandler!=NULL)
+        str += itoa(i);
+    else{
+	if (error_out)
+		std::cerr << i;
+	else
+		std::cout << i;
+    }
+    return (*this);
+}
+
+Dbg& Dbg::operator<<(char c){
+
+	if (!enabled)
+		return *this;
+
+	if (debugHandler!=NULL)
+		str += c;
+	else{
+		if (error_out)
+			std::cerr << c;
+		else
+			std::cout << c;
+	}
+	return *this;
+}
+
+void Dbg::setExternalHandler(DbgHandler * debugHandler){
+	this->debugHandler = debugHandler;
+}
+
 #endif


Property changes on: trunk/libmutil/source/dbg.cxx
___________________________________________________________________
Name: svn:eol-style
   + native



More information about the Minisip-devel mailing list