Index: ext/libicpf/src/Makefile.am =================================================================== diff -u -N -re17c80d36eaa0430313e7d1058aa7a301d1510af -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/Makefile.am (.../Makefile.am) (revision e17c80d36eaa0430313e7d1058aa7a301d1510af) +++ ext/libicpf/src/Makefile.am (.../Makefile.am) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,16 +1,16 @@ lib_LTLIBRARIES = libicpf.la -libicpf_la_SOURCES = callback.cpp exception.cpp \ +libicpf_la_SOURCES = callback.cpp exception.cpp circ_buffer.cpp \ str.cpp log.cpp dumpctx.cpp cfg.cpp str_help.cpp \ crc32.cpp file.cpp module.cpp conv.cpp crypt.cpp rijndael-alg-fst.c \ - rijndael-api-fst.c sha256.c + rijndael-api-fst.c sha256.c mutex.cpp # set the include path found by configure INCLUDES = $(all_includes) # the library search path. libicpf_la_LDFLAGS = $(all_libraries) libicpf_la_LIBADD = -ldl -lpthread -dist_include_HEADERS = callback.h exception.h str.h dumpctx.h cfg.h module.h \ +dist_include_HEADERS = callback.h exception.h str.h dumpctx.h cfg.h circ_buffer.h module.h \ file.h log.h cfg.h str_help.h crc32.h libicpf.h gen_types.h \ conv.h crypt.h err_codes.h gen_types.h macros.h mutex.h \ rijndael-alg-fst.h rijndael-api-fst.h sha256.h Index: ext/libicpf/src/callback.cpp =================================================================== diff -u -N -r79aeaf4a65732f3b3fe6ba19a80651381d6b3362 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/callback.cpp (.../callback.cpp) (revision 79aeaf4a65732f3b3fe6ba19a80651381d6b3362) +++ ext/libicpf/src/callback.cpp (.../callback.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -/** \file callback.cpp + /** \file callback.cpp * \brief File provides the implementation of callback classes. */ #include "callback.h" Index: ext/libicpf/src/callback.h =================================================================== diff -u -N -r79aeaf4a65732f3b3fe6ba19a80651381d6b3362 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/callback.h (.../callback.h) (revision 79aeaf4a65732f3b3fe6ba19a80651381d6b3362) +++ ext/libicpf/src/callback.h (.../callback.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -32,7 +32,11 @@ BEGIN_ICPF_NAMESPACE /// General function definition -typedef void(__stdcall *PFNFUNC)(void); +#ifdef _WIN32 + typedef void(__stdcall *PFNFUNC)(void); +#else + typedef void(*PFNFUNC)(void); +#endif /// Helper structure for callback class struct LIBICPF_API CLBDATA @@ -80,7 +84,11 @@ { protected: /// Callback1-type callback function +#ifdef _WIN32 typedef R(__stdcall *PFNCALLBACKPROC1)(ptr_t, P1); +#else + typedef R(*PFNCALLBACKPROC1)(ptr_t, P1); +#endif public: /** \name Construction/destruction */ @@ -137,7 +145,11 @@ { protected: /// Callback2-type callback function +#ifdef _WIN32 typedef R(__stdcall *PFNCALLBACKPROC2)(ptr_t, P1, P2); +#else + typedef R(*PFNCALLBACKPROC2)(ptr_t, P1, P2); +#endif public: /** \name Construction/destruction */ @@ -195,7 +207,11 @@ { protected: /// Callback2-type callback function +#ifdef _WIN32 typedef R(__stdcall *PFNCALLBACKPROC3)(ptr_t, P1, P2, P3); +#else + typedef R(*PFNCALLBACKPROC3)(ptr_t, P1, P2, P3); +#endif public: /** \name Construction/destruction */ Index: ext/libicpf/src/cfg.cpp =================================================================== diff -u -N -r1fbcd33fe6584a3de195ac6fb7465f83d75ff6f5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/cfg.cpp (.../cfg.cpp) (revision 1fbcd33fe6584a3de195ac6fb7465f83d75ff6f5) +++ ext/libicpf/src/cfg.cpp (.../cfg.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -129,7 +129,7 @@ /** Retrieves a pointer to a global instance of a config class * \return Pointer to the config class */ -config* get_config() +config* config::get_config() { return __g_cfg; } Index: ext/libicpf/src/cfg.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/cfg.h (.../cfg.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/cfg.h (.../cfg.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -65,7 +65,9 @@ extern config *__g_cfg; +#ifdef _WIN32 ICPFTEMPL_EXTERN template class LIBICPF_API callback2; +#endif /** \brief Structure contain information about one property. * @@ -225,7 +227,7 @@ /**@}*/ #endif - friend config* get_config(); ///< Retrieves the pointer to the global config class + static config* get_config(); ///< Retrieves the pointer to the global config class protected: char_t* trim(char_t* pszString) const; ///< Gets rid of whitespace characters from a string @@ -249,6 +251,8 @@ #ifdef USE_ENCRYPTION string m_strPassword; ///< Password to encrypt/decrypt properties with #endif + +public: callback2 m_clbPropertyChanged; ///< Callback (callback2) which is executed when any property has changed // First param is count of properties changed (-1 if all changed), second one the prop_group* (or NULL if none changed) }; Index: ext/libicpf/src/circ_buffer.cpp =================================================================== diff -u -N -r2d8768b58e87cc42faa38ff54e615e69db27ffd9 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/circ_buffer.cpp (.../circ_buffer.cpp) (revision 2d8768b58e87cc42faa38ff54e615e69db27ffd9) +++ ext/libicpf/src/circ_buffer.cpp (.../circ_buffer.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,19 +1,19 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * ixen2@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * 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 Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ @@ -241,6 +241,11 @@ } } +void circular_buffer::free_string(char_t* pszString) +{ + delete [] pszString; +} + size_t circular_buffer::find(size_t tStartAt, ulong_t ulFnd) const { assert(m_pbyBuffer); @@ -376,7 +381,7 @@ void circular_buffer::push_bits(ulong_t ulBits, byte_t byCount) { - assert(m_pbyBuffer); +// assert(m_pbyBuffer); assert(byCount <= 32 && byCount >= 1); // count of bits must be a sane value assert(m_tBitsAtEndCount <= 7); // the internal bits count must be from the range [0..7]. For 8 bits in a buffer // there is value of 0. Index: ext/libicpf/src/circ_buffer.h =================================================================== diff -u -N -r0841fb30dd4ee427a75fe6b10d2a5b15ac384966 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/circ_buffer.h (.../circ_buffer.h) (revision 0841fb30dd4ee427a75fe6b10d2a5b15ac384966) +++ ext/libicpf/src/circ_buffer.h (.../circ_buffer.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,19 +1,19 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * ixen2@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * 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 Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * - * You should have received a copy of the GNU General Public License * - * along with this program; if not, write to the * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ @@ -22,6 +22,9 @@ #include "libicpf.h" #include "gen_types.h" +#ifndef _WIN32 + #include +#endif BEGIN_ICPF_NAMESPACE @@ -57,14 +60,16 @@ size_t pop_data(byte_t* pbyBuffer, size_t tCount); bool pop_ulonglong(ull_t* pull); bool pop_ulong(ulong_t* pul); - ulong_t pop_string(char_t** pszString); // returns the length of alloc string (-1 for error) bool pop_ushort(ushort_t* pw); bool pop_uchar(uchar_t* pby); + ulong_t pop_string(char_t** pszString); // returns the length of alloc string (-1 for error) + static void free_string(char_t* pszString); // frees the string allocated with pop_string // operation on single bits void push_bits(ulong_t ulBits, byte_t byCount); // void PushBitsFinish(); // finishes the operation of pushing bits, so we could use normal Push/PopData - void enum_bit_packets(unsigned long ulBitsCount, PFNBITSCALLBACK pfn, void* pParam) const; + void enum_bit_packets(ulong_t ulBitsCount, PFNBITSCALLBACK pfn, void* pParam) const; + size_t get_bits_at_end() const { return m_tBitsAtEndCount; }; // searching int forward_seek(ulong_t ulFnd); // seeks for the value and skips the bytes previous to it Index: ext/libicpf/src/conv.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/conv.cpp (.../conv.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/conv.cpp (.../conv.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/conv.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/conv.h (.../conv.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/conv.h (.../conv.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/crc32.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/crc32.cpp (.../crc32.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/crc32.cpp (.../crc32.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -23,6 +23,9 @@ #include "crc32.h" #include +#ifndef _WIN32 + #include +#endif BEGIN_ICPF_NAMESPACE Index: ext/libicpf/src/crc32.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/crc32.h (.../crc32.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/crc32.h (.../crc32.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/crypt.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/crypt.cpp (.../crypt.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/crypt.cpp (.../crypt.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/crypt.h =================================================================== diff -u -N -re17c80d36eaa0430313e7d1058aa7a301d1510af -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/crypt.h (.../crypt.h) (revision e17c80d36eaa0430313e7d1058aa7a301d1510af) +++ ext/libicpf/src/crypt.h (.../crypt.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/dmutex.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/dmutex.cpp (.../dmutex.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/dmutex.cpp (.../dmutex.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2004-2006 by J�zef Starosczyk * - * ixen@draknet.sytes.net * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/dmutex.h =================================================================== diff -u -N -r0ec0dc6be33bf80d16d27555d107509810a93462 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/dmutex.h (.../dmutex.h) (revision 0ec0dc6be33bf80d16d27555d107509810a93462) +++ ext/libicpf/src/dmutex.h (.../dmutex.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2004-2006 by J�zef Starosczyk * - * ixen@draknet.sytes.net * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/dumpctx.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/dumpctx.cpp (.../dumpctx.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/dumpctx.cpp (.../dumpctx.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** * Copyright (C) 2004-2006 by J�zef Starosczyk * - * ixen@draknet.sytes.net * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/dumpctx.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/dumpctx.h (.../dumpctx.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/dumpctx.h (.../dumpctx.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/err_codes.h =================================================================== diff -u -N -r21ba867709ff00080a99145169cc3de383a74f13 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/err_codes.h (.../err_codes.h) (revision 21ba867709ff00080a99145169cc3de383a74f13) +++ ext/libicpf/src/err_codes.h (.../err_codes.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/exception.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/exception.cpp (.../exception.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/exception.cpp (.../exception.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/exception.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/exception.h (.../exception.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/exception.h (.../exception.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -73,6 +73,13 @@ /** \name Outputting */ /**@{*/ const char_t* get_info(char_t* pszInfo, intptr_t tMaxLen); ///< Retrieves the exception information to a specified string buffer + const char_t* get_desc() const { return m_pszDesc; }; + const char_t* get_filename() const { return m_pszFilename; }; + const char_t* get_function() const { return m_pszFunction; }; + uint_t get_line() const { return m_uiLine; }; + uint_t get_appcode() const { return m_uiAppCode; }; + uint_t get_syscode() const { return m_uiSystemCode; }; + void log(const char_t* pszDesc, log_file* plog); ///< Logs the exception information to the log file void log(const char_t* pszDesc, const char_t* pszDesc2, log_file* plog); ///< Logs the exception to the log file with an additional description /**@}*/ Index: ext/libicpf/src/file.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/file.cpp (.../file.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/file.cpp (.../file.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/file.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/file.h (.../file.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/file.h (.../file.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/gen_types.h =================================================================== diff -u -N -r7871106ff37289319d30704b0fb2d9ce4d3ee2c9 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/gen_types.h (.../gen_types.h) (revision 7871106ff37289319d30704b0fb2d9ce4d3ee2c9) +++ ext/libicpf/src/gen_types.h (.../gen_types.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/libicpf.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/libicpf.cpp (.../libicpf.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/libicpf.cpp (.../libicpf.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ // libicpf.cpp : Defines the entry point for the DLL application. // Index: ext/libicpf/src/libicpf.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/libicpf.h (.../libicpf.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/libicpf.h (.../libicpf.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #ifndef __LIBICPF_H__ #define __LIBICPF_H__ Index: ext/libicpf/src/log.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/log.cpp (.../log.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/log.cpp (.../log.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -89,7 +89,7 @@ * \param[in] bClean - cleans the log file upon opening * \return True if the log file has been successfully initialized or false if not. */ -bool create_log(const char_t* pszPath, int_t iMaxSize, int_t iLogLevel, bool bLogStd, bool bClean) +bool log_file::create_log(const char_t* pszPath, int_t iMaxSize, int_t iLogLevel, bool bLogStd, bool bClean) { assert(__g_log == NULL); Index: ext/libicpf/src/log.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/log.h (.../log.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/log.h (.../log.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -147,11 +147,11 @@ /**@}*/ /// Gets the global instance of the log file - friend log_file* get_log() { return __g_log; }; + static log_file* get_log() { return __g_log; }; /// Creates a global instance of a log file - friend bool create_log(const char_t* pszPath, int_t iMaxSize, int_t iLogLevel, bool bLogStd, bool bClean); + static bool create_log(const char_t* pszPath, int_t iMaxSize, int_t iLogLevel, bool bLogStd, bool bClean); /// Deletes a global instance of a log dile - friend void delete_log() { delete __g_log; }; + static void delete_log() { delete __g_log; }; protected: /// Truncates a log file not to exceed the max file size Index: ext/libicpf/src/macros.h =================================================================== diff -u -N -re17c80d36eaa0430313e7d1058aa7a301d1510af -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/macros.h (.../macros.h) (revision e17c80d36eaa0430313e7d1058aa7a301d1510af) +++ ext/libicpf/src/macros.h (.../macros.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/module.cpp =================================================================== diff -u -N -r8d691767fb8f0643d990f2613daffd4ec18422fa -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/module.cpp (.../module.cpp) (revision 8d691767fb8f0643d990f2613daffd4ec18422fa) +++ ext/libicpf/src/module.cpp (.../module.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/module.h =================================================================== diff -u -N -r8d691767fb8f0643d990f2613daffd4ec18422fa -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/module.h (.../module.h) (revision 8d691767fb8f0643d990f2613daffd4ec18422fa) +++ ext/libicpf/src/module.h (.../module.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/mutex.cpp =================================================================== diff -u -N -re794066b77a356d36056bf2541bc7076c4f1887c -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/mutex.cpp (.../mutex.cpp) (revision e794066b77a356d36056bf2541bc7076c4f1887c) +++ ext/libicpf/src/mutex.cpp (.../mutex.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,3 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU Library General Public License as * + * published by the Free Software Foundation; either version 2 of the * + * License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU Library General Public * + * License along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ #include "mutex.h" BEGIN_ICPF_NAMESPACE @@ -41,25 +60,6 @@ #endif } -// standard locking -void mutex::lock() -{ -#ifdef _WIN32 - ::EnterCriticalSection(&m_cs); -#else - pthread_mutex_lock(&m_mutex) == 0; -#endif -} - -void mutex::unlock() -{ -#ifdef _WIN32 - ::LeaveCriticalSection(&m_cs); -#else - pthread_mutex_unlock(&m_mutex) == 0; // return 0 on success -#endif -} - #ifdef ENABLE_MUTEX_DEBUGGING void mutex::lock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction) { Index: ext/libicpf/src/mutex.h =================================================================== diff -u -N -re794066b77a356d36056bf2541bc7076c4f1887c -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/mutex.h (.../mutex.h) (revision e794066b77a356d36056bf2541bc7076c4f1887c) +++ ext/libicpf/src/mutex.h (.../mutex.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -34,12 +34,12 @@ BEGIN_ICPF_NAMESPACE -#ifdef _DEBUG_MUTEX +#if defined(ENABLE_MUTEX_DEBUGGING) && defined(DEBUG_MUTEX) #define MLOCK(mutex) (mutex).lock(__FILE__, __LINE__, __FUNCTION__) - #define MUNLOCK(mutex) (mutex).lock(__FILE__, __LINE__, __FUNCTION__) + #define MUNLOCK(mutex) (mutex).unlock(__FILE__, __LINE__, __FUNCTION__) #else #define MLOCK(mutex) (mutex).lock() - #define MUNLOCK(mutex) (mutex).lock() + #define MUNLOCK(mutex) (mutex).unlock() #endif /** \brief Class provides the locking and unlocking capabilities for use with threads. @@ -73,20 +73,36 @@ * \return True if succeeded or false if not. * \note The call under windows always return true. */ - void lock(); + inline void lock() + { +#ifdef _WIN32 + ::EnterCriticalSection(&m_cs); +#else + pthread_mutex_lock(&m_mutex); +#endif + } + /** \brief Unlock access to some locked part of code * * Unlocks access to some code using the platform specific functions. * \return True if succeeded or false if not. * \note The call under windows always return true. */ - void unlock(); + inline void unlock() + { +#ifdef _WIN32 + ::LeaveCriticalSection(&m_cs); +#else + pthread_mutex_unlock(&m_mutex); // return 0 on success +#endif + } + /**@}*/ #ifdef ENABLE_MUTEX_DEBUGGING - bool lock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); - bool unlock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); + void lock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); + void unlock(const char_t* pszFile, ulong_t ulLine, const char_t* pszFunction); #endif private: #ifdef _WIN32 Index: ext/libicpf/src/str.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/str.cpp (.../str.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/str.cpp (.../str.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -306,19 +306,17 @@ /** Standard constructor - allocates the underlying data object */ string::string() : - m_psd(NULL) + m_psd(new str_data(SDF_NONE)) { - m_psd=new str_data(SDF_NONE); } /** Constructor allocates the underlying data object and initializes it with * a given ansi string. * \param[in] pszStr - source ansi string */ string::string(const char_t* pszStr) : - m_psd(NULL) + m_psd(new str_data(SDF_NONE)) { - m_psd=new str_data(SDF_NONE); set_str(pszStr); } @@ -328,9 +326,8 @@ * \param[in] pszStr - source unicode string */ string::string(const wchar_t* pszStr) : - m_psd(NULL) + m_psd(new str_data(SDF_UNICODE)) { - m_psd=new str_data(SDF_UNICODE); set_str(pszStr); } #endif Index: ext/libicpf/src/str.h =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/str.h (.../str.h) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/str.h (.../str.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * @@ -41,6 +41,7 @@ /// External class - to avoid inclusion of dumpctx.h class dumpctx; +class string; /////////////////////////////////////////////////////////////// // str_data flags Index: ext/libicpf/src/str_help.cpp =================================================================== diff -u -N -r338a33bbdb8c82416f0351408eea3243520784e5 -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/str_help.cpp (.../str_help.cpp) (revision 338a33bbdb8c82416f0351408eea3243520784e5) +++ ext/libicpf/src/str_help.cpp (.../str_help.cpp) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as * Index: ext/libicpf/src/str_help.h =================================================================== diff -u -N -re17c80d36eaa0430313e7d1058aa7a301d1510af -r2446443341715955423610c01b43fe7841a10e3e --- ext/libicpf/src/str_help.h (.../str_help.h) (revision e17c80d36eaa0430313e7d1058aa7a301d1510af) +++ ext/libicpf/src/str_help.h (.../str_help.h) (revision 2446443341715955423610c01b43fe7841a10e3e) @@ -1,6 +1,6 @@ /*************************************************************************** - * Copyright (C) 2004 by J�zef Starosczyk * - * copyhandler@o2.pl * + * Copyright (C) 2004-2006 by J�zef Starosczyk * + * ixen@copyhandler.com * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU Library General Public License as *